SAP MDG · MDG FINANCE

How do I create a GL Account change request in SAP MDG-F programmatically using the standard governance API?

Use the standard MDG governance API for model 0G: get the API instance, create the change request, write ACCOUNT and ACCCCDET data, check/save/dequeue, then start the workflow. Keep CR type, edition, and optional workflow step/action as runtime parameters.

Use the standard MDG governance API for model 0G: get the API instance, create the change request, write ACCOUNT and ACCCCDET data, check/save/dequeue, then start the workflow. Keep CR type, edition, and optional workflow step/action as runtime parameters.

Use the standard MDG governance API for model `0G`: create the CR, fill the `ACCOUNT` (A-segment) and `ACCCCDET` (B-segment) entities, validate, save, release locks, and start workflow. The sample below is client-agnostic: CR type, edition, and optional workflow step/action are parameters, while chart of accounts and company code come from the input rows.

Process flow

  1. Get the MDG governance API instance for model `0G`.
  2. Create data references for entities `ACCOUNT` and `ACCCCDET` with key and key+attr structures.
  3. Create the change request with CR type, description, and edition.
  4. Loop over input rows and populate `COA`, `ACCOUNT`, and the relevant attributes.
  5. For each entity, enqueue the keys and write the data.
  6. Call `CHECK_CREQUEST_DATA` and read messages.
  7. Call `SAVE`, then `DEQUEUE_CREQUEST`, then `COMMIT WORK AND WAIT`.
  8. Call `START_WORKFLOW`, then `COMMIT WORK AND WAIT`. If required, read the workflow work item and complete the first step with the supplied action.

MDG customizing for the CR type used by your scenario

Maintain the CR type that determines create/change/mass behavior and the workflow decision table values

Rule-based-workflow decision table for the CR type

Derive the workflow step and action if you want to auto-advance the first workflow step

Referenced tables

ObjectPurpose
ACCOUNTA-segment entity for GL account at chart-of-accounts level
ACCCCDETB-segment entity for GL account at company-code level

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

Related questions and keywords

Alternative questions

  • How do I write the ACCOUNT and ACCCCDET entities for a GL Account CR in model 0G?
  • What is the standard ABAP pattern to create and submit a GL Account change request in MDG-F?
  • How do I start the workflow after creating a GL Account change request in MDG?

Possible questions

  • How do I create a GL Account change request in SAP MDG-F programmatically using the standard governance API?
  • Which entities are required for a GL Account CR in model 0G?
  • How do I write both the A-segment and B-segment for a GL Account CR?
  • How do I optionally auto-advance the first workflow step after CR creation?
  • What are the standard API calls for create, write, check, save, and workflow start in MDG?

Keywords

SAP MDGMDG-F0GGL AccountChange RequestIF_USMD_GOV_APICL_USMD_GOV_APIACCOUNTACCCCDETworkflow