2005 Sep 20 8:14 PM
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?
2005 Sep 20 8:21 PM
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
2005 Sep 20 8:35 PM
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
2005 Sep 21 3:04 AM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |