SAP Note 2897493 Example Implementation - Lean Services
SAP Note 2897493 Example Implementation - Lean Services
SAP Note 2897493 Example Implementation - Lean Services
1 October 2021
PROCEDURE
From S/4HANA On-Premise 1909 onwards, SAP blocks the procurement of lean services from a
Maintenance Order. This is to avoid the inconsistent processing of procurement documents and the resulting
extra efforts for purchasing departments. By implementing a Business Add-In (BAdI), you can disable this
blocking.
2. Implement method SKIP_PROCESSING so that it returns abap_true if the blocking of lean service
procurement shall be disabled in Maintenance orders:
METHOD if_badi_eam_ord_lean_service~skip_processing.
result = abap_true.
ENDMETHOD.
With the blocking of lean service procurement disabled, the system will pass components referring to lean
service components to the purchase requisition generation. When a purchase requisition item refers to a
lean service, the system requires additional information which need to be provided in the purchase
requisition item:
- The product type group must be “2” (PRODUCTTYPE)
- Start and end date of the service performance (STARTDATE, ENDDATE)
- Business partner acting as the service performer (SERVICEPERFORMER, optional)
It will be your responsibility to provide the additional aforementioned information into structure EBAN. User
exit COZF0002 can be used for influencing the data which is passed to the purchase requisition.
PRODUCTTYPE PRODUCT_TYPE
SERVICEPERFORMER SERVICEPERFORMER
STARTDATE MMPUR_SERVPROC_PERIOD_START
ENDDATE MMPUR_SERVPROC_PERIOD_END
Note: The system will warn that these fields are not in customer namespace (“Field … does not lie
within customer namespace”). If SAP chooses to add these fields to the same structure in a later
release, a syntax error will occur at time of upgrade and you will have to delete your append
structure. See SAP Note 3048858 for details and restrictions.
7. Create include ZXCOZU02 in function group XCOZ if it doesn’t exist already. You can do so by right-
clicking on the include in transaction SE80 and choosing “Create”.
8. Implement your custom code in include ZXCOZU02. Your code will be executed whenever the data of
a non-stock order component is transferred to the purchase requisition. This data transfer occurs
when the component is created and whenever it is changed, either by the user or by the system, e.g.
when re-scheduling the Maintenance order. Refer to the documentation of the exit to understand
what data is available to you at runtime. Also keep in mind that this exit is called for other kinds of
orders, e.g. production orders.
IF caufvd_imp-autyp = '30'
AND resbd_imp-matnr IS NOT INITIAL.
IF producttypecode = '2'.
eban_ord_cust_chg-producttype = '2'.
eban_ord_cust_chg-startdate = resbd_imp-bdter.
IF caufvd_imp-gltrs IS NOT INITIAL.
eban_ord_cust_chg-enddate = caufvd_imp-gltrs.
ELSE.
" No schedule finish date yet- set same as start date
eban_ord_cust_chg-enddate = eban_ord_cust_chg-startdate.
ENDIF.
ENDIF.
ENDIF.
9. Activate the user exit COZF0002. You do so by adding the exit to an enhancement project in
transaction CMOD and clicking “Activate”.
ADDITIONAL SUGGESTION
Like non-stock components, lean services can also be ordered without a material master being present. In
this case, you cannot derive a product type group. Instead, you could define an item category dedicated to
lean service procurement. Then, whenever you are processing this item category (RESB-POSTP) in above
code extension, populate the PRODUCTTYPE field accordingly.
Copyright/Trademark