Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

IMPORT FROM / EXPORT TO MEMORY ID ...

Former Member
0 Kudos

Hi!

I would like to know how to use these commands within ABAP. I referred the ABAP docu, I know the exact syntax, but it is never working that way I would like it to work.

I don't know how can I check what is in the memory, how, can I check the value of the memory ids.

How long is visible a memory id?

For example I would like to use import-export within a user-exit (MV45AFZZ) but if I exported a value to a memory id in a form, in the after the export I couldn't read any value from that memory id with an import command.

And sadly I don't know how to track, what is the problem.

Thank you in advance

Tamá

1 ACCEPTED SOLUTION

Former Member

first check this

ABAP memory 
The contents of the ABAP memory are retained only during the lifetime of an external session (see also Organization of Modularization Units). You can retain or pass data across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory.

Regards

Prabhu

6 REPLIES 6

Former Member

first check this

ABAP memory 
The contents of the ABAP memory are retained only during the lifetime of an external session (see also Organization of Modularization Units). You can retain or pass data across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory.

Regards

Prabhu

Former Member
0 Kudos

Hi

Those command use ABAP memory so they can be used by several programs running in the same mode.

The next step is EXPORT:

EXPORT obj1 ... objn TO MEMORY ID 'ZID'.

after

IMPORT obj1 ... objn FROM MEMORY ID 'ZID'.

The objects used have to have the same name.

Max

Former Member
0 Kudos

Hi,

export and import stores data in ABAP memory

which is available in same LUW.

data matnr like mara-matnr value 'TEST'

export to memory ID 'test field matnr.

import matnr from memory id 'TEST'

here matnr in export and importv should be of same name

and length.

SAP global memory is used in SET,GET parameter id.

they are stored in table tpara.

Regards

amole

Former Member
0 Kudos

Hi,

Passing data from one ABAP program to another

1. You have to define an internal table ITAB in program AAA.

2. In the program AAA you export your ITAB to the memory.

EXPORT ITAB TO MEMORY ID 'TD' (ID is the name of memory, you don't need to create it ).

3. In program BBB you have to declare The same table (same table's name and same fields).

4. In BBB you can import ITAB :

IMPORT ITAB FROM MEMORY ID 'TD'

5. Now you can export it to AAA after modifications.

EXPORT ITAB TO MEMORY ID 'TD'

6. In AAA :

IMPORT ITAB FROM MEMORY ID 'TD'

This solution is independant to SUBMIT.

Cheers

VJ

andreas_mann3
Active Contributor
0 Kudos

hi,

check sample-abap DEMO_DATA_EXT_CLUSTER_IMPORT

A.

0 Kudos

ABAP memory

The contents of the ABAP memory are retained only during the lifetime of an external session (see also Organization of Modularization Units). You can retain or pass data across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory.

For Example we have two program like this :-

Program 1 :- Send Data

Method :- IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM

      IF po_line-anfnr IS NOT INITIAL.
        SELECT SINGLE submi FROM ekko INTO @DATA(lv_submi)
          WHERE ebeln = @po_line-anfnr AND bsart IN ( 'AN', 'ZRFQ' ).
        IF lv_submi IS NOT INITIAL.
          EXPORT lv_submi FROM lv_submi TO MEMORY ID 'LV_SUBMI'.
        ENDIF.
      ENDIF.

Program 2 :- Receive Data

Method :- IF_EX_ME_PROCESS_PO_CUST~PROCESS_HEADER

DATA:  lv_submi TYPE ekko-submi.
import lv_submi TO LV_SUBMI FROM  MEMORY ID 'LV_SUBMI'.
IF LV_SUBMI IS NOT INITIAL.
  RDATA-SUBMI = LV_SUBMI.
  FREE MEMORY ID 'LV_SUBMI'.
ENDIF.

We can also Export Internal Table, following these steps :-

1. You have to define an internal table ITAB in program ZINC_A.

2. In the program ZINC_A you export your ITAB to the memory.

EXPORT ITAB TO MEMORY ID 'TD' (ID is the name of memory, you don't need to create it ).

3. In program ZINC_B you have to declare The same table (same table's name and same fields).

4. In BBB you can import ITAB :

IMPORT ITAB FROM MEMORY ID 'TD'

Thanks & Regards

Harshit Varshney