2012 Sep 27 3:44 PM
I have problem with import / export statement
I have used the below statements.
I am using this in Badis but the problem is if two users use the transaction simultaniously
BADI 1
wa_indx-aedat = sy-datum.
wa_indx-usera = sy-uname.
wa_indx-pgmid = sy-repid.
EXPORT ct_param FROM ct_param
TO DATABASE indx(ab)
ID 'CTPARAM'
FROM wa_indx
.
BADI 2
IMPORT ct_param TO ct_param
FROM DATABASE indx(ab)
ID 'CTPARAM'.
there is problem in data i.e if one user has exported and the other user has completed the
transaction the previous user also sees the data data of latter user.
the sequence is as below
Export --- user1
export --- user 2
import --- user 2
import --- user 1
This way user 1 has data of user 2 as it is already overwritten (export --- user2)
How to solve this prob.
2012 Sep 27 3:49 PM
Hi Karan,
Export to database index will not work for your requirement because it is a permanent storage in INDX table and you are using the same id. You can use simple export and import or get/set fm or method for your purpose.
EXPORT ct_param TO ct_param to MEMORY ID 'ZZMEM123'.
IMPORT ct_param FROM ct_param to MEMORY ID 'ZZMEM123'.
Make sure the variable name is same for both EXPORT and IMPORT.
Regards,
R
2012 Sep 27 3:56 PM
Hi, keep in mind that IMPORT/EXPORT Statements works only for passing variables among all internal sessions of an external session.
Please check this if it is ok according to this, then i can help you with the syntax.
Greetings.
Message was edited by: Marcos Carrasco
2012 Sep 27 5:23 PM
The users were using different user IDs but as INDX table does not have User Id as primary keys using export to database overwrites the entries.
If we use EXPORT ct_param TO ct_param to MEMORY ID 'ZZMEM123' will this work with different IDs
What if the Users use a common SAP ID but Different Machines. will it have individual memories or same will be overwritten as above.
Also what is SET/GET FM or any method for the same.
2012 Sep 27 5:48 PM
Hi,
ID CTPARAM must be unique for each user id.
EXPORT ct_param FROM ct_param
TO DATABASE indx(ab)
ID 'CTPARAM'
FROM wa_indx
If that is not the case then multiple user who are using same ID will get locking Error in INDX table.
2012 Sep 28 5:42 AM
EXPORT ct_param FROM ct_param
TO DATABASE indx(ab) is not working here as in INDX table user Id is not primary key and data gets overwritten.
Please confirm me if
EXPORT ct_param TO ct_param to MEMORY ID 'CT_PARAM' will be working in this scenario.
If the events occur in this sequence with same User ID on different machines
Now I this case will the User 1 have data of User 2 in memory ID 'CT_PARAM' as User 2's Export (statement 2) might have overwritten User 1's Export (statement 1), so will the User 1 will get User 2's memory ID data ?
<removed by moderator>
Message was edited by: Thomas Zloch
2012 Sep 28 6:02 AM
Hi Karan,
with export to and import from memory ID never data will be exchanged between different users.
Don't know wether i understand your problem. If 2 BAdIs run in same internal session und you would like to pass data from one to the other, just use the same class for booth BAdI Impl. and put the data to static attributes.
Regards René
2012 Sep 28 7:34 AM
No the USERs are different means they are different machines but SAME SAP ID
What will be the data in that case will this work or not
2012 Sep 28 7:46 AM
have a look at http://help.sap.com/abapdocu_70/en/ABENMEMORY_ORGANIZATION.htm
memory ID depends on a user session. A second login with the same user ID is a second user session. To pass data between the 2 user sessions you have to use the DB.
2012 Sep 28 8:16 AM
Hi Karan,
What Rene has explained here is that one user having 2 separate logons have 2 different internal sessions and the data in memory is not copied.
Try this program by logging in form 2 different systems and look at the outputs. Check the results in Debug mode.
DATA lv_time TYPE sy-timlo.
lv_time = sy-timlo.
EXPORT lv_time TO MEMORY ID 'id'.
IMPORT lv_time = lv_time FROM MEMORY ID 'id'.
write lv_time.
Thanks,
Shambu
Message was edited by: Shambu VS