06-22-2009 10:15 AM
Hi,
In normal ABAP programming, an internal table is stored in the memory as shown below:
EXPORT itab TO MEMORY ID 'store_itab'.
But when i try to write the same code in a method of a global class, i get an error saying:
"EXPORT var_1,.......var_n TO MEMORY.........is not supported in OO context.
Use EXPORT name_1 from var_1,.......name_n from var_n TO MEMORY.......instead.........".
How can i store this internal table itab into memory.
Thanks a lot in advance for helping.
Best Regards,
Raghu
06-22-2009 10:26 AM
hi try to give some value to the mid (memory id ) as given below
DATA: MID TYPE CHAR10 VALUE 'F47'.
EXPORT itab TO MEMORY ID MID.
regards
Sajid
06-22-2009 10:29 AM
Hi,
Below given is the example for Exporting internal table into memory and importing back when required:
Program-1
EXPORT i_zpack_memory FROM i_zpack_migo TO MEMORY ID 'ZPMIGO'.
Program-2
IMPORT i_zpack_memory TO i_zpack_migo FROM MEMORY ID 'ZPMIGO'.
Rgds,
Ramani N
Edited by: Ramani Nagarajan on Jun 22, 2009 11:29 AM
06-22-2009 10:31 AM
Hi,
As per abap keyword doc following is the syntax..
EXPORT obj1 ... objn TO INTERNAL TABLE itab = f.
Effect
The contents of data object f is exported and stored under the name specified before =.
EXPORT obj1 ... objn TO INTERNAL TABLE itab FROM f .
Effect
The contents of data object f is exported and stored under the name specified before FROM.
Regards.