cancel
Showing results for 
Search instead for 
Did you mean: 

How to check for duplicate production order number in archive.

chetan_mody4
Explorer
0 Kudos

Hi,

We have a production order type with external numbering. We also archive production orders. So if we try to create a production order with an external number, with a number that was used earlier, but now archived - then SAP allows that duplication. I want to use a user-exit or BAdI where I can put a code to check AUFNR in archive object PP_ORDER, and if found, then give an error message and abort order creation.

I considered exit PPCO0001, but it does not have provision for NO_UPDATE. So can someone guide me how to abort order creation using PPCO0001 ?

I also consider exit PPCO0006, which is the only exit where I see export parameter NO_UPDATE - but business says that if order number check happens only at the time of saving, then it will be a waste of their effort - so check against archive (and error if any) must happen immediately after selection screen, just the way it happens when SAP finds duplicate number in active database.

I see that a BAdI IF_EX_WORKORDER_UPDATE is available, but here too, provision for error message is only available in method AT_SAVE - which business doesn't want.

I am trying to avoid creating a wrapper program for CO01 (say ZCO01 that would check in archive and stop real CO01), because it will create unnessary issues for authorization management for CO01.

Any solution would be appreciated.

Thanks,

- Chetan

Accepted Solutions (0)

Answers (1)

Answers (1)

sjeevan
Active Contributor
0 Kudos

I see that a BAdI IF_EX_WORKORDER_UPDATE is available, but here too, provision for error message is only available in method AT_SAVE - which business doesn't want.

Did you look at the option of triggering an event of calling a pop screen to facilitate the entry of a different production order number. I guess you'd make something like the screen SAPLCOSD screen number 0131 in flow logic in the PAI you could check the new entry again.