Skip to Content
Feb 06, 2012 at 05:11 PM

How to check for duplicate production order number in archive.



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.


- Chetan