In SAP Plant Maintenance (PM), warranty periods for technical objects are designed to be inherited automatically from superior functional locations to their subordinate locations. This is part of the standard functionality. However, in practice, this inheritance sometimes fails... leading to inconsistencies and manual corrections that consume time and create frustration for PM administrators.
Although SAP provides automatic inheritance for warranty start and end dates, there are cases where this process does not work as expected. Common reasons include:
When inheritance fails, subordinate locations remain without warranty data, which can impact maintenance planning and compliance.
Instead of relying solely on the standard process, we developed a lightweight ABAP report that ensures warranty data consistency across the hierarchy. The report reads warranty start and end dates from the parent functional location and applies them to all subordinate locations, writing the data directly into the BGMKOBJ table.
MODIFY on BGMKOBJ, which automatically decides whether to update existing records or insert new ones.LOOP AT lt_child ASSIGNING FIELD-SYMBOL(<child>).
IF p_test = abap_true.
lv_status = |SIMULATION: Location { <child>-tplnr } would be updated or newly created.|.
ELSE.
CLEAR wa_bgmkobj_child.
wa_bgmkobj_child = wa_bgmkobj_parent.
wa_bgmkobj_child-j_objnr = <child>-objnr.
wa_bgmkobj_child-erdat = sy-datum.
wa_bgmkobj_child-erzei = sy-uzeit.
wa_bgmkobj_child-gaerb = 'X'.
" MODIFY automatically decides whether to INSERT or UPDATE
MODIFY bgmkobj FROM _bgmkobj_child.
IF sy-subrc = 0.
lv_status = |Location { <child>-tplnr } successfully processed.|.
ELSE.
lv_status = |Error processing location { <child>-tplnr }.|.
ENDIF.
ENDIF.
WRITE: / lv_status.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 19 | |
| 11 | |
| 9 | |
| 6 | |
| 5 | |
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |