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: 

Convert program output to a text file during runtime

Former Member
0 Kudos

Hello all,

     We are trying to create a text file on a UNIX share of the list that the program is running.  So we are building an old version "write: \" statement built report NOT ALV.  So we "write" out the report list, then I need to convert that to a text file on the UNIX box. 

The only viable way that I can seem to make this work is creating an internal table that has one field at 200 wide, write the values to each line to the itab and then transfer that to the dataset.  This just requires much in the way of the right spacing, etc when the list built is much more direct.

So, is there anyway to do the below?

Write: 'Test'.

Write: 'Test2'.

..

..

new-page.

..

..

..

function to convert the above list that was output to an internal table.

open.

transfer.

close.

Thanks for any help/suggestions!

1 ACCEPTED SOLUTION

nikolayevstigneev
Contributor
0 Kudos

Hi, Ronnie!

At the first glance I couldn't understand what's the point of the problem is.

If I got you right, you don't want to do a lot of work to format the output of the report to the output for filling an internal table.

If so, maybe exporting list to memory helps you.

You write a small wrapper which SUBMITs your report with necessary parameters EXPORTING LIST TO MEMORY AND RETURN. Then after calling 'LIST_FROM_MEMORY' and 'LIST_TO_ASCI' you get the table with the output. You may still have the need to do some formatting stuff, it depends on the report output, I haven't seen it. But it's very fast and easy to test the idea.

2 REPLIES 2

nikolayevstigneev
Contributor
0 Kudos

Hi, Ronnie!

At the first glance I couldn't understand what's the point of the problem is.

If I got you right, you don't want to do a lot of work to format the output of the report to the output for filling an internal table.

If so, maybe exporting list to memory helps you.

You write a small wrapper which SUBMITs your report with necessary parameters EXPORTING LIST TO MEMORY AND RETURN. Then after calling 'LIST_FROM_MEMORY' and 'LIST_TO_ASCI' you get the table with the output. You may still have the need to do some formatting stuff, it depends on the report output, I haven't seen it. But it's very fast and easy to test the idea.

0 Kudos

Thanks, I was doing the LIST_TO_TXT function and it wasn't working exactly right.  I tried the ASCI function you mention above and it seems to work correctly.