How to access ABAP Memory using EXPORT TO / IMPORT FROM MEMORY statements

Introduction

While working with various programs, reports and user exits, there will be times when you need access to specific information which may not be available in current local or global variables. However, many standard SAP programs will often times EXPORT TO MEMORY (ABAP Memory) data that you can IMPORT FROM MEMORY back into your programs for display, printing or for other computational needs.

Looking in ABAP Memory

If you are not able to locate the data that you need after checking local and global variables, you should then check to see if the data that you need has been written out to ABAP Memory using an EXPORT TO MEMORY statement. Following you will find the steps and information necessary to peer into ABAP memory and discover what might be available for your use.

Although this feature is not currently available in the new ABAP debugger, it happens to be available in the classic debugger. From the classic ABAP debugger, you can view the contents of ABAP memory by going to menu option Goto-> System Areas-> ABAP Memory. This screen lists available memory Ids from which you can IMPORT FROM MEMORY. By double clicking on the memory Id, you can get an idea of what data is available in it. You can page down through the memory area of each memory id in either raw memory format or in standard Ascii format.

Finding the necessary Data Types

Of course, the real challenge is finding the location where the EXPORT TO MEMORY occurred. Howeer, once you do, you can discover the neccesary data types to use in order to read that memory id. One way to find the EXPORT TO MEMORY statements it is to do a simple search of the SAP source code. Another way is to set a Breakpoint at Statement (menu option), for the statement EXPORT.

 

 

Leave a Reply

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

*