09-24-2008 8:29 AM
Hello Friends,
I have a problem in SAP scripts while printing an internal table data in to a variable window. It is overwriting the contents.
Ex:
In my internal table (itab) with only one filed (text) have the below data.
Firt line
second line
third line
fourth line
I am looping the internal table and within the loop I am calling the write form.
In script I am writing like below
&itab-text&
In the output I am getting only last line.
Output:
fourth line.
But I need to print all lines one by one.
Please help me.
Regards.
Krishna.
09-24-2008 8:35 AM
to print table data u have to use MAIN window. Instead of variable window create a main window and display ur data. But if u know that only 4 rows from the table need to be displayed then u can store each record to a separate variable and then display these variables in the variable window.
09-24-2008 8:37 AM
You can't print internal table data in Variable window, you have to print them in Main window
07-06-2011 7:36 AM
You can't print internal table data in Variable window, you have to print them in Main window
The function module WRITE_FORM_LINES allows multiple lines to be APPENDED to a non-main window. You should note that the text lines must have the SAPscript ITF format. In the absence of other information, the system uses identically named formatting attributes (character and paragraph formats) of the form to format the content of the text lines.
Here is an approach which allows multiple records / lines to be output in a variable window.
If you transfer your information from the internal table into the text lines, complete with appropriate formatting symbols, you will find that the text lines are output nicely formatted in your non-Main window.
loop at internal table into WCSCATALOG.
clear tline.
tline-tdformat = 'S1'.
concatenate '<B>' WCSCATALOG-CODEX '</> ,, ' WCSCATALOG-STXT into ltline-tdline.
append tline to tlines.
endloop.
call function 'WRITE_FORM_LINES'
..