Application Development and Automation 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: 
Read only

EXPORT an internal table and IMPORT an internal table in another program

Former Member
0 Likes
21,530

I am trying to EXPORT an internal table to memory and then from another program, IMPORT the internal table. Here is a sample of my code. I cannot figure out why it does not work. The table I try to import is initial (empty).

PROGRAM ZEXPORT.

DATA: lt_textline type TABLE OF tline.

CONSTANTS: c_memid_text (60) TYPE c VALUE '%%ZTEXT%%'.

DO 10 TIMES.

u2026..

APPEND .. TO lt_textline.

ENDDO.

EXPORT lt_textline[] TO MEMORY ID c_memid_text.

PROGRAM ZIMPORT.

DATA: lt_textline type TABLE OF tline.

CONSTANTS: c_memid_text (60) TYPE c VALUE '%%ZTEXT%%'.

IMPORT lt_textline[] FROM MEMORY ID c_memid_text._As always, points for useful help._

Edited by: Rod Cannon on Jun 19, 2008 1:17 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
8,531

This will do

EXPORT lt_textline TO MEMORY ID 'ITTEXT'.

IMPORT lt_textline FROM MEMORY ID 'ITTEXT'.

Rgds.

I am trying to EXPORT an internal table to memory and then from another program, IMPORT the internal table. Here is a sample of my code. I cannot figure out why it does not work. The table I try to import is initial (empty).

PROGRAM ZEXPORT.

DATA: lt_textline type TABLE OF tline.

CONSTANTS: c_memid_text (60) TYPE c VALUE '%%ZTEXT%%'.

DO 10 TIMES.

u2026..

APPEND .. TO lt_textline.

ENDDO.

EXPORT lt_textline[] TO MEMORY ID c_memid_text.

PROGRAM ZIMPORT.

DATA: lt_textline type TABLE OF tline.

CONSTANTS: c_memid_text (60) TYPE c VALUE '%%ZTEXT%%'.

IMPORT lt_textline[] FROM MEMORY ID c_memid_text._As always, points for useful help._

Edited by: Rod Cannon on Jun 19, 2008 1:17 AM

4 REPLIES 4
Read only

Former Member
0 Likes
8,531

Hi,

Try:

EXPORT lt_textline from lt_textline TO MEMORY ID c_memid_text.

IMPORT lt_textline to lt_textline FROM MEMORY ID c_memid_text.

This will work.

Regards,

Subramanian

Read only

Former Member
0 Likes
8,531

hi

I think firstly you need perform in ZIMPORT:

SUBMIT ZEXPORT ."see the submit help

IMPORT lt_textline to lt_textline FROM MEMORY ID c_memid_text.

wish help you

Thanks

Sun

Read only

Former Member
0 Likes
8,532

This will do

EXPORT lt_textline TO MEMORY ID 'ITTEXT'.

IMPORT lt_textline FROM MEMORY ID 'ITTEXT'.

Rgds.

Read only

Former Member
0 Likes
8,531

Dear All,

You can see the simple example below to unerstand Export / Import of internal table to different programs

1. Export Internal table to memory Id

REPORT yps_export.

TABLES mara.

DATA: i_mara TYPE STANDARD TABLE OF mara,

wa_mara TYPE mara.

  • Selection Screen

SELECT-OPTIONS s_matnr FOR mara-matnr.

  • Select data

SELECT matnr ernam FROM mara INTO CORRESPONDING FIELDS

OF TABLE i_mara WHERE matnr IN s_matnr.

  • Export Internal table to memory ID

EXPORT i_mara[] TO MEMORY ID 'MID1'.

  • Display report

LOOP AT i_mara INTO wa_mara.

WRITE: / wa_mara-matnr, wa_mara-ernam.

ENDLOOP.

2. Import Internal table From memory Id

REPORT yps_import.

TABLES mara.

DATA: i_mara TYPE STANDARD TABLE OF mara,

wa_mara TYPE mara.

  • Selection Screen

SELECT-OPTIONS s_matnr FOR mara-matnr.

  • Import Internal table form memory ID

IMPORT i_mara[] FROM MEMORY ID 'MID1'.

  • Display report

LOOP AT i_mara INTO wa_mara.

WRITE: / wa_mara-matnr, wa_mara-ernam.

ENDLOOP.