Application Development and Automation 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: 
Read only

Write to internal table and display

Former Member
0 Likes
490

I am generating a report and the requirement is to not only display the report but at the same time transfer the report content to file (which needs to be stored in application server)..

Do I need to do this as two step process (Write To Internal table and Write) or is there a easier way to do this?

I am generating a report and the requirement is to not only display the report but at the same time transfer the report content to file (which needs to be stored in application server)..

Do I need to do this as two step process (Write To Internal table and Write) or is there a easier way to do this?

3 REPLIES 3
Read only

Former Member
0 Likes
475

You have to do it in a two step process. You build your internal table. Loop at the table and write it out to screen/spool. Download the intenal table.

Remember, if you are downloading the internal table, you will be losing any formating that you may be doing while displaying the same on screen, like headers, spacing etc.

Srinivas

Read only

Former Member
0 Likes
475

Yes - a two step process, but it would be better to add a pushbutton to the report and only do the download if the button is pressed. It'll save network traffic if the report is run more than once (which will happen during testing) or the user doesn't want the download.

Rob

Read only

former_member221770
Contributor
0 Likes
475

SSG,

Yes I agree with Rob...make the user decide whether they need to file of not. This can be done via a Push Button on the output or via a check box on the selection screen.

To download to the Application Server use the "OPEN DATASET", "TRANSFER" and "CLOSE DATASET" commands.

something like this:


open dataset p_filename for output in text mode encoding default.

loop at tbl_data.
  transfer tbl_data-contents to p_filename.
endloop.
close dataset.

Take a look at SAP F1 Help for more info.

Hope this helps.

Cheers,

Pat.

PS. Kindly assign Reward Points to the posts you find helpful.