How to export / import variable to memroy in ABAP

export import memory

To export variable to memory on ABAP you need to do next:

First, we create the variable that we are going to send the value to Memory, in this example I am going to declare a Parameter, the value that we are going to save is the value that the user will put in it.

EXPORT p_r3 TO MEMORY ID 'v_prefactura'.

Import variable FROM MEMORY ID ABAP

For import variable from memory first to all you need to declare variable with same name that you set to export, in this case its p_r3.


DATA: p_r3 TYPE c.
IMPORT p_r3  FROM MEMORY ID 'v_prefactura'.

Remember Along the program/code clears the specific memory id after you use.


import zvar to zvar from memory id l_memory_id

export zvar from zvar to memory id l_memory_id.

FREE MEMORY ID l_memory_id.

This works perfectly on SAP ECC and S4 HANA, ABAP 7.5 or less. Also we recomend to see next video:

Leave a Reply

Your email address will not be published. Required fields are marked *

Go up