Skip to Content
avatar image
Former Member

how to send internal table to abap memory

hi all

how can i send an internal table to abap memory

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Aug 14, 2007 at 05:34 AM

    EXPORT ITAB to MEMORY ID 'ZIDY'.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 14, 2007 at 05:36 AM

    Hi ,

    Yes, all you need to do is pass it thru memory.

    data: itab type table of string.

    export itab = itab to memory id 'ZTEST'.

    import itab = itab from memory id 'ZTEST'.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 14, 2007 at 05:36 AM

    Hi Santosh ,

    Use the export command to export the IT to memory and use import to retrieve it.

    Here is the command

    EXPORT obj1 ... objn TO MEMORY.

    Please see the help for more info.

    Here is the code from the standrad help

    TYPES: BEGIN OF OBJ_LINE,

    CLUSTERNAME(30),

    PROGRAMNAME(10),

    END OF OBJ_LINE.

    DATA: OBJ_TAB TYPE STANDARD TABLE OF OBJ_LINE,

    OBJ_WA TYPE OBJ_LINE.

    TYPES: BEGIN OF B_LINE,

    FIELD_1 TYPE I,

    FIELD_2(1) TYPE N,

    END OF B_LINE.

    DATA: B_PROG TYPE STANDARD TABLE OF B_LINE.

    DATA: A(10),

    C_PROG LIKE SYST.

    MOVE: 'A' TO OBJ_WA-CLUSTERNAME.

    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.

    MOVE: 'B' TO OBJ_WA-CLUSTERNAME,

    'B_PROG' TO OBJ_WA-PROGRAMNAME.

    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.

    MOVE: 'C' TO OBJ_WA-CLUSTERNAME,

    'C_PROG' TO OBJ_WA-PROGRAMNAME.

    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.

    EXPORT (OBJ_TAB) TO MEMORY ID 'ABCD'.

    Regards

    Arun

    Message was edited by:

    Arun R

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 14, 2007 at 05:37 AM

    Take a look at this code from SAP Help.

    PROGRAM SAPMZTS1.

    DATA TEXT1(10) VALUE 'Exporting'.

    DATA ITAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.

    DO 5 TIMES.

    ITAB-BOOKID = 100 + SY-INDEX.

    APPEND ITAB.

    ENDDO.

    EXPORT TEXT1

    TEXT2 FROM 'Literal'

    TO MEMORY ID 'text'.

    EXPORT ITAB

    TO MEMORY ID 'table'.

    SUBMIT SAPMZTS2 AND RETURN.

    SUBMIT SAPMZTS3.

    Example for SAPMZTS2:

    PROGRAM SAPMZTS2.

    DATA: TEXT1(10),

    TEXT3 LIKE TEXT1 VALUE 'Initial'.

    IMPORT TEXT3 FROM MEMORY ID 'text'.

    WRITE: / SY-SUBRC, TEXT3.

    IMPORT TEXT2 TO TEXT1 FROM MEMORY ID 'text'.

    WRITE: / SY-SUBRC, TEXT1.

    Example for SAPMZTS3:

    PROGRAM SAPMZTS3.

    DATA JTAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.

    IMPORT ITAB TO JTAB FROM MEMORY ID 'table'.

    LOOP AT JTAB.

    WRITE / JTAB-BOOKID.

    ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 14, 2007 at 05:39 AM

    Hi Santosh

    u ca export the internal table data to one memory id and from that memory id u can import

    export 'itab' to memory id 'itab_data'.

    import itab from memory id 'itab_data'.

    reward points to all helpful answers

    kiran.M

    Add comment
    10|10000 characters needed characters exceeded