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: 

Session memory / Program memory

Former Member
0 Kudos

Hi All,

I have never used the memory concept. Can somebody please explain how it can be used.

My requirement is to create a unique ID in a User Exit of a particular standard process and export it and read this unique id in the next user exit of the same program. The idea is that this id remains unique, for one run of a standard program. If the same program is run in parallel, another unique id is created and only that is is picked up in the following user exit for that run of the program.

Please advise how this can be possible.

Thanks in advance,

Archana

1 REPLY 1

Former Member
0 Kudos

Hello Archana...

The memory concept is simple....just you upload a value the abap memory with unique ID....

for this purpose to upload to the abap memory use

SET PARAMETER ID pid FIELD dobj

ie:

SET PARAMETER ID 'YOURID' FIELD VALUE ->value you want to upload

To download the value....

GET PARAMETER ID pid FIELD dobj

ie:

GET PARAMETER ID 'YOURID' FIELD VALUE ->variable to input the value

More samples:

DATA: carrier TYPE spfli-carrid,

connection TYPE spfli-connid.

START-OF-SELECTION.

SELECT carrid connid

FROM spfli

INTO (carrier, connection).

WRITE: / carrier HOTSPOT, connection HOTSPOT.

HIDE: carrier, connection.

ENDSELECT.

AT LINE-SELECTION.

SET PARAMETER ID: 'CAR' FIELD carrier,

'CON' FIELD connection.

CALL TRANSACTION 'DEMO_TRANSACTION'.

-


DATA: para TYPE tpara-paramid VALUE 'RID',

prog TYPE sy-repid.

GET PARAMETER ID para FIELD prog.

IF sy-subrc <> 0.

MESSAGE 'Parameter not found' TYPE 'I'.

ENDIF.

Check the documentation for more info

Hope this helps

Gabriel