Update Purchase requisition based on external operation of production order
During our recent ECC implementation, business requested that Service Material value (populated in user field : AFVGD-USR00) should be auto populated into a purchase requisition for an external operation.
The Purchase Requisition (PR) is created as soon as a Production order lines having Operation control keys relevant for external processing such as ‘EXTL’ or ‘EXTP’ is saved. In Standard SAP, PR is created with Operation text as a Material Description and it does not carry Material code in the PR material Code field. But to provide better visibility to buyer and supplier, business requested a PR to be created from Production order with external operations should address the following.
Purchase Requisition should be
- Auto populated Material code in PR with material code maintained in the “Service Matl” field in the Operation details screen for the external Operation number in Production Order(ref the screen Shot)
- Item long text: material text both short and long copied from the material master, engineering revision level to copy from basic data 1 of the material master.
The business also requested some pre-validations when performing auto population of material code.
For e.g.:
1. The service material code should begin with ‘SM_’.
2. Material should be available in MARA table.
3. Material and plant combination should exist in MARC table.
The validation errors should be visible on the operation details screen of the production order.
It took me some time to debug the end to end transaction to find out appropriate enhancement points to achieve different business requirements. I am listing down the enhancements used in table below.
I hope this is useful for others attempting to map similar requirements during automatic PR created\changed when Production Order is created\changed.
Enhancement Details:
Sequence |
Enhancement Type |
Enhancement Name |
Purpose |
1 | User – Exit | EXIT_SAPLCOVG_001 |
E.g. when there is no change to external operation or when an external operation is deleted etc.
|
2 | Spot |
Enhancement spot – ES_SAPLCOZF Point – \PR:SAPLCOZF\EX:SAPLCOZF_OLC_002\EI |
|
3 | User – Exit | EXIT_SAPLCOZF_001 |
|
4 | Badi |
WORKORDER_UPDATE Method – AT_SAVE |
|
5 | Spot |
Enhancement spot – ES_SAPLEBNE Point – \PR:SAPLEBNE\EX:LEBNEF08_01\EI |
|
6 | Badi |
WORKORDER_UPDATE Method – IN_UPDATE |
|
Interesting requirement. I agree, it does provide better visibility to user.
Hi
First of all thanks for writing about it in detail. From the way if i look at your solution it looks like you have implemented so many exits, which to me does not look valid. It looks like you have used various exits just because you were not having some data available or it as not triggered for that process. If you will closely check their are function modules which SAP standard tcode is also using to fetch change/new etc data as they are assigned globally you could have used the same or we have other ways to access global data also.
I would have tried to do it at one enhancement only or max two one for collecting and exporting data if it not available at the other place.
Having so many enhancement for copying some field value only to me it does not look like the best possible solution
Nabheet