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: 

External batch number assignment with multiple user sessions

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Problem solved.

Used import export of internal table and FM ENQUEUE_READ to check the lock of other orders.

10 REPLIES 10

former_member458055
Participant
0 Kudos

Hi,

Have you tried using lock objects?

Regards -

Makarand

nabheetscn
Active Contributor
0 Kudos

How are you assigning the external number bacth assignment..? How is this number ABCD20 generated?

Nabheet

0 Kudos

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

0 Kudos

How do you decide the sequence..?  Are you reading it from database..? Please provide the logic

0 Kudos

yes i check the last sequence for ABCD in mcha table.

if 10 is laready there i do a +10 which gives 20

0 Kudos

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

former_member201275
Active Contributor
0 Kudos

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?

Former Member
0 Kudos

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.

0 Kudos

Dear krishnapriya nair,

check the attached sample code ...hope it helps

Regards

Shravan

Former Member
0 Kudos

Problem solved.

Used import export of internal table and FM ENQUEUE_READ to check the lock of other orders.