Skip to Content
avatar image
Former Member

report output list to internal table using submit report

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Sep 11, 2008 at 06: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 11, 2008 at 06: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 24, 2008 at 10:15 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 24, 2008 at 10:15 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.,,