SAP MDG · DATA MODEL UI

How do I create and use a custom MDG BP access handler class in SAP MDG?

Create a custom BP access handler by inheriting from CL_MDG_BS_ECC_HANDLER, implementing IF_MDG_BS_BP_ACCESS_HANDLER, and registering the class in the MDG BP handler customizing so MDG can call it during read, map, and save processing.

Create a custom BP access handler by inheriting from CL_MDG_BS_ECC_HANDLER, implementing IF_MDG_BS_BP_ACCESS_HANDLER, and registering the class in the MDG BP handler customizing so MDG can call it during read, map, and save processing.

In SAP MDG BP processing, a custom access handler is the bridge between the staging area and the active ECC/CVI payload. The handler implements IF_MDG_BS_BP_ACCESS_HANDLER, inherits from CL_MDG_BS_ECC_HANDLER, and is registered so the standard MDG BP flow can call it for your custom entities and tables.

Process flow

  1. Identify the custom BP requirement.
  2. Choose the BP/application layer and use CL_MDG_BS_ECC_HANDLER.
  3. Create the Z class in SE24.
  4. Implement IF_MDG_BS_BP_ACCESS_HANDLER.
  5. Redefine the needed handler methods.
  6. Gate logic by iv_entity.
  7. Read DB state into gt_ecc_extern_db.
  8. Map data to staging structures and ECC extern structures with the standard API objects and task constants from the base class.

Referenced tables

ObjectPurpose
gt_ecc_extern_dbProtected in-memory buffer holding ECC-extern BP data and custom entity state during handler processing.
ZMDG_BP_ZNPSCDUPCustom table for the NPS duplicate-flag example.
ZMDG_T_IDPLBPTAXCustom table for the VAT/payment-type example.
IDPL_BP_TAXStandard/custom tax-related persistence object used in the VAT/payment-type example.

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

Related questions and keywords

Alternative questions

  • What is an MDG BP access handler?
  • Which interface must an MDG BP handler implement?
  • Which superclass should I use for an MDG BP access handler?

Possible questions

  • How do I build a custom BP access handler for custom entities?
  • How does ZCL_MDG_BS_ECC_HANDLER fit into the MDG BP save flow?
  • How are staging data and ECC extern data mapped in an MDG BP handler?
  • Which methods are called in IF_MDG_BS_BP_ACCESS_HANDLER?
  • How do I persist custom BP tables from an access handler?

Keywords

SAP MDGMDG-BPIF_MDG_BS_BP_ACCESS_HANDLERCL_MDG_BS_ECC_HANDLERaccess handlercustom entitystaging areaECC extern APICVIS_EI_EXTERNMDG_BS_BP_S_ECC_EXTERNgt_ecc_extern_dbZCL_MDG_BS_ECC_HANDLERZCL_MDG_BP_VAT_PAY_HANDLER