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: 

abap memory?

Former Member
0 Kudos
114


******************************************************************************************************************

report zxy_0002 .

data: it001 type table of t001 with header line.

select * into table it001 from t001.

export it001 = it001 to memory id 'ZXY_TEST'.

clear it001. refresh it001.

import it001 = it001 from memory id 'ZXY_TEST'.

loop at it001.

write:/ it001-bukrs, it001-butxt.

endloop.


******************************************************************************************************************

Hi abap experts,

I have gone through above small program abou abap memory from some study material.

i need few more explanation about memory id 'ZXY_TEST' where it locates?

how to see whether the memory id ZXY_TEST has the data or not?

8 REPLIES 8

Former Member
0 Kudos
72

This memory exists when till the user logged off the system(within the same session) . and when the user logs out of the system this will be cleared. This feature is use full serving as the communication channel from one program to another. Read this topic in help.sap.com for further explanation.

http://help.sap.com/saphelp_46c/helpdata/en/9f/db9df735c111d1829f0000e829fbfe/content.htm

0 Kudos
72

Hi aswatha narayana,

thanks for quik response,

export it001 = it001 to memory id 'ZXY_TEST'.

above statement meaning is passing the it001 data to a memory location area called 'ZXY_TEST' .

It is true or false?

0 Kudos
72

Yes it stores the value of it001 in ZXY_TEST named memory id in abap memory still the session that user logged on exists. Within that time you can access this value in any program within the same session.

thanks.

0 Kudos
72

thanks

Former Member
0 Kudos
72

Clear it001[]. (refresh is an obsolete keyword!).

import it001 = it001 from memory id 'ZXY_TEST'.  "also an obsolete usage

 

      if lines( it001 ) > 0.

* the export was successful and passed data to a memory tag in the user context, because you were able to retrieve it from the memory id tag.

  endif.

It is only available to that user, so this is not a good solution.  Additionally, if you run SLIN on your code, you will see (if you are in current SAP versions) that your usage is obsolete.

See SAP's documentation of "shared objects" for better ways to share data, including ABAP Memory, transactions named like SHM*,  and how to use INDX-like tables to efficiently store data to be used by any program, any user, on any app server within the instance.

0 Kudos
72

Hi David Lindsey ,

thanks for quik response,

export it001 = it001 to memory id 'ZXY_TEST'.

above statement meaning is passing the it001 data to a memory location area called 'ZXY_TEST' .

It is true or false?

0 Kudos
72

Its always better to clear the SAP Memeory once the usage is done.Other wise it will harm your performance by a lot And Till the next login of yours intlo the system it will be stored in the ABAP memory.

Thnaks,

Vijay.

Former Member
0 Kudos
72

Hi,

for in depth ABAP memory management

you need to learn something about garbage collection.

hope this is useful for you.

Avirat