In real time scenario, some time we need to fetch the values from program variables, internal tables ect. inside badi or user exists or any other part of program.
In this example the scenario is I am doing a BADI implementation for BADI ADDR_TXJCD_CHECK, but here in this badi i want to fetch the value of idoc partner which is in main program SAPMV45A and the values which I want to read is IDOC_EDIDC-RCVPRN, but this is not present in the signature of the BADI.
So using field symbol we can read the values from current session of the global program inside badi/user.
abap code to read the values using field symbol
method IF_EX_ADDR_TXJCD_CHECK~SWITCH_ADDRESS_FIELDS.
CONSTANTS : lv_RCVPRN type char40 VALUE '(SAPMV45A)IDOC_EDIDC-RCVPRN'.
FIELD-SYMBOLS: <fs_rcvprn> TYPE any.
ASSIGN (lv_RCVPRN) TO <fs_rcvprn>.
if <fs_rcvprn> is ASSIGNED and <fs_rcvprn> = 'XDEV700' and sy-tcode = 'VA01'.
EX_SKIP_TXJCD_DETERMINATION = 'X'.
endif.
endmethod.
0 Comments