Ansicht
Dokumentation

SIMG_OIJ_TSW_007 - Business Add-In for nomination status checks

SIMG_OIJ_TSW_007 - Business Add-In for nomination status checks

ABAP Short Reference   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

Here you can implement a Business Add-In (BAdI) for enhancing status prerequisite checks.

When you define Status Profiles and Dependencies, you have the choice to define prerequisite status codes for a process using simple boolean expressions, or a more complex logic by implementing a filter-dependent BAdI. You can then refer to the BAdI that you implement here, instead of a boolean expression for active/inactive status codes.

You can implement status code checks that are dependent on the nomination data itself.

If Contract partner equals 'X', check status code 'ZAP1' (approved my manager 1)
If Contract partner equals 'Y', do not check an approval status
otherwise check status 'ZAP2' (approved by manager 2)

method IF_EX_OIJ_NOM_STPREREQ~PREREQUISITE_CHECK.

DATA: ls_nom_item TYPE roijnomiio.

LOOP AT it_nom_item INTO ls_nom_item.
CHECK: ( ls_nom_item-docind EQ 'S' OR
ls_nom_item-docind EQ 'G' ) AND
NOT ls_nom_item-conpat IS INITIAL.
CASE ls_nom_item-conpat.
WHEN 'X'.
CALL FUNCTION 'OIJ_NOMST_CHECK_STATUS'
EXPORTING
iv_status = 'ZAP1'
iv_nomtk = is_nom_header-nomtk
IV_NOMIT = ls_nom_item-nomit
EXCEPTIONS
STATUS_NOT_SET = 1
STATUS_NOT_ACTIVE = 2
OTHERS = 3.
IF sy-subrc EQ 0.
ev_check_fullfilled = lc_true.
ENDIF.
WHEN 'Y'. ev_check_fullfilled = lc_true.
WHEN others.
CALL FUNCTION 'OIJ_NOMST_CHECK_STATUS'
EXPORTING
iv_status = 'ZAP2'
iv_nomtk = is_nom_header-nomtk
IV_NOMIT = ls_nom_item-nomit
EXCEPTIONS
STATUS_NOT_SET = 1
STATUS_NOT_ACTIVE = 2
OTHERS = 3.
IF sy-subrc EQ 0.
ev_check_fullfilled = lc_true.
ENDIF.
ENDCASE.

endmethod.






Vendor Master (General Section)   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 2387 Date: 20240523 Time: 193543     sap01-206 ( 28 ms )