SAP MDG · VALIDATION DERIVATION

How do I implement SAP MDG DERIVE_ENTITY logic in USMD_RULE_SERVICE for a change-request-type-gated derivation scenario?

Implement the BAdI USMD_RULE_SERVICE in SE19, assign the implementing class, and use IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY to default only initial fields in CT_DATA based on CR type and entity type. The retrieved pattern shows a placeholder CASE on the change request type, with the actual derivation call currently commented out until business sign-off.

Implement the BAdI USMD_RULE_SERVICE in SE19, assign the implementing class, and use IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY to default only initial fields in CT_DATA based on CR type and entity type. The retrieved pattern shows a placeholder CASE on the change request type, with the actual derivation call currently commented out until business sign-off.

Implement the BAdI implementation in SE19 for USMD_RULE_SERVICE, bind it to a Z* class, and use IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY as a deterministic defaulting hook. The sample pattern reads the change-request type through ZCL_MDG_SUPPL_UTILITY=>GET_CR_DETAILS, prepares a CASE on the CR type, and then routes to the BP/vendor derivation method when business approval allows activation.

Process flow

  1. Open SE18 and inspect BAdI USMD_RULE_SERVICE.
  2. Create or open the implementation in SE19.
  3. Assign the implementing class and activate it.
  4. Implement IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY.
  5. Read CR type once using ZCL_MDG_SUPPL_UTILITY=>GET_CR_DETAILS.
  6. Branch by CR type and entity type.
  7. Call the derivation helper only for the supported scenarios.
  8. Populate CT_DATA only for initial target fields when business rules allow it.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1METHOD if_ex_usmd_rule_service~derive_entity. 2 DATA: lv_crequest_type TYPE usmd_crequest_type. 3 4 zcl_mdg_suppl_utility=>get_cr_details( 5 IMPORTING 6 ev_crequest_type = lv_crequest_type ). 7 8 " Placeholder pattern: branch structure prepared, 9 " derivation calls intentionally disabled until business sign-off. 10* CASE lv_crequest_type. 11* WHEN zif_bp_constants=>creq_type-zsupl1p1 OR 12* zif_bp_constants=>creq_type-zsupl4p1. 13* zcl_mdgbp_bp_defaults=>zif_te_derivation~d_bp_venval( 14* EXPORTING 15* io_model = io_model 16* id_edition = id_edition 17* id_entitytype = id_entitytype 18* id_crequest_type = lv_crequest_type 19* IMPORTING 20* et_message = et_message 21* CHANGING 22* ct_data = ct_data ). 23* ENDCASE. 24ENDMETHOD.

The remaining configuration, implementation details, and testing guidance continue from this answer more…

Related questions and keywords

Alternative questions

  • How do I activate the real derivation behind a placeholder DERIVE_ENTITY implementation in SAP MDG?
  • What is the correct SE18/SE19 setup and ABAP pattern for USMD_RULE_SERVICE~DERIVE_ENTITY?
  • How do I branch derivation by change request type in an MDG BAdI implementation?

Possible questions

  • How do I implement a DERIVE_ENTITY BAdI in SAP MDG?
  • How do I create a USMD_RULE_SERVICE implementation in SE19?
  • How do I default fields in MDG based on change request type?
  • How do I write ABAP for IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY?
  • How do I move from a commented derivation scaffold to a live implementation?

Keywords

SAP MDGUSMD_RULE_SERVICEIF_EX_USMD_RULE_SERVICEDERIVE_ENTITYSE18SE19change request typeCR typeCT_DATAET_MESSAGEZCL_MDGBP_BP_DEFAULTSZCL_MDG_SUPPL_UTILITY