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

ABAP Memory

Former Member
0 Likes
601

Hi,

I'm importing and exporting some data in a user exit.

when I'm running the same transaction in 2 sessions in debug mode I've noticed that the second sessions data in memory is imported in 1 st sessions memory though the values (sales orders ) are different in both sessions.

I'm not freeing the memory in the program.

So to nail this down I've written a small program but the values are not copied.

Can anyone offer any reason for this?

Thanks..

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
558

Hi Aries,

if there is any data identifying the document uniquely, you could create a internal table bis the identifier as key and the vbrp as data.

Then, first import from memory, insert into the (possibly) empty table, then export it.

Then, where you import from memory, import the internal table and read with identifier key. Delete the line after processing and export again.

If there is no other key available, cou could create a GUID,

CALL FUNCTION 'GUID_CREATE'

IMPORTING

ev_guid_16 = l_guid.

This is said to be always unique and will help you to identify the right entry.

Regards,

Clemens

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
558

What does your EXPORT/IMPORT statements look like, you are not using the shared buffer are ya?

Regards,

RIch Heilman

Read only

0 Likes
558

GET PARAMETER ID 'VF' FIELD zbelnr.

IMPORT i_vbrp FROM MEMORY ID 'm_vbrp'.

if sy-subrc ne 0..

do something.

endif.

EXPORT i_vbrp TO MEMORY ID 'm_vbrp'.

after executing this in the 2nd session and I come back to first session in i_vbrp I can see the 2nd sessions data.

Actually this was written by somebody else but we are having problems when we are processing two billing docs at the same time.Issue is the taxes from 2nd doc are copied into 1st doc and when I debugged saw the copy.

How do I know if I'm using shared buffer?

Read only

0 Likes
558

Hi,

One way to do this,

before assigning the value, check if the memory is filled with a value, if it is then, wait for some time before again assigning value to the memory field.

And in the other program after import, clear the field contents and continue with your processing.

Regards

Subramanian

Read only

Clemenss
Active Contributor
0 Likes
559

Hi Aries,

if there is any data identifying the document uniquely, you could create a internal table bis the identifier as key and the vbrp as data.

Then, first import from memory, insert into the (possibly) empty table, then export it.

Then, where you import from memory, import the internal table and read with identifier key. Delete the line after processing and export again.

If there is no other key available, cou could create a GUID,

CALL FUNCTION 'GUID_CREATE'

IMPORTING

ev_guid_16 = l_guid.

This is said to be always unique and will help you to identify the right entry.

Regards,

Clemens