Application Development 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: 

Issue with WRITE_FORM in non-main window

RichB
Participant
0 Kudos

I am trying to write an internal table to a non-main window but the sapscript "bounces" out during the normal process. (It hits the element and then drops out of the window without printing anything.) However at the END_FORM and CLOSE_FORM the last entry in the internal table is printed the same number of times as there are entries in the table. For example, if there are 2 entries in the table I will end up with the last entry in the table twice on the output.

Print program:

loop at tab_regup.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'CHECKRM1'
element = '599'
function = 'APPEND'
EXCEPTIONS
window = 1
element = 2.
endloop.

SAPSCRIPT:

Window: CHECKRM1

/E 599

T1 &TAB_REGUP-BELNR&,,&TAB_REGUP-BLDAT&,,&TAB_REGUP-WRBTR&,,

= &REGUH-RBETR(C)&,,&TAB_REGUP-WSKTO&,,&REGUH-RBETR&

1 REPLY 1

Rodrigo-Giner
Active Contributor
0 Kudos

Hi Rich, try using the FM WRITE_FORM_LINES instead of WRITE_FORM.

WRITE_FORM_LINES has a Tables parameter so you can pass the Internal table