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: 

SAPScript Problem

Former Member
0 Kudos

Hi,

I have got 2 pages in my SAPscript. Page 2 is called, only if Page 1 main window gets filled up (through internal table itab1).

Using my internal table, I can get all the data in Page 1 .In case of Page2(internal table itab2), I am getting only one record. Have anybody experienced a similar problem.

I have run the program using se38..and all the data gets populated from itab1 and itab2.

Thanks,

Rajib

2 REPLIES 2

Former Member
0 Kudos

hi rajib,

this is complicated, since it will really depend on how you coded your program... but check: are you sure your itab2 has more than one record? and did you put the sapscript writing FM inside a loop for this itab?

sorry this isn't much,

ryan.

0 Kudos

Ryan,

seems the data for the next page is getting overwritten....i have defined the window as "VAR".

the first page has:

loop at itab2.

line_item1 = itab2-SL_NO.

line_item2 = itab2-ITEM_DATE.

line_item3 = itab2-AMOUNT.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'MAIN'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in write_form printing MAIN'.

EXIT.

ENDIF.

endloop.

and the code for the next page:

loop at itab1.

line_item4 = itab1-SL_NO.

line_item5 = itab1-ITEM_DATE.

line_item6 = itab1-AMOUNT.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'LMAIN'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'LMAIN'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in write_form printing LMAIN'.

EXIT.

ENDIF.

endloop.

Rajib