06-09-2008 11:02 AM
Hi all,
I have a requirement like, in one method of a class i have exported an internal table to memory which holds the entire details of a person. now i need to import that table in a form to display his details.
Can any one please help me regarding how to import that table from memory.
thanks in advance.
Tulasi Deepthi.
06-09-2008 11:08 AM
Hi,
use Statement
EXPORT itab TO MEMORY ID 'ID_NAME'. to export internal table,
use Statement
IMPORT itab FROM MEMORY ID 'ID_NAME'. to import internal table,
Regards,
Bharat.
06-09-2008 11:08 AM
Hi,
use Statement
EXPORT itab TO MEMORY ID 'ID_NAME'. to export internal table,
use Statement
IMPORT itab FROM MEMORY ID 'ID_NAME'. to import internal table,
Regards,
Bharat.
06-09-2008 11:09 AM
in the first program
EXPORT t_final TO MEMORY ID 'ABC'.
CALL TRANSACTION 'MM01'
In teh second program
INITIALIZATION.
* IMPORT the internal table which has the selected rows
* for displaying the detail report from program
IMPORT t_final FROM MEMORY ID 'ABC'.
06-09-2008 11:23 AM
here you go
DATA:
BEGIN OF myrec,
c1 TYPE c,
c2 TYPE c,
c3 TYPE c,
c4 TYPE c,
s1 TYPE i,
END OF myrec.
DATA:
mytab LIKE myrec OCCURS 0 WITH HEADER LINE,
mytab2 LIKE myrec OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
PERFORM build_table.
LOOP AT mytab INTO myrec.
WRITE:/ myrec-c1, myrec-c2, myrec-c3, myrec-c4, myrec-s1.
ENDLOOP.
EXPORT itab from mytab TO MEMORY ID 'PTC'. "<== itab is the obj name as stored in memory
CLEAR: mytab, mytab[]. "<== emptied to verify that EXPORT is working
ULINE.
IMPORT itab to mytab2 FROM MEMORY ID 'PTC'. "<== itab is the obj name as stored in memory
LOOP AT mytab2 INTO myrec.
WRITE:/ myrec-c1, myrec-c2, myrec-c3, myrec-c4, myrec-s1.
ENDLOOP.
*&---------------------------------------------------------------------
*& Form build_table
*&---------------------------------------------------------------------
FORM build_table.
myrec-c1 = 'x'. myrec-c2 = 's'. myrec-c3 = 'd'. myrec-c4 = 'f'.
myrec-s1 = 1. APPEND myrec TO mytab.
myrec-c1 = 'x'. myrec-c2 = 'f'. myrec-c3 = 'q'. myrec-c4 = 'e'.
myrec-s1 = 1. APPEND myrec TO mytab.
myrec-c1 = 'y'. myrec-c2 = 'p'. myrec-c3 = 'o'. myrec-c4 = 'u'.
myrec-s1 = 1. APPEND myrec TO mytab.
myrec-c1 = 'y'. myrec-c2 = 'l'. myrec-c3 = 'k'. myrec-c4 = 'h'.
myrec-s1 = 1. APPEND myrec TO mytab.
myrec-c1 = 'z'. myrec-c2 = 'm'. myrec-c3 = 'h'. myrec-c4 = 'g'.
myrec-s1 = 1. APPEND myrec TO mytab.
ENDFORM. " build_table