Application Development and Automation 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: 
Read only

Memory ID

Former Member
0 Likes
627

Hi Everybody,

Can someone tell me how can we clear a Memory ID.

Like if we are doing this

EXPORT CHANGE TO MEMORY ID 'CHANGE_ID'.

How can I clear CHANGE_ID??

Please help.Its urgent.

Thanks,

Sirisha Matta.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
588

Hi,

Use FREE MEMORY ID <Memory_ID>

Hope this is helpful.

Thanks,

Pavan

3 REPLIES 3
Read only

Former Member
0 Likes
589

Hi,

Use FREE MEMORY ID <Memory_ID>

Hope this is helpful.

Thanks,

Pavan

Read only

Former Member
0 Likes
588

Hi kangana,

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'.

memory id 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.

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

codereport 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'.[/code]

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.

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

Hope this will solve ur problem..

thanks

karthik

reward me if usefull

Read only

Former Member
0 Likes
588

Hi,

Use the statement free memory ID.

Regards,

Fernando