03-27-2014 7:34 AM
We are using EXIT_SAPLV01Z_002 exit to assign an external batch number in sequence for PO in Cor2.
This is triggered during the "create batch" button and also during the "release".
now suppose the next batch number to be assigned is ABCD20.
if i open two orders simultaneously in cor2 , both generates ABCD20.
The desired output is: if two orders are opened and batch is generated simultaneously, then one should generate ABCD20 and other ABCD30.
It is not necessary that the batch will be saved to the order at this moment.
I tried using import export of internal tables.but it is not working properly.
If i assign ABCD20 to PO1 and ABCD30 to PO2 in internal table, it always will generate ABCD30 for PO2, even if it is opened alone in cor2.
03-28-2014 6:54 AM
Problem solved.
Used import export of internal table and FM ENQUEUE_READ to check the lock of other orders.
03-27-2014 8:08 AM
03-27-2014 8:13 AM
How are you assigning the external number bacth assignment..? How is this number ABCD20 generated?
Nabheet
03-27-2014 8:52 AM
EXIT_SAPLV01Z_002 is used to rename the batch which sap generates.
There is a logic to get the first characters then 20 is the sequence number
03-27-2014 9:07 AM
How do you decide the sequence..? Are you reading it from database..? Please provide the logic
03-27-2014 9:11 AM
yes i check the last sequence for ABCD in mcha table.
if 10 is laready there i do a +10 which gives 20
03-27-2014 9:18 AM
Okie...Do one thing you should actually create a custom table with a lock object and update it with current number then it can work.
Nabheet
03-27-2014 8:41 AM
Sorry not a very comprehensive answer as I haven't used this exit myself, but have you tried EXIT_SAPLV01Z_001 as it looks to me more correct for assigning batch number?
Or maybe a combination, you can maybe supress the one number if it is selected by second user in 001?
03-27-2014 8:53 AM
The exit i am using is correct. It works as expected. only I am not able to decide the next sequence of the batch for order when there are multiple sessions.
03-27-2014 11:24 AM
03-28-2014 6:54 AM
Problem solved.
Used import export of internal table and FM ENQUEUE_READ to check the lock of other orders.