NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

FORM get_data .

IF p_sfha IS INITIAL.
PERFORM forward.
PERFORM canc.
PERFORM util.
ELSEIF p_sfha = '1'.
PERFORM forward.
ELSEIF p_sfha = '2'.
PERFORM util.
ELSEIF p_sfha = '3'.
PERFORM canc.
ENDIF.


ENDFORM.

*&---------------------------------------------------------------------*
*& Form FORWARD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM forward .
* CALL FUNCTION 'ZFS_FRX_FM01'
* EXPORTING
* gv_bukrs = s_bukrs
* gv_key_date = p_date
* TABLES
* gt_data = gt_txn.

********************* start------------------------------------
IF s_bukrs IS NOT INITIAL AND p_date IS NOT INITIAL.

CALL FUNCTION 'ZFS_FRX_FM05'
EXPORTING
gv_bukrs = s_bukrs-low
* GV_RFHA =
gv_key_date = p_date
TABLES
gt_data = gt_txn.
ENDIF.

DELETE gt_txn WHERE dblfz > p_date.
IF s_rfha IS NOT INITIAL.
DELETE gt_txn WHERE rfha NOT IN s_rfha.
ENDIF.
IF zsgsart IS NOT INITIAL.
DELETE gt_txn WHERE sgsart <> zsgsart.
ENDIF.


CLEAR : gt_util,gt_can.
SORT gt_txn BY rfha ASCENDING.
gt_util = gt_txn[].
gt_can = gt_txn[].

SELECT * FROM zfs_frx_t017
INTO TABLE @DATA(lt_cancel_i)
WHERE zbukrs in @s_bukrs
AND zdeal_no IN @s_rfha.

SORT gt_util BY zrfha_util ASCENDING.
SORT gt_can BY zrfha_cancel ASCENDING.

DELETE gt_util WHERE zrfha_util IS INITIAL.
DELETE gt_can WHERE zrfha_cancel IS INITIAL.
DELETE ADJACENT DUPLICATES FROM gt_txn COMPARING rfha.
DELETE ADJACENT DUPLICATES FROM gt_util COMPARING zrfha_util.
DELETE ADJACENT DUPLICATES FROM gt_can COMPARING zrfha_cancel.

************** end ----------------------------------------------------------------
* PERFORM forward_txn.
* SORT gt_txn BY rfha .
** DELETE gt_txn WHERE delfz < p_date.
*
* DATA(lt_txn) = gt_txn[].
* DELETE ADJACENT DUPLICATES FROM gt_txn COMPARING rfha.

SELECT * FROM zfs_frx_t004
INTO TABLE @DATA(lt_cash)
FOR ALL ENTRIES IN @gt_txn
WHERE zbukrs IN @s_bukrs
AND zrfha = @gt_txn-rfha.

SELECT * FROM zfs_frx_t007
INTO TABLE gt_hedge
FOR ALL ENTRIES IN gt_txn
WHERE zbukrs IN s_bukrs
AND zrfha_hedg = gt_txn-rfha.

*********************************** start---------------------------------
SELECT * FROM zfs_frx_t022
INTO CORRESPONDING FIELDS OF TABLE gt_roll
FOR ALL ENTRIES IN gt_txn
WHERE zbukrs IN s_bukrs
AND zdeal_no = gt_txn-rfha.
*********************************** end-----------------------------

IF s_rfha IS NOT INITIAL.
DELETE gt_txn WHERE rfha NOT IN s_rfha.
ENDIF.
* IF s_sgsart IS NOT INITIAL.
* DELETE gt_txn WHERE sgsart NOT IN s_sgsart.
* ENDIF.
IF s_kontrh IS NOT INITIAL.
DELETE gt_txn WHERE kontrh NOT IN s_kontrh.
ENDIF.


SORT lt_cash BY zrfha ASCENDING.
DELETE ADJACENT DUPLICATES FROM lt_cash COMPARING zrfha.

SELECT a~bukrs,
a~rfha,
a~dzterm,
a~sfhazba,
a~bzbetr,
a~wzbetr,
h~zfx_flow
FROM zfs_frx_t012 AS h
INNER JOIN vtbfhapo AS a ON h~zbukrs = a~bukrs
AND h~zflow_typ = a~sfhazba
INTO TABLE @DATA(lt_vtbfhapo)
FOR ALL ENTRIES IN @gt_txn
WHERE a~rfha = @gt_txn-rfha
AND a~bukrs IN @s_bukrs.

SELECT a~bukrs,
a~rfha,
a~dzterm,
a~sfhazba,
a~bzbetr,
a~wzbetr,
h~zfx_flow
FROM zfs_frx_t012 AS h
INNER JOIN vtbfhapo AS a ON h~zbukrs = a~bukrs
AND h~zflow_typ = a~sfhazba
INTO TABLE @DATA(gt_vtbfhapo)
FOR ALL ENTRIES IN @lt_cash
WHERE a~rfha = @lt_cash-zref_num
AND a~bukrs IN @s_bukrs.



LOOP AT gt_txn ASSIGNING FIELD-SYMBOL(<fs_txn>).
MOVE-CORRESPONDING <fs_txn> TO gw_test.
MOVE-CORRESPONDING <fs_txn> TO gw_final.
gw_final-zcur_pair = <fs_txn>-zcur_pair.

IF gw_final-zbuy_cur = 'JPY'.
gw_final-zbuy_amt = gw_final-zbuy_amt * 100.
ENDIF.

IF <fs_txn>-rfhazul = '1'.
gw_final-zdeal_status = 'Unsettled'.
ELSEIF <fs_txn>-rfhazul = '2'.
gw_final-zdeal_status = 'Settled'.
ENDIF.

gw_final-zhedcost = ( <fs_txn>-kswap + <fs_txn>-kwliqui ) * <fs_txn>-zbuy_amt.

READ TABLE lt_cash ASSIGNING FIELD-SYMBOL(<fs_cash>) WITH KEY zbukrs = <fs_txn>-bukrs
zrfha = <fs_txn>-rfha.
IF sy-subrc = 0.

CALL FUNCTION 'ZFS_FRX_FM02'
EXPORTING
bukrs = <fs_txn>-bukrs
rfha = <fs_cash>-zref_num
IMPORTING
rate = gw_final-zcc_rate
spot = gw_final-zcc_spot
swap = gw_final-zcc_swap
liq = gw_final-zcc_liq
con_date = gw_final-zcc_con_date.
gw_final-zremarks = <fs_cash>-zremark.

gw_final-zbs1 = <fs_cash>-zbs1.
gw_final-zbs2 = <fs_cash>-zbs2.
gw_final-zref_num = <fs_cash>-zref_num.
gw_final-zclass = <fs_cash>-zclass.
gw_final-zbank_ref = <fs_txn>-refer.
gw_final-rnd_of_rate = <fs_cash>-zround_off.
gw_final-gross_rate = <fs_cash>-zgros_rate.
gw_final-fin_wash = <fs_cash>-zfinal_wash.
IF <fs_cash>-zmat_from IS INITIAL.
gw_final-zmat_from = gw_final-delfz.
ELSE.
gw_final-zmat_from = <fs_cash>-zmat_from.
ENDIF.
IF gw_final-zref_num IS NOT INITIAL.
gw_final-rc_cur_pair = 'USD:INR'.
ENDIF.


LOOP AT lt_vtbfhapo ASSIGNING FIELD-SYMBOL(<fs_vtbfhapo>) WHERE bukrs = <fs_txn>-bukrs
AND rfha = <fs_txn>-rfha.
IF <fs_vtbfhapo>-zfx_flow = 'FX_GST'.
gw_final-zgst_amt = <fs_vtbfhapo>-bzbetr.
ELSEIF <fs_vtbfhapo>-zfx_flow = 'FX_STAM'.
gw_final-zstamp_duty = <fs_vtbfhapo>-bzbetr.
ELSEIF <fs_vtbfhapo>-zfx_flow = 'FX_CHAR'.
gw_final-zbook_charg = <fs_vtbfhapo>-bzbetr.
ENDIF.
ENDLOOP.

READ TABLE gt_hedge ASSIGNING FIELD-SYMBOL(<fs_hedge>) WITH KEY zbukrs = <fs_txn>-bukrs
zrfha_hedg = <fs_txn>-rfha.
IF sy-subrc = 0.
gw_final-zexp_id = <fs_hedge>-zexp_id.
ENDIF.

IF <fs_cash>-zclass IS NOT INITIAL AND <fs_cash>-zclass = '01'.
gw_final-zclass = 'Anticipated Exposure'.
ELSEIF <fs_cash>-zclass IS NOT INITIAL AND <fs_cash>-zclass = '02'.
gw_final-zclass = 'Contracted Exposure'.
ELSEIF <fs_cash>-zclass IS NOT INITIAL AND <fs_cash>-zclass = '03'.
gw_final-zclass = 'Others'.
ENDIF.


IF gw_final-zbuy_cur = 'USD'.
gw_final-eqi_usd = gw_final-zbuy_amt.
* gw_data-eqi_inr = gw_data-zsel_amt * gw_data-fin_wash.
gw_final-eqi_inr = gw_final-zsel_amt.
ELSEIF gw_final-zsel_cur = 'USD'.
gw_final-eqi_usd = gw_final-zsel_amt.
gw_final-eqi_inr = gw_final-zbuy_amt * gw_final-fin_wash.
ENDIF.

IF gw_final-zsel_cur = 'INR'.
gw_final-eqi_inr = gw_final-zsel_amt.
ELSEIF gw_final-zbuy_cur = 'INR'.
gw_final-eqi_inr = gw_final-zbuy_amt.
ENDIF.
ENDIF.

************************ ---------------------start ------------------------------
gw_test-util_amt = REDUCE tb_limit_amount( INIT u_amt TYPE tb_limit_amount FOR lw_util
IN gt_util
WHERE ( rfha = gw_final-rfha
AND zutil_date <= p_date )
NEXT u_amt = u_amt + lw_util-zutil_amt_buy ).
gw_test-can_amt = REDUCE tb_limit_amount( INIT c_amt TYPE tb_limit_amount FOR lw_can
IN gt_can
WHERE ( rfha = gw_final-rfha
AND zutil_date <= p_date )
NEXT c_amt = c_amt + lw_can-zcanc_amt_sell ).
IF gw_test-can_amt is INITIAL.""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""added by sahil 19.03.2024
gw_test-can_amt = REDUCE tb_limit_amount( INIT u_amt TYPE tb_limit_amount FOR lw_can_1
IN lt_cancel_i
WHERE ( zdeal_no = gw_final-rfha AND zcanc_date <= p_date )
NEXT u_amt = u_amt + lw_can_1-zcanc_amt ).

ENDIF."""end of addition
LOOP AT gt_roll INTO DATA(gw_roll) WHERE zdeal_no = gw_final-rfha.
gw_test-roll_amt = gw_test-roll_amt + gw_roll-zroll_amt.
ENDLOOP.

gw_final-out_amt = gw_test-zbuy_amt - ( gw_test-util_amt + gw_test-can_amt + gw_test-roll_amt ).
**********************---------------------------------end----------------------------------------------
********************** -------------------------


IF gw_final-zcreate_date IS INITIAL.
READ TABLE lt_cash INTO DATA(ls_cash) WITH KEY zrfha = gw_final-rfha.
IF sy-subrc = 0.
gw_final-zcreate_date = ls_cash-zfx_date.
ENDIF.

ENDIF.

IF gw_final-zbuy_cur = 'JPY'.
gw_final-zbuy_amt = gw_final-zbuy_amt / 100.
ENDIF.

APPEND gw_final TO gt_final.
CLEAR gw_final.
ENDLOOP.


IF s_bref IS NOT INITIAL.
DELETE gt_final WHERE zbank_ref NOT IN s_bref.
ENDIF.

* PERFORM out_put.
ENDFORM.
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.