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_text2_message(
EXPORTING
iv_message_text = ‘Please Maintain Notes, It’s Mandatory !!!’.
iv_message_type = ‘E’ ) to et_message.
ENDIF.
ENDIF.
Thank You,
Sandeep Suggu.
SAP Community Profile | SAP Profile | LinkedIn
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_text2_message(
EXPORTING
iv_message_text = ‘Please Maintain Notes, It’s Mandatory !!!’.
iv_message_type = ‘E’ ) to et_message.
ENDIF.
ENDIF. Thank You, Sandeep Suggu.SAP Community Profile | SAP Profile | LinkedIn Read More Technology Blog Posts by Members articles
#SAP
#SAPTechnologyblog