10-18-2006 8:11 PM
I am trying to export an internal table to memory and import from memory into an internal table. It looks like the export works, but when I import in program2, the internal table is empty. Even when the command returns sy-subrc = 0.
Has anyone made this work?
<u><b>Program1</b></u>
DATA: BEGIN OF wa_invalid,
z_err.
INCLUDE STRUCTURE hbsid.
DATA: END OF wa_invalid,
DATA: invalid LIKE TABLE OF wa_invalid WITH HEADER LINE.
EXPORT invalid TO MEMORY ID 'errors'.
SUBMIT program2.
<u><b>Program2</b></u>
DATA: BEGIN OF wa_invalid,
z_err.
INCLUDE STRUCTURE hbsid.
DATA: END OF wa_invalid,
t_invalid_assignment LIKE TABLE OF wa_invalid_assignment
WITH HEADER LINE.
REFRESH: t_invalid.
IMPORT: invalid to t_invalid FROM MEMORY ID 'errors'.
10-18-2006 8:18 PM
Hi Rod,
Welcome to SDN.
Please check this sample code.
types : begin of t_itab,
name(10),
end of t_itab.
data: itab type table of t_itab with header line.
ws_memid = 'MY_MEMID'.
export itab to memory id ws_memid.
In second program,
types : begin of t_itab,
name(10),
end of t_itab.
data: itab type table of t_itab with header line.
ws_memid = 'MY_MEMID'.
import itab from memory id ws_memid.
Regards,
Ferry Lianto
10-18-2006 8:16 PM
Where is the internal table declaration for t_INVALID in program two. Make sure that it is exactly the same as in program 1.
Also try to use the syntax like this.
EXPORT invalid = invalid TO MEMORY ID 'ERRORS'.
IMPORT invalid = t_invalid FROM MEMORY ID 'ERRORS'.
Really, it is a good idea to the name of your internal table the same across both programs. So if you were to rename the one in the first program, it should work then.
EXPORT invalid = t_invalid TO MEMORY ID 'ERRORS'.
IMPORT invalid = t_invalid FROM MEMORY ID 'ERRORS'.
Regards,
Rich Heilman
10-18-2006 8:18 PM
Hi Rod,
Welcome to SDN.
Please check this sample code.
types : begin of t_itab,
name(10),
end of t_itab.
data: itab type table of t_itab with header line.
ws_memid = 'MY_MEMID'.
export itab to memory id ws_memid.
In second program,
types : begin of t_itab,
name(10),
end of t_itab.
data: itab type table of t_itab with header line.
ws_memid = 'MY_MEMID'.
import itab from memory id ws_memid.
Regards,
Ferry Lianto
10-18-2006 9:09 PM
10-18-2006 9:12 PM
10-18-2006 9:28 PM
<b>You were right!</b> I renamed the itabs and all is well. Sorry for my frustration and thank you for your assistance.