cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Validation of supplier in SAP MDG

lakshmi01
Discoverer
0 Kudos
207

Hi Guys,

I want to get the warning message for supplier if more than one bank account is added in bank accounts entity. But I'm getting warning message after entering Bank country/Region, Bank key of second bank account.

Please find below code for the same:

DATA : lv_row_index     TYPE i VALUE 0.


    cl_usmd_app_context=>get_context( )->get_attributes(
                  IMPORTING
                    ev_crequest_id = DATA(lv_cr_num6)                     "CR Number
                    ev_crequest_type  = DATA(lv_cr_type6)                 " Type of Change Request
                ).
    IF lv_cr_type6 = 'ZSUPP1' OR lv_cr_type6 = 'ZSUPP2'.

      IF id_entitytype = 'BP_BKDTL'.
        LOOP AT it_data ASSIGNING FIELD-SYMBOL(<fs_data>).
          IF <fs_data> IS ASSIGNED.
            lv_row_index = lv_row_index + 1.
          ENDIF.
          IF lv_row_index > 1.
            message-msgid = 'ZMDG'.
            message-msgty = 'W'.
            message-msgno = '008'.
            APPEND message TO et_message.
          ENDIF.
        ENDLOOP.

      ENDIF.
    ENDIF.

lakshmi01_0-1728097401096.png

Anyone please suggest which code changes should i need to do for getting warning message without entering Bank country/region, bank key for second bank details id.

Accepted Solutions (0)

Answers (0)