2008 Jun 19 12:14 AM
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
2008 Jun 19 2:51 AM
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
2008 Jun 19 12:20 AM
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
2008 Jun 19 1:55 AM
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
2008 Jun 19 2:51 AM
This will do
EXPORT lt_textline TO MEMORY ID 'ITTEXT'.
IMPORT lt_textline FROM MEMORY ID 'ITTEXT'.
Rgds.
2010 Nov 10 12:59 PM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |