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: 

data from multiple tables to be displayed in script

Former Member
0 Kudos

Hi all,

Iam displaying data from internal tables.

I have 3 things to be displayed.

Header file just contains one record.

item file contains multiple records so i displayed in main window,

footer file contains multiple records so where should i display,if i create a another window

say footer window, i know that you can loop other than main window right?

if i want to display at the end of all main window records what should i do.

I have my driver program like

open_form.

loop at iheader.

write_form

body main

data element head

endloop.

end_form

5 REPLIES 5

Former Member
0 Kudos

HI,

Create a Footer window and create a <b>ELEMENT</b>, after end of Main Window processing,the loop will be ended, then write another loop then call the WRITE_FORM function moduel and pass the Element and the footer Window name .... this loop should be trigerd only those times whcih the Footer has ......

Regards

Sudheer

Former Member
0 Kudos

Hi,

I believe other than MAIN window you cannot loop and display the values..

Instead you can create a variable and concatenate the values and store it in the variable..

Thanks,

Naren

Former Member
0 Kudos

Assuming that you have three internal table header,item and footer.

Create three text elements is MAIN window and mention the necessary fields that has to displayed in SAP Script. one for HEADER, one for LINE ITEM and last one for FOOTER.

open form


loop at header.
 call write_form using text element HEADER to print header info.
 loop at item.
   call write_form using text element LINE ITEM to print item info.
 endloop.

 loop at footer.
   call write_form using text element FOOTER to print item info.
 endloop.
endloop.

endform

0 Kudos

Hi,

Please note that WRITE_FORM has a IMPORTING parameter FUNCTION. Default value for this parameter is 'SET'. You can specify 'APPEND' while writing to your FOOTER Window.

Hope it helps..

Thanks,

Murali

Former Member
0 Kudos

Hello,

U can do one thing all the data can be displayed in the main window.

Loop at header.

at new header.

diplay the header record.

endat.

loop at item where header = header.

display the items.

endloop.

at last.

loop at multiple_footer.

endloop.

endloop.

Please check the above code and let me know if u face any problem.

Regards