09-11-2008 7:47 AM
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
09-11-2008 7:54 AM
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
09-11-2008 8:13 AM
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
09-11-2008 8:14 AM
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
09-24-2008 8:07 AM
09-11-2008 7:56 AM
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
09-24-2008 11:15 AM
09-24-2008 11:15 AM
09-24-2008 11:29 AM
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.,,