SAP MDG: S - How to make Check - Check Double Invoice on choosing Company Code


Scenario:

In Navigation: Supplier Governance > CR > ERP Vendors > ERP Vendor: Company Codes

On choosing of any Company Code

Implementation:

BADI Name: USMD_RULE_SERVICE

Code:

  METHOD if_ex_usmd_rule_service~derive_entity.

    DATA: lo_data TYPE REF TO data.

    FIELD-SYMBOLS : <ls_puorg> TYPE any,
                    <lv_value> TYPE any.

    CREATE DATA lo_data LIKE LINE OF ct_data.

    ASSIGN lo_data TO <ls_puorg>.

    IF lines( ct_data ) EQ 1.

      LOOP AT ct_data ASSIGNING <ls_puorg>.

        ASSIGN COMPONENT 'COMPANY' OF STRUCTURE <ls_puorg> TO FIELD-SYMBOL(<lv_prog>).
        ASSIGN COMPONENT 'REPRF' OF STRUCTURE <ls_puorg> TO FIELD-SYMBOL(<lv_reprf>).
*        ASSIGN COMPONENT 'KZAUT' OF STRUCTURE <ls_puorg> TO FIELD-SYMBOL(<lv_kzaut>).
*        ASSIGN COMPONENT 'NRGEW' OF STRUCTURE <ls_puorg> TO FIELD-SYMBOL(<lv_nrgew>).

        IF <lv_prog> IS NOT INITIAL AND <lv_prog> IS ASSIGNED AND <lv_reprf> IS ASSIGNED.

          <lv_reprf> = 'X'.

        ENDIF.
      ENDLOOP.
    ENDIF.

  ENDMETHOD.

Thank You :)

0
Subscribe to my newsletter

Read articles from sowmya surekha manukonda directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

sowmya surekha manukonda
sowmya surekha manukonda