‎2008 Jan 14 11:18 AM
I would like to write subroutine for display reason code ( BSAK-RSTGR ) into my layout set.
my function consultant instruct me you should pick the data based on following business logic.
Payment Document Number (REGUP-VBLNR ) equal to clearing document number ( BSAK-AUGBL) .
i have written my code as follows .
FORM ZREASONCODE TABLES in_tab structure itcsy
out_tab structure itcsy.
TABLES: REGUP, BSAK.
DATA: A_VBLNR TYPE REGUP-VBLNR,
B_RSTGR TYPE BSAK-RSTGR.
READ TABLE IN_TAB INDEX 1.
CHECK SY-SUBRC = 0.
A_VBLNR = IN_TAB-VALUE.
SELECT SINGLE RSTGR FROM BSAK INTO B_RSTGR WHERE AUGBL = A_VBLNR.
IF SY-SUBRC = 0.
READ TABLE OUT_TAB INDEX 1.
IF SY-SUBRC = 0.
OUT_TAB-VALUE = B_RSTGR.
MODIFY OUT_TAB INDEX 1 TRANSPORTING VALUE.
ENDIF.
ENDIF.
ENDFORM.
but no data is picking above logic .
can some one guide me how to pick up data for above logic.
pls suggest me i will reward the points.
‎2008 Jan 14 11:20 AM
Hi Venkat,
Debug it and check why you are not getting the data and try to resolve it.
Go to SE71 and start debuger in your sapscript and in your form in SE38 transaction
‎2008 Jan 14 11:26 AM
Hi,
After reading a value from in_tab is is often a good idea to run function module CONVERSION_EXIT_ALPHA_INPUT to convert the display format held in the SAPscript to internal format before using it to read a database table.
Regards,
Nick