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

Output Report Data Into File ?

Former Member
0 Likes
3,291

Friends,

I have a Transaction(Report program) that I need to call at runtime and output the result into a file(CSV) on AL11.

I am exploring the following options:

1. Submit Report and export to Spool

>> Challenge here is the data in the spool is difficult to read and strucure into an output file

2. Submit Report and Output to list in memory

>> Challenge here is the data to read from memory is in RAW format and I am not sure how to extract Raw information into an internal table.

Can you suggest me other alternative whereby which I could easily extract the data from a report onto a flat file.

Your inputs would be greatly appreciated.

Thanks,

sa

Edited by: Sh on Apr 12, 2011 9:52 AM

Friends,

I have a Transaction(Report program) that I need to call at runtime and output the result into a file(CSV) on AL11.

I am exploring the following options:

1. Submit Report and export to Spool

>> Challenge here is the data in the spool is difficult to read and strucure into an output file

2. Submit Report and Output to list in memory

>> Challenge here is the data to read from memory is in RAW format and I am not sure how to extract Raw information into an internal table.

Can you suggest me other alternative whereby which I could easily extract the data from a report onto a flat file.

Your inputs would be greatly appreciated.

Thanks,

sa

Edited by: Sh on Apr 12, 2011 9:52 AM

7 REPLIES 7
Read only

Former Member
0 Likes
2,299

Hi Sa,

The Report you are calling, is a Z one? If so, you can add one line to it exporting Internal Table to Memory.

Regards,

Ernesto.

Read only

0 Likes
2,299

Thanks for the reply.

The Transaction I am trying to output is SAP Transation (Report R*** using a variant). I am running it using a variant and trying to output the contents into a file.

Can you provide details as to how this can be acheived.

Thanks,

sa

Read only

Former Member
0 Likes
2,299

HI Sh,

You might try out this code by [Bharadwaj p|http://wiki.sdn.sap.com/wiki/display/ABAP/CSV+file].

Best regards,

JP

Read only

Former Member
0 Likes
2,299

try to use following FM

CALL FUNCTION 'SPAD_COPY_FILES_LOCAL'

Read only

brad_bohn
Active Contributor
0 Likes
2,299

By not giving the report name, you're not helping your issue. The better your question, the better your answer.

Many SAP standard reports have subroutines that gather the data, especially those that use ALV. You could easily use an implicit enhancement to push the data to memory, as Ernesto has already suggested, and capture it in your calling program. This method is MUCH easier to work with than trying to mess around with parsing spool data.

Read only

Former Member
0 Likes
2,299

The Report is not a Z Report. It is RKEB0601.

I know where the data is captured in an internal table before the ALV display is called. BUt there is no way for me to export this to Memory as this is a Standard program.

The requirement is to get the output of this report in a flat file.

Any assitance on this will be greatly appreciated.

Thanks,

sa

Read only

Former Member
0 Likes
2,299

Hi Sh,

I'd suggest you copy RKEB0601 into a Z program and then export the list you need into memory and in your actual program call the Z program.

Submit ZRKEB0601. In here do not show ALV but export Internal Table to Memory.

When the control returns to calling program, import from memory the internal table and then create output file.

Regards,

Ernesto.