09-19-2006 7:20 PM
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
09-19-2006 7:25 PM
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
09-19-2006 7:27 PM
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
09-19-2006 7:32 PM
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
09-20-2006 2:35 AM
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
09-20-2006 7:07 AM
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