Actions

ABAP Memory

Revision as of 21:50, 23 September 2019 by User (talk | contribs)

ABAP memory is the temporary memory storage used by ABAP programs and objects that are using the same internal session - or same memory area - for all activities. Compared to SAP memory, which is considered a global memory, ABAP memory is a local memory. ABAP memory is independent of the ABAP (Advanced Business Application Programming) programs or objects that generate it, thus making it possible to transmit values across different objects or programs irrespective of their characteristics. This is particularly useful for programs that are live in the same session.[1]

ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.

  • External session: - when user logs on to R/3 system, the system Creates a new terminal session called external session. E.g. System Session.
  • Internal session: - created by calling a transaction (with CALL TRANSACTION), a dialog module (with CALL DIALOG) or a report (with SUBMIT or RETURN).

In general each user can open up to six R/3 windows in a single SAPgui session. Each of these windows corresponds to a session on the application server with its own area of shared memory.

The first application program that you start in a session opens an internal session within the main session. The internal session has a memory area that contains the ABAP program and its associated data. When the program calls external routines (methods, subroutines or function modules) their main program and working data are also loaded into the memory area of the internal session. Only one internal session is ever active. If the active application program calls a further application program, the system opens another internal session. Here, there are two possible cases: If the second program does not return control to the calling program when it has finished running, the called program replaces the calling program in the internal session. The contents of the memory of the calling program are deleted. If the second program does return control to the calling program when it has finished running, the session of the called program is not deleted. Instead, it becomes inactive, and its memory contents are placed on a stack.

ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.

External session: - when user logs on to R/3 system, the system Creates a new terminal session called external session. E.g. System Session.

Internal session: - created by calling a transaction (with CALL TRANSACTION), a dialog module (with CALL DIALOG) or a report (with SUBMIT or RETURN).

In general each user can open up to six R/3 windows in a single SAPgui session. Each of these windows corresponds to a session on the application server with its own area of shared memory.

The first application program that you start in a session opens an internal session within the main session. The internal session has a memory area that contains the ABAP program and its associated data. When the program calls external routines (methods, subroutines or function modules) their main program and working data are also loaded into the memory area of the internal session.

Only one internal session is ever active. If the active application program calls a further application program, the system opens another internal session. Here, there are two possible cases: If the second program does not return control to the calling program when it has finished running, the called program replaces the calling program in the internal session. The contents of the memory of the calling program are deleted. If the second program does return control to the calling program when it has finished running, the session of the called program is not deleted. Instead, it becomes inactive, and its memory contents are placed on a stack.[2]


SAP Memory vs ABAP Memory

ABAP (Advanced Business Application Programming) programs run on a SAP database. ABAP programs can utilize two types of memory, ABAP memory and SAP memory. The main difference between these two types of memory is their scope. ABAP memory is pretty limited and can only be accessed within one main internal session. Other programs running outside that session will not be able to read or write to that memory. On the other hand, SAP memory is pretty much like global memory and is accessible not only by programs that are running under the same main session but also across different main sessions.

The different scopes between the two lead to two different uses. The main use of ABAP memory is to make data accessible across multiple transactions within the same session. Although SAP memory is also capable of performing this function, it is reserved for its own purpose; making information available or transferring data across main session.

Not only do these two memory types differ in usage, they are also accessed differently. When dealing with SAP memory, the commands GET PARAMETER and SET PARAMETER are used while IMPORT FROM MEMORY and EXPORT TO MEMORY are used to read and write data to the ABAP memory. This makes it relatively easy to program as you are already indicating the type of memory that you want to use with the command that you are using; rather than using other parameters.

ABAP and SAP memory are essential tools when coding ABAP applications. It is important that they are used appropriately in order to minimize resource usage and enhance the speed and efficiency of the application.[3]


References

  1. Defining ABAP Memory Techopedia
  2. Explaining ABAP Memory SAP Community Wiki
  3. SAP Memory vs ABAP Memory Difference Between


Further Reading

  • How To Use Memory ID (ABAP Memory) AC
  • Exporting and importing data objects from and into Abap memory IT Toolbox
  • A Developer’s Guide to Protecting Memory: Detect and Eliminate Damaging Memory Leaks with ABAP Memory Inspector SAP Insider


See Also

IT Strategic Planning
e-Business Strategic Planning
Governance of Information Technology (ICT)
What is Enterprise Architecture Planning
Information Technology Sourcing (IT Sourcing)
Information Technology Operations (IT Operations)
Chief Information Officer (CIO)
Leadership