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: 

use of memory id

Former Member
0 Kudos
4,363

friends let me know the use of memory id on a report statement?

11 REPLIES 11

Former Member
1,511

to share the values between intenal sessions and external sessions.

<u>External Session</u>

An instance of an R/3 window within the SAP GUI on the application server.

When you log on to the R/3 System, the system opens an external session. You can then open up to five more sessions, which all behave like separate logons to the R/3 System. The number of the current external session is displayed in the status bar.

<u>Internal Session</u>

Instance of an ABAP program within an external session.

External procedure calls allow you to load several ABAP programs in an internal session. Program calls open their own internal sessions.

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

Hope this will solve ur problem..

<b><u>Dont forget to reward all the useful replies</u></b>

Sudheer

rahulkavuri
Active Contributor
0 Kudos
1,511

when u are passing on values from one program to another program then we can use memory ID's

Program1

EXPORT EXCH1 TO MEMORY ID 'EXCH'.

Program2

IMPORT EXCH1 FROM MEMORY ID 'EXCH'.

EXCH1 is the variable name whose value u are exporting and importing from..

This is only valid till the particular session,

dont forget to award points if found helpful

former_member223537
Active Contributor
0 Kudos
1,511

Hi,

Memory ID is to store values for internal sessions.

In Report statement we have MEssage-ID & not memory ID

... MESSAGE-ID mid

Effect

This addition specifies the standard message class for the main program. This contains the messages used with the simple MESSAGE statement.

Note

This message class must not be enclosed in quotation marks.

You can use a namespace prefix with message class names.

Best regards,

Prashant

Former Member
0 Kudos
1,511

Hi,

There are two types of memory .

1 .ABAP Memory - Export /Import - session dependent

2 .SAP memory - set/get - This is not

Check out this example ot ABAP memory .

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

***do rewards if usefull

Regards,

vijay

Former Member
0 Kudos
1,511

memory id is used to is 2 ways

1) export/import memory id i.e. abap memory

2) set get parameters i.e sap memory

Former Member
0 Kudos
1,511

Hi,

Memory ID refers to the use of ABAP Memory which is specific to an external session(window). When you have multiple sessions open, each of the concurrent sessions(windows) has it's own ABAP Memory.

ABAP Memory can thus, only be used to share data between internal sessions, that is programs/transactions that have been called by other programs/transactions in the same external session(window).

ABAP memory is cleared(and correspondingly all Memory IDs), when the session is deleted(window is closed), not when the transaction ends. The only exception to this rule when a transaction ends through the use of

LEAVE TO TRANSACTION

which is when the entire external session is flushed and the ABAP Memory is cleared.

Regards,

Padmam.

Former Member
0 Kudos
1,511

It stores the parameter to a memory location while transporting a parameter from one program to another. Following are the examples of two program which use memory id to transfer the internal table from one to another.

report  z_82235_test1                           .

types: begin of tab1,
         a(1),
         b(1),
       end of tab1.

types: begin of tab2,
         c(1),
         d(1),
       end of tab2.

data: itab1 type table of tab1,
      wa1 like line of itab1,
      itab2 type table of tab2,
      wa2 like line of itab2.

wa1-a = '1'.
wa1-b = '2'.
append wa1 to itab1.
clear wa1.

wa1-a = '3'.
wa1-b = '4'.
append wa1 to itab1.
clear wa1.


export itab1 to memory id '001'.
export itab2 to memory id '002'.

submit z_82235_test2 and return exporting list to memory .


import itab1 from memory id '003'.
import itab2 from memory id '004'.

write:/ 'ITAB1'.
loop at itab1 into wa1.
write : / wa1-a, wa1-b.
clear: wa1.
endloop.

write:/ 'ITAB2'.
loop at itab2 into wa2.
write : / wa2-c, wa2-d.
clear: wa2.
endloop.

report  z_82235_test2                           .

types: begin of tab1,
         a(1),
         b(1),
       end of tab1.

types: begin of tab2,
         c(1),
         d(1),
       end of tab2.

data: itab1 type table of tab1,
      wa1 like line of itab1,
      itab2 type table of tab2,
      wa2 like line of itab2.

import itab1 from memory id '001'.
import itab2 from memory id '002'.

itab2[] = itab1[].

wa1-a = 'a'.
wa1-b = 'b'.
append wa1 to itab1.
clear wa1.




export itab1 to memory id '003'.
export itab2 to memory id '004'.

former_member208856
Active Contributor
0 Kudos
1,511

Hi,

When we need some record of one program into the another program at runtime, we can use a ztable for store the record and retreive the same by another program.

By using memory id, there is no need to store the same record in the database, you can import and export the record by using memory id statement as below :

EXPORT Var1 FROM Var1 TO MEMORY ID 'Var1'.

IMPORT Var1 to Var2 FROM MEMORY ID 'Var1'.

Regards,

Sandeep Kaushik

Former Member
0 Kudos
1,511

hi raja,

to share the values between intenal sessions and external sessions.

External Session

An instance of an R/3 window within the SAP GUI on the application server.

When you log on to the R/3 System, the system opens an external session. You can then open up to five more sessions, which all behave like separate logons to the R/3 System. The number of the current external session is displayed in the status bar.

Internal Session

Instance of an ABAP program within an external session.

if helpful reward some points.

with regards,

suresh babu aluri.

MonicaGarg
Discoverer
0 Kudos
1,475

Let say we're using MEMORY ID, now two different users execute the same ABAP-program, which uses the same Memory ID, so does user A affects to the content of Memory ID of user B?

0 Kudos
893

Hello Monica,

I need too the answer to your question...

Did you find the answer in the meantime?

Many thanks,

James