Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
sandeep_suggu
Contributor
0 Kudos
650

Hi SCN Folks, 

Hope you guys are doing great 🙂

Note 01: This blog does not include execution screenshots.
Note 02: The entire code was developed and validated in the SANDBOX system, with results meeting expectations.

This post outlines a custom development approach in SAP Master Data Governance (MDG) to enforce mandatory entry of Notes during master data processes. The validation logic is implemented using the enhancement framework via:
BADI:USMD_RULE_SERVICE, specifically through the method CHECK_ENTITY.

This ensures that users provide the required notes, thereby improving data completeness, auditability, and compliance during master data creation and change activities.

Code:

DATA:
  lv_cr_number TYPE usmd_crequest,
  lv_crtype    TYPE usmd_crequest_type,
  lv_process   TYPE usmd_process.

DATA(lo_context) = cl_usmd_app_context=>get_context( ).

IF lo_context IS BOUND.
  CALL METHOD lo_context->get_attributes
    IMPORTING
      ev_crequest_id   = lv_cr_number
      ev_crequest_type = lv_crtype
      ev_process       = lv_process.
ENDIF.

IF lv_crtype EQ 'ZSUCRTYPE'.
  DATA(lv_s_notes) = cl_usmd_conv_som_gov_api=>get_instance( )->get_notes( ).
       IF lv_s_notes IS INITIAL.
          APPEND cl_usmd_message=>convert_text2message(
          EXPORTING
          iv_message_text = 'Please Maintain Notes, It''s Mandatory !!!'.
          iv_message_type = 'E' ) to et_message.
       ENDIF.
ENDIF.

 

SAP S/4HANA SAP Master Data Governance ABAP Development 

Thank You, 
Sandeep Suggu.
SAP Community Profile | SAP Profile | LinkedIn  

5 Comments
Sandra_Rossi
Active Contributor

Several syntax errors: convert_text2_message doesn't exist but convert_text2message exists, the quote should be doubled for "it's", the dot after !!! should be removed, like this:

      APPEND cl_usmd_message=>convert_text2message(
          iv_message_text = 'Please Maintain Notes, It''s Mandatory !!!'
          iv_message_type = 'E' ) TO et_message.

 

AbdulM
Explorer

There is a configurable approach which you could have taken which can make it a easy solution without need of coding.

sandeep_suggu
Contributor
0 Kudos

@AbdulM 

There are several ways; this blog is written about one of them.

sandeep_suggu
Contributor
0 Kudos

@Sandra_Rossi 

Thanks for the correction 🙂

Sandra_Rossi
Active Contributor
0 Kudos

Still buggy, the dot after !!! should be removed.