Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FINDING REASON CODE

Former Member
0 Likes
506

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.

2 REPLIES 2
Read only

Former Member
0 Likes
437

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

Read only

Former Member
0 Likes
437

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