‎2009 Feb 25 2:27 PM
Hi All,
I have a requirement to display a table data in SAP Script.
The column details are as fiollows:
SlNo.
Desc,
Qty,
Amount.
Is there any specific way to display the table data in Script?
If I use a single window like MAIN window and try to separate the columns by TABS then if my Desc field is long enough then complete formatting is spoiled.
If I use a VAR window with a TEXT ELEMENT in that then system Overwrites the same data again and again so only last record in displayed at the display.
Please suggest....
Regards,
Prakash Pandey
‎2009 Feb 25 2:40 PM
You should declare the tabulators in the respecting sapscript window, and then use double commas to separate the values. Each double comma ( ,, ) means a tab jump to the nex available tab position.
You should iterate the itab in your program and call the same element for writing in your sapscript for each iteration of your loop.
‎2009 Feb 25 2:40 PM
You should declare the tabulators in the respecting sapscript window, and then use double commas to separate the values. Each double comma ( ,, ) means a tab jump to the nex available tab position.
You should iterate the itab in your program and call the same element for writing in your sapscript for each iteration of your loop.
‎2009 Feb 26 4:10 AM
Hi Gustavo,
I have done the same. But every time the element and the window is called by FM WRITE_FORM the previous value is overwritten and as a result only the last loop value is shown on the script.
Regards,
Prakash Pandey
‎2009 Feb 26 4:29 AM
Hi,
try this .
In the driver program .....
loop at itab into fs.
call function write_from.
endloop.
In the text editor.
&fs-f1&,,&fs-f2&,,&fs-f3&
‎2009 Feb 26 4:41 AM
Hi Sudheer,
I am doing the same. Please note that I can not use a Single window because the length of the first field is more than column width and it is supposed to do a Word Wrap, so I have different window for every column I am using a VAR WINDOW and NOT A MAIN window.
In the main window when I call WRITE_FORM it prints the various loop values one below another. This is OK. But since I am using a VAR window the loop values are overwritten. And only the last entry of the loop is displayed.
Regards,
Prakash Pandey
‎2009 Feb 26 7:06 AM
Hi Prakash,
Try using FM WRITE_FORM_LINES.
This will work.
Anurita
‎2009 Feb 25 2:42 PM
Hi Praksh
What you can do, if you are not sure about the lenght of the description field, is to first check it's length.
Then split it into parts (global variables) say v1 v2 v3 etc. (of course you can have a max number of parts here only so select a number beyond which you don't think the length of the field would go)
Then in the script where you write its value
do
PF ,,,,,,&v1&
IF v2 IS NOT INITIAL
PF ,,,,,,&v2&
IF v3 IS NOT INITIAL
PF ,,,,,,&v3&
.
.
.
ENDIF
ENDIF
Pushpraj