SAP MDG · VALIDATION DERIVATION

How do I implement an SAP MDG `CHECK_EDITION` validation in BAdI `USMD_RULE_SERVICE`?

Implement `IF_EX_USMD_RULE_SERVICE~CHECK_EDITION` when you need edition-based validation in SAP MDG. In the retrieved example the method is intentionally left empty, so the practical answer is to create the BAdI implementation in SE19 and place your edition-specific checks in this hook if your process actually uses edition logic.

Implement `IF_EX_USMD_RULE_SERVICE~CHECK_EDITION` when you need edition-based validation in SAP MDG. In the retrieved example the method is intentionally left empty, so the practical answer is to create the BAdI implementation in SE19 and place your edition-specific checks in this hook if your process actually uses edition logic.

`IF_EX_USMD_RULE_SERVICE~CHECK_EDITION` is the SAP MDG edition validation hook in BAdI `USMD_RULE_SERVICE`. In the retrieved sample, the method is intentionally empty, which means the framework hook is kept for compatibility and you add logic only if your process has edition-specific checks. The usual implementation flow starts with SE18 to inspect the BAdI definition and SE19 to create the implementation and assign the class.

Process flow

  1. Open `SE18` and display the BAdI definition `USMD_RULE_SERVICE`.
  2. Verify the interface name `IF_EX_USMD_RULE_SERVICE` and the method intent.
  3. Open `SE19` and create the BAdI implementation.
  4. Enter the implementation name, short text, package, and transport request.
  5. Assign or create the implementing class and implement `IF_EX_USMD_RULE_SERVICE`.
  6. Add edition-specific validation logic in `CHECK_EDITION` if your process uses editions.
  7. Activate the class first, then the BAdI implementation, then dependent objects.

Referenced tables

ObjectPurpose
USMD_S_MESSAGEMessage structure used to return validation results from MDG rule-service methods.

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 edition-based validation logic in SAP MDG?
  • What is the purpose of `IF_EX_USMD_RULE_SERVICE~CHECK_EDITION`?
  • How do I activate a `CHECK_EDITION` BAdI implementation in MDG?

Possible questions

  • How do I implement an SAP MDG `CHECK_EDITION` validation in BAdI `USMD_RULE_SERVICE`?
  • How do I add edition-based validation logic in SAP MDG?
  • What is the purpose of `IF_EX_USMD_RULE_SERVICE~CHECK_EDITION`?
  • How do I activate a `CHECK_EDITION` BAdI implementation in MDG?
  • Which transaction codes are used to create and maintain the BAdI implementation?
  • What sample ABAP code should I use for an edition check?

Keywords

SAP MDGUSMD_RULE_SERVICEIF_EX_USMD_RULE_SERVICECHECK_EDITIONSE18SE19validationeditionBAdI