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

Deleting data from memory

Former Member
0 Likes
2,532

Hi,

I am using a Enhancement for my requirement. The enhancement

contains 2 Function exits., FE1 & FE2.

In FE2, I export data in 'ABC' to memory and In FE1 I import data in

memory to a variable 'XYZ' from memory.After importing,I delete the memory area.

Everything works fne till here.

But, suppose in a certain scenario after importing memory to variable 'XYZ' from memory,

before I delete the memory area due to some exception the program stops in the middle.

Now, again when I start the same process, I find my old data in the memory.

This is causing me a lot of headache. Agreed, I use a memory area, I need to delete it to make sure evrything runs smoothly in

future scenarios.

Right now am using database indexes as follows:--

export it to database indx(mm) id 'ZABC'.

import it from database indx(mm) id 'ZABC'.

delete from database indx(mm) id 'ZABC'.

Are there any means of using memory areas for storage of my data ,

so that when I start a new process the memory area which I used earlier should be freed by itself autmatically

and start afresh, even if I didnt delete the memory area earlier.

Thanks in advance,

Shivaa...

4 REPLIES 4
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,329

Usually i add a "spy" (reference number or the like, timestamp) in the data exported, so i can make a plausabilty check when IMPORT find some data.

Regards,

Raymond

Read only

0 Likes
1,329

Another reference (see Raymond answer) might be the Transaction ID (TH_GET_TRANSACTION_ID): if the transaction fails, the TID will change. If the data in memory belongs to another TID than the current one, then you know that it is obsolete. Of course, the TID also changes after each COMMIT WORK or ROLLBACK WORK.

Read only

Former Member
0 Likes
1,329

Try to use FREE MEMORY ID id

Regards,

Raj Gupta

Read only

Former Member
0 Likes
1,329

Hi,

You can use memory ids for storing variables or even internal tables. The syntax for that would be

export p1 = gt_mara to memory id 'ZABC'.

and import p1 = gt_mara from memory id 'ZABC'.

No need to declare p1 anywhere.

and when ur work is done.

free memory id 'ZABC' which will clear the value. ( free the memory )

Edited by: Kshitijsaxena on Aug 20, 2009 5:54 PM