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: 

Duplication of Serial Number

balaji_viswanath
Participant
0 Kudos

We are doing Goods receipt for Order into warehouse through MB31 - 101 movement. There we're selecting Production Order and entering the quantity. Based on the quantity entered we are getting fill-in boxes to enter Serial Numbers in "Maintain Serial Number" screen.

By default SAP is checking and not allowing serial number duplication across material, but we want avoid serial number duplication across database. i.e. serial number should be unique across database.

So we have build logic on enhancement EXIT_SAPLIPW1_001 and it's working fine, if the user click "Create serial number automatically" - data is getting validated, as expected. But if user types the serial number manually and submit, that time user exit is not getting fired and there is serial number duplication.

Please suggest me how to handle this issue?

Advance thanks.

Regards,

V Balaji.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I am not sure but you might have to implement EXIT_SAPLIPW1_004 to validate Serial Numbers entered manually. EXIT_SAPLIPW1_001 validates only when Serial Numbers are automatically generated. If User Exit EXIT_SAPLIPW1_004 also does not work you might try Field Exit for the screen field.

Shashi

5 REPLIES 5

Former Member
0 Kudos

I am not sure but you might have to implement EXIT_SAPLIPW1_004 to validate Serial Numbers entered manually. EXIT_SAPLIPW1_001 validates only when Serial Numbers are automatically generated. If User Exit EXIT_SAPLIPW1_004 also does not work you might try Field Exit for the screen field.

Shashi

0 Kudos

Hi Shashi,

Thanks a lot. Your answer gave me the clue and I have implemented it in EXIT_SAPLIPW1_007 and it's checking for duplication.

But problem now is... If duplication found I want to display a message and come out of the Screen/Transaction.

So I tried

MESSAGE 'Serial Number already exists' TYPE 'I'.

LEAVE TO TRANSACTION 'MB31'.

But message is not getting displayed it's just comming to MB31... but displaying message is important... how to do it?

I tried TYPE 'E' then message is getting displayed and it's asking for the correct serial no. also but if more than one serial no. is there then it's validating only the first one and allowing duplicates for others.

Idealy what I need is... if duplication found it has to display a message and ask for proper one...

How to do it? Advance thanks.

0 Kudos

Hi,

Since message is not working I am using POPUP_TO_DISPLAY_TEXT function module and it's working fine... but

EXIT_SAPLIPW1_001 is getting fired first when user clicks "Create Serial Number automatically" button. If this is code is executed I don't want to execute EXIT_SAPLIPW1_008. So now I want to keep some global flag variable (?) and check the status. If the status is updated then I will not execute the code in EXIT_SAPLIPW1_008. If the status is not updated i.e. user has not clicked "Create Serial Number automatically" button then I want to execute EXIT_SAPLIPW1_008.

How to do it?

Advance thanks.

Regards,

Balaji Viswanath.

0 Kudos

Try Exporting a flag to memory with a unique ID at the end of first user exit and check the flag in the second user exit. this way you can keep track of the calls.

Look for more help on keyword "EXPORT"

Usage: EXPORT obj1 ... objn TO MEMORY ID key.

Hope this would help...

Shashi Reddy

0 Kudos

Hi Balaji V.

Please explain me step by step i had the same issue and i am very much biggner , please explain me how did you implemented user exit in mb31 ,great thanks in advance.