‎2021 Sep 23 2:51 PM
Hi guys,
I wrote some sample code to understand ABAP memory mechanism
DATA: lv_is_true TYPE BOOLEAN VALUE ABAP_TRUE,
lv_test TYPE BOOLEAN VALUE ABAP_FALSE.
EXPORT lv_is_update = lv_is_true TO MEMORY ID 'SOMETHING'.
IMPORT lv_is_update TO lv_test FROM MEMORY ID 'SOMETHING'.
write lv_test.
DELETE FROM MEMORY ID 'SOMETHING'.
Is there any standard table where can I find this record with id 'SOMETHING'. How long this id will be accessible and what is the scope of accessibility?
Kind regards,
Andrzej
‎2021 Sep 23 3:16 PM
There's no "standard table" for memory IDs. You can choose the names you want.
ABAP memory is valid while the ABAP session runs.
See diagram how memory is organized in ABAP documentation: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenmemory_organizati...
‎2021 Sep 23 4:25 PM
You can view the memory ids in the debugger. I forget exactly how.
Or write a test like this:
DATA is_true TYPE abap_bool VALUE abap_true.
DATA test TYPE abap_bool VALUE abap_false.
EXPORT is_update = is_true TO MEMORY ID 'SOMETHING'.
IMPORT is_update TO test FROM MEMORY ID 'SOMETHING'.
ASSERT test EQ is_true.
DELETE FROM MEMORY ID 'SOMETHING'.
CLEAR test.
IMPORT is_update TO test FROM MEMORY ID 'SOMETHING'.
ASSERT test IS INITIAL.
‎2021 Sep 23 5:49 PM
In the 6.40 backend ABAP debugger > Switch or new tool > Special tools > System areas > Memories (also possible in the very first ABAP debugger, but not in the Eclipse ADT ABAP debugger)
‎2021 Sep 24 6:49 AM
‎2021 Sep 24 6:49 AM
‎2021 Sep 24 8:59 AM
‎2021 Sep 23 4:25 PM
Please in future use the code button in the site editor to nicely format your abap.
‎2021 Sep 23 5:33 PM
‎2021 Sep 24 7:19 AM
The statement EXPORT "zips" ABAP data to data clusters in an SAP internal format and stores the clusters in different storage media, that are listed here:
The storage media can be program fields (BUFFER, INTERNAL TABLE), memory areas (MEMORY, SHARED MEMORY, SHARED BUFFER) and database tables (DATABASE).
The data clusters are identified by keys ID - and area (ar) for some of them.
Of course, you don't find you cluster in the database, if you store it in the ABAP Memory (https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabap_memory_glosry.htm).
To inspect the clusters in the memory, you might use the ABAP Debugger (as already was pointed out).
Only if you export to the database, you can lookup the database table specified in the EXPORT statement and find the ID in the third column (that can have any name).
BR
Horst