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: 

how to send internal table to abap memory

Former Member
0 Kudos

hi all

how can i send an internal table to abap memory

5 REPLIES 5

former_member223537
Active Contributor
0 Kudos

EXPORT ITAB to MEMORY ID 'ZIDY'.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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