SAP MDG · VALIDATION DERIVATION
How do I implement SAP MDG validation in IF_EX_USMD_RULE_SERVICE~CHECK_CREQUEST_START?
Implement the change-request start logic in BAdI USMD_RULE_SERVICE by coding IF_EX_USMD_RULE_SERVICE~CHECK_CREQUEST_START in your Z-class. The retrieved example shows the hook can remain intentionally empty; if you need real logic, use the SE18/SE19 BAdI setup guide and place business checks here only when you want to validate the change request at start.
Implement the change-request start logic in BAdI USMD_RULE_SERVICE by coding IF_EX_USMD_RULE_SERVICE~CHECK_CREQUEST_START in your Z-class. The retrieved example shows the hook can remain intentionally empty; if you need real logic, use the SE18/SE19 BAdI setup guide and place business checks here only when you want to validate the change request at start.
Implement the change-request start check in BAdI USMD_RULE_SERVICE by coding IF_EX_USMD_RULE_SERVICE~CHECK_CREQUEST_START in your implementation class. The provided example shows that this hook may be left empty when no start-level validation is required, but when you do need logic you should create the BAdI in SE19, assign the implementing class, and add your CR-level checks in this method.
Process flow
- Open SE18 and display BAdI definition
USMD_RULE_SERVICE. - Open SE19 and create or change the BAdI implementation.
- Assign the implementing Z-class that implements IF_EX_USMD_RULE_SERVICE.
- Implement IF_EX_USMD_RULE_SERVICE~CHECK_CREQUEST_START.
- Add CR-level validation logic if needed; otherwise keep the hook empty.
- Activate the class and the BAdI implementation.
- Trigger the relevant MDG change request and debug the method call.
ILLUSTRATIVE ABAP SAMPLE
Source ABAP implementation example
Concrete CHECK_ENTITY implementation pattern from the same knowledge document set.
1METHOD if_ex_usmd_rule_service~check_entity.
2 DATA: lo_app_context TYPE REF TO if_usmd_app_context,
3 lt_message TYPE usmd_t_message,
4 ls_message TYPE usmd_s_message,
5 lv_crtype TYPE usmd_crequest_type,
6 lv_crstep TYPE usmd_crequest_appstep,
7 lv_crid TYPE usmd_crequest.
8
9 FIELD-SYMBOLS: <ls_data> TYPE any,
10 <lv_value> TYPE any.
11
12 lo_app_context = cl_usmd_app_context=>get_context( ).
13 CHECK lo_app_context IS BOUND.
14 CHECK io_model->d_usmd_model = 'BP'.
15
16 lo_app_context->get_attributes(
17 IMPORTING
18 ev_crequest_type = lv_crtype
19 ev_crequest_step = lv_crstep
20 ev_crequest_id = lv_crid ).
21
22 CHECK it_data IS NOT INITIAL.
23
24 LOOP AT it_data ASSIGNING <ls_data>.
25 ASSIGN COMPONENT 'SOME_MAND_FIELD' OF STRUCTURE <ls_data> TO <lv_value>.
26 IF <lv_value> IS ASSIGNED AND <lv_value> IS INITIAL.
27 CLEAR ls_message.
28 ls_message-msgid = 'ZMDG_SUPPL'.
29 ls_message-msgno = '001'.
30 ls_message-msgty = 'E'.
31 ls_message-fieldname = 'SOME_MAND_FIELD'.
32 APPEND ls_message TO et_message.
33 ENDIF.
34 ENDLOOP.
35
36 IF et_message IS NOT INITIAL.
37 zcl_mdgbp_bp_validation=>adjust_messages(
38 EXPORTING
39 cr_number = lv_crid
40 CHANGING
41 ct_message = et_message ).
42 ENDIF.
43ENDMETHOD.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I add custom change-request start validation in SAP MDG?
- What is the implementation pattern for CHECK_CREQUEST_START in
USMD_RULE_SERVICE? - How do I write ABAP logic in the MDG BAdI method CHECK_CREQUEST_START?
Possible questions
- How do I implement SAP MDG validation in IF_EX_USMD_RULE_SERVICE~CHECK_CREQUEST_START?
- How do I add custom change-request start validation in SAP MDG?
- What is the implementation pattern for CHECK_CREQUEST_START in
USMD_RULE_SERVICE? - How do I write ABAP logic in the MDG BAdI method CHECK_CREQUEST_START?
- Which BAdI and method are used for MDG change-request start checks?