‎2011 Oct 10 8:10 AM
Hi.
How can i make an import export of an internal table but with the sap memory.
Thanks.
Regards
Miguel
‎2011 Oct 10 8:59 AM
If the number of entries in table is less following logic could be used..
Suppose wa_tab is the work area and lit_tab is the table that you need to import and export into lit_new.
DATA : lv_count_char TYPE CHAR3,
lv_field TYPE char6.
DESCRIBE TBALE lit_tab LINES lv_lines.
SET PARAMETER ID 'LINES' FIELD lv_lines.
---> Setting the value
LOOP at lit_tab INTo wa_tab.
MOVE sy-tabix TO lv_count_char.
CONCATENATE 'FLD' lv_count_char INTO lv_field.
SET PARAMETER ID lv_field FIELD wa_tab.
ENDLOOP.
---> Rerieving the value
GET PARAMETER ID 'LINES' FIELD lv_lines.
DO.
lv_count = lv_count + 1.
MOVE lv_count TO lv_count_char.
CONCATENATE 'FLD' lv_count_char INTO lv_field.
GET PARAMETER ID lv_field FIELD wa_tab.
APPEND wa_tab TO lit_new.
IF lv_count GE lv_lines.
EXIT.
ENDIF.
ENDDO.
‎2011 Oct 10 8:28 AM
Hi,
The SET PARAMETER and GET PARAMETER statements allow you to write to, or read from, the SAP memory.
ITAB it_matnr should be of same type and structure in both programs.
SET PARAMETER ID 'MAT' field it_matnr.
GET PARAMETER ID 'MAT' field it_matnr.
‎2011 Oct 10 8:46 AM
Hello All,
As of current ABAP release you cannot transfer an internal table(deep structure) using SET/GET PARAMETER.
@OP: Is there any reason you want to transfer the internal table to SAP memory?
BR,
Suhas
‎2011 Oct 10 8:59 AM
If the number of entries in table is less following logic could be used..
Suppose wa_tab is the work area and lit_tab is the table that you need to import and export into lit_new.
DATA : lv_count_char TYPE CHAR3,
lv_field TYPE char6.
DESCRIBE TBALE lit_tab LINES lv_lines.
SET PARAMETER ID 'LINES' FIELD lv_lines.
---> Setting the value
LOOP at lit_tab INTo wa_tab.
MOVE sy-tabix TO lv_count_char.
CONCATENATE 'FLD' lv_count_char INTO lv_field.
SET PARAMETER ID lv_field FIELD wa_tab.
ENDLOOP.
---> Rerieving the value
GET PARAMETER ID 'LINES' FIELD lv_lines.
DO.
lv_count = lv_count + 1.
MOVE lv_count TO lv_count_char.
CONCATENATE 'FLD' lv_count_char INTO lv_field.
GET PARAMETER ID lv_field FIELD wa_tab.
APPEND wa_tab TO lit_new.
IF lv_count GE lv_lines.
EXIT.
ENDIF.
ENDDO.
‎2011 Oct 10 8:59 AM
Hi.
In the morning there is a process that i dont need all the items in the internal table, and then in the night they want to restore all the items, so i need to make a copy of the internal table.
‎2011 Oct 10 9:35 AM
Hi,
please use *EXPORT ... TO DATABASE ... * for that. You can use database table iNDX or create your own customer database tabel for that. This customer table needs the same defintion as INDX in SE11.
Regards,
Klaus
‎2011 Oct 10 9:50 AM
Hi,
To export internal table to memory from a program, please use following piece of code:
EXPORT itab TO MEMORY ID 'ABCD'.
To import the same internal table back to another program, please use the following piece of code:
IMPORT itab FROM MEMORY ID 'ABCD'.
Also note that itab should be similarly defined and named in both the programs.
Kindly let me know in case of any issues.
Regards,
Shayeree
Edited by: shayeree on Oct 10, 2011 10:52 AM
‎2011 Oct 10 9:59 AM
Hi,
try this:
DATA: IT_MARA TYPE TABLE OF MARA.
*
SELECT * FROM MARA INTO TABLE IT_MARA UP TO 10 ROWS.
EXPORT IT_MARA FROM IT_MARA TO MEMORY ID 'ZZ_MARA'.
CLEAR IT_MARA[].
IMPORT IT_MARA FROM MEMORY ID 'ZZ_MARA'.
Regards, Dieter
‎2011 Oct 10 12:01 PM
HI
U can use export and import .
Like this
Export IT_table memory id ABC
Then u can import where you want
Import IT_TABLE from memory id ABC