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: 

Shared Memory, SAP Memory and ABAP Memory

Former Member
0 Kudos

Dear Friends,

As far as I understand:

<b>Shared Memory</b>: is common memory within an application server(not between application servers).......correct me if I am wrong.

<b>SAP Memory</b>: is common memory is accessable to all the main sessions within an user login.

<b>ABAP Memory</b>: is common memory is accessable to all the internal sessions within a Main Session.

My question here is:

1. <b>Shared Memory</b> cannot be directly used by program unlike SAP Memory and ABAP Memory ? Am I correct ?

2. Sometimes people use(say) <b>Shared Memory</b> and ABAP Memory interchangably, are they the same ? I believe they are different things, Am I correct ?

Thanks in advance,

Rajesh

3 REPLIES 3

Former Member
0 Kudos

Hi,

Both SAP Memory and ABAP Memory are user specific memory areas on the App Server. So one thing to be kept in mind is that even if you decide for SAP memory, due to data tranfer across external sessions, the user name has to be the same to share data. Otherwise, you should use EXPORT TO SHARED BUFFER.

Another option could be to use EXPORT TO DATABASE...

Hope this helps.

Regards

Former Member
0 Kudos

ABAP Memory

ABAP memory is a memory area within the internal session (roll area) of an ABAP program and any other program called from it using CALL TRANSACTION or SUBMIT.

ABAP memory is independent of the ABAP program or program module from which it was generated. In other words, an object saved in ABAP memory can be read from any other ABAP program in the same call chain. ABAP memory is not the same as the cross-transaction global SAP memory. For further information, refer to Passing Data Between Programs.

This allows you to pass data from one module to another over several levels of the program hierarchy. For example, you can pass data

· from executable programs that have been called using SUBMIT

· From a transaction to an executable program.

· Between dialog modules.

· From a program to a function module.

and so on.

The contents of the memory are released when you leave the transaction.

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.

The memory area of each session contains an area called ABAP memory. ABAP memory is available to all internal sessions. ABAP programs can use the EXPORT and IMPORT statements to access it. 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.

All ABAP programs can also access the SAP memory. This is a memory area to which all sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters are often used to preassign values to input fields. You can set them individually for users, or globally according to the flow of an application program. SAP memory is the only connection between the different sessions within a SAPgui.

the link shows the diagram .... where all the memory aer working ...

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2d40358411d1829f0000e829fbfe/content.htm

reward points if it is usefull ..

Girish

0 Kudos

hi girish,

In documentation of SAP i found that.

Local SAP memeory - SUBMIT and CALL-TRANSCATION

Abap memory - EXPORT TO MEMORY and IMPORT TO MEMORY.

regards

prabhu