07-14-2005 2:17 PM
Hi,
I want to know if a parameter ID of "export/import to memory" instruction is available in two differents session with different user's login?
tks
Carlos
07-14-2005 2:25 PM
Hi,
"an object saved in ABAP memory can be read from any other ABAP program in the same call chain"
The answer is NO.
Svetlin
07-14-2005 2:29 PM
The use of the shared buffer may be of some interest to you.
<b>From F1 help</b>
<i>EXPORT obj1 ... objn TO SHARED BUFFER dbtab(ar) ID key.
Additions:
1. ... = f (for each field you want to export)
2. ... FROM f (for each field you want to export)
3. ... CLIENT g (before ID key)
4. ... FROM wa (as last addition or after dbtab(ar))
In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Implicit field names not allowed in clusters and Table work areas not allowed.
Effect
Stores a data cluster in the cross-transaction application buffer.The specified objects obj1 ... objn (fields, structures, or tables) are stored as a single cluster in the buffer.
The specified table dbtab must have a standard structure.
The buffer area for the table dbtab is divided into various logically-related areas (ar, two-character ID).
You can export a collection of data objects (data cluster) to an area of the buffer under a key of your own choosing (key field).
You can import individual data objects from this collection using the IMPORT statement (as long as the data has not been deleted from the buffer).
Notes
In classes, you must always specify explicit names for the data objects. Addition 1 or addition 2 is therefore obligatory.
In classes, you must always specify the work area explicitly. Addition 4 is therefore obligatory.
The table dbtab that you specify after SHARED BUFFER must be declared under TABLES (except in addition 4).
You cannot export the header line of an internal table. If you specify the name of an internal table with a header line, the system always exports the actual table data.
You cannot export data, object, and interface references.
Please consult Data Area and Modularization Unit Organization documentation as well.
Example
Exporting two fields and an internal table to the buffer with structure INDX:
TABLES INDX.
TYPES: BEGIN OF ITAB3_TYPE,
CONT(4),
END OF ITAB3_TYPE.
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
F1(4), F2 TYPE P,
ITAB3 TYPE STANDARD TABLE OF ITAB3_TYPE WITH
NON-UNIQUE DEFAULT KEY INITIAL SIZE 2,
WA_INDX TYPE INDX.
Fill data fields before CLUSTR
before the actual export
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
Export data.
EXPORT F1 FROM F1
F2 FROM F2
ITAB3 FROM ITAB3
TO SHARED BUFFER INDX(ST) FROM WA_INDX ID INDXKEY.
Addition 1
... = f (for each object you want to export)
Effect
Exports the contents of the field f and stores them under the specified name.
Addition 2
... FROM f (for each field you want to export)
Effect
Exports the contents of field f and stores them under the specified name.
Addition 3
... CLIENT g (before ID key)
Effect
The data objects are stored in client g (as long as the import/export table dbtab is client-specific).
Addition 4
... FROM wa (as last addition or after dbtab(ar))
Effect
Use this addition if you want to store user data fields in the application buffer. Instead of the table work area, the system uses the specified work area wa. The specified work area must have the same structure as the table dbtab.
Example
DATA WA LIKE INDX.
DATA F1.
WA-AEDAT = SY-DATUM.
WA-USERA = SY-UNAME.
WA-PGMID = SY-REPID.
EXPORT F1 = F1 TO SHARED BUFFER INDX(AR)
CLIENT '001' ID 'TEST'
FROM WA.
Note
Catchable runtime error
EXPORT_BUFFER_NO_MEMORY: The EXPORT data cluster is too big for the application buffer. This error should not occur often, since the buffer uses a procedure similar to the LRU(Least Recently Used) procedure to monitor the buffer contents. However, if the error does occur, you can increase the profile parameter rsdb/obj/buffersize (see Profile Parameter Attributes), which may help.</i>
Regards,
Rich Heilman
07-14-2005 2:38 PM
Here is sample.
Exporting program.
report zrich_0001.
data: l_key(60) type c.
data: l_parm(50) type c value 'This is your data right here'.
l_key = 'TESTING123'.
export e_parm = l_parm
to shared buffer indx(st) id l_key.
importing program.
report zrich_0003 .
data: l_key(60) type c.
data: l_parm(50) type c.
l_key = 'TESTING123'.
import e_parm = l_parm
from shared buffer indx(st) id l_key.
write:/ l_parm.
Run the first one under one user id and the other right after that under another user id.
Regards,
Rich Heilman
07-14-2005 5:11 PM
07-14-2005 5:35 PM