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: 

Variable window in SAP script

former_member734916
Participant
0 Kudos
634

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.

3 REPLIES 3

Former Member
0 Kudos
122

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.

former_member585060
Active Contributor
0 Kudos
122

You can't print internal table data in Variable window, you have to print them in Main window

0 Kudos
122

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'
..