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: 

report output list to internal table using submit report

Former Member
0 Kudos

Hello,

I have a report that generates the output in the form of an abap list. I want this data in an internal table for further processing. the report internally does not do a export data to memory so i cannot use import later on to get the data.

i did the following

SUBMIT <report name> exportING LIST TO MEMORY and return.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = itab_list

EXCEPTIONS

not_found = 4

OTHERS = 8.

CALL FUNCTION 'LIST_TO_ASCI'

EXPORTING

list_index = -1

TABLES

listasci = ascitab

listobject = itab_list

EXCEPTIONS

empty_list = 1

list_index_invalid = 2

OTHERS = 3.

This returns the data in the ascitab, but the data contains additional unwanted info like lines and hyphens etc. Also the data is in a table with a single column, so pulling out individuals fields is again an issue. Is there a way to get this data into an internal table directly?

best regards,

Suraj

8 REPLIES 8

Former Member
0 Kudos

Suraj

It is not possible as anything can be written in the List Output without specific format/sequence.... The above function module returns the exact replica of the output list.

Thanks

Amol Lohade

0 Kudos

Hi Amol,

So there is no way to get this data into an internal table?

I could have used export to memory, but the report im trying to get data from is a standard report which i cannot modify.

Hence I cannot change the existing report. I can only write a wrapper.

Please help.

regards,

Suraj

0 Kudos

Hi Anil,

I cannot change the code of the exisitng report, so I cannot add the export to memory there.

I am only allowed to create a wrapper on top of the existing report.

Regards,

Suraj

0 Kudos

I got a workaround for this. Im closing this thread

Former Member
0 Kudos

hi suraj

export the internal table of report

DATA: BEGIN OF SR_VBAK ,

VBELN LIKE VBAK-VBELN,

END OF SR_VBAK.

DATA: IR_VBAK LIKE STANDARD TABLE OF SR_VBAK WITH HEADER LINE.

EXPORT IR_VBAK TO MEMORY ID 'SALES'.

SUBMIT <program name in which u want internal table records > AND RETURN.

now import that data in submit program .

here u have to creat a internal table with same structure as the internal table from which u r trying to export the data

DATA: BEGIN OF SR_VBAK,

VBELN LIKE VBAK-VBELN,

END OF SR_VBAK.

DATA : IR_VBAK LIKE STANDARD TABLE OF SR_VBAK WITH HEADER LINE.

IMPORT IR_VBAK FROM MEMORY ID 'SALES'.

regards

ANIL CHAUDHaRY

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

This message was moderated.

0 Kudos

you cannot do that.. once u use list to asci, the whole screen shot of data appears in an internal table. for the workaround, i used a wrapper to separate the hyphens and the extra lines.. its not a good idea.. maybe you can find a better way.,,