‎2010 Oct 08 9:43 AM
Hi,
in one of my programs I'm using WRITE statements to write some lines out as a protocol.
This program does not run as a job or will not be called using the SUBMIT statement. Hence I cannot use the spool or the EXPORTING LIST TO MEMORY option to get this output into any internal table.
I wonder if it's possible to grab the output done by the program and put it into an internal table using an alternate approach?
Thanks,
Michael
‎2010 Oct 08 10:04 AM
Hi,
in one of my programs I'm using WRITE statements to write some lines out as a protocol.
This program does not run as a job or will not be called using the SUBMIT statement. Hence I cannot use the spool or the EXPORTING LIST TO MEMORY option to get this output into any internal table.
I wonder if it's possible to grab the output done by the program and put it into an internal table using an alternate approach?
Maybe stupid answer, but if it's YOUR program, then you can code whatever you want, right ?
Just add the lines that you normally would send to the output, to an internal table.
Or am I overlooking something ?
‎2010 Oct 08 9:47 AM
Hello,
If i understand the issue correctly,my idea is download the output from program and upload into internal table.
Please correct me if it is wrong.\
Thanks,
Ramya.
‎2010 Oct 08 9:59 AM
Hi Ramya,
yes, you are correct:
after my program finished I see some lines on the GUI which where done using the WRITE statement and I would like to have those lines in an e.g. internal table to save the content to e.g an application log or similar.
Michael
‎2010 Oct 08 10:04 AM
Hi,
in one of my programs I'm using WRITE statements to write some lines out as a protocol.
This program does not run as a job or will not be called using the SUBMIT statement. Hence I cannot use the spool or the EXPORTING LIST TO MEMORY option to get this output into any internal table.
I wonder if it's possible to grab the output done by the program and put it into an internal table using an alternate approach?
Maybe stupid answer, but if it's YOUR program, then you can code whatever you want, right ?
Just add the lines that you normally would send to the output, to an internal table.
Or am I overlooking something ?
‎2010 Oct 08 10:10 AM
No, certainly not a stupid answer of course!
And yes, it's my own program, however, those WRITE statements are spread all over the main source and its countless includes so it would be easier to do this task when the program finishes.
‎2010 Oct 08 11:29 AM
Hi Michael,
this sniplet shoulg help:
DATA: lin TYPE i, pag TYPE i.
DATA: gs_list TYPE string,
gt_list TYPE TABLE OF string.
DO 30 TIMES.
WRITE: / 'Zeile', sy-index.
ENDDO.
AT LINE-SELECTION.
DESCRIBE LIST: NUMBER OF LINES lin INDEX 0.
DO lin TIMES.
READ LINE sy-index LINE VALUE INTO gs_list.
APPEND gs_list TO gt_list.
ENDDO.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\Temp\test.txt'
filetype = 'ASC'
TABLES
data_tab = gt_list.regards
REA
‎2010 Oct 08 11:37 AM
‎2010 Oct 08 11:13 AM
check out the WRITE clauses for display data of internal table
http://help.sap.com/saphelp_46c/helpdata/EN/9f/db9e1635c111d1829f0000e829fbfe/content.htm
Also you can put internal table's data into field catalog and can display that data through ALV Grid.