SAP MDG · MDG FINANCE

How do I create a GL account change request programmatically in SAP MDG-F model 0G?

Use `CL_USMD_GOV_API` for model `0G`, create a CR with the correct client-specific CR type, write `ACCOUNT` for the chart-of-accounts segment and `ACCCCDET` for the company-code segment, then check, save, dequeue, and start the workflow.

Use `CL_USMD_GOV_API` for model `0G`, create a CR with the correct client-specific CR type, write `ACCOUNT` for the chart-of-accounts segment and `ACCCCDET` for the company-code segment, then check, save, dequeue, and start the workflow.

Use the standard MDG governance API on model `0G`: create the request, build the entity structures, lock and write `ACCOUNT` and `ACCCCDET`, then validate, save, dequeue, and start workflow. The GL account pattern is the same across the source examples; the main variables are the CR type, edition, and optional workflow step/action.

Process flow

  1. Get the governance API instance for model `0G`
  2. Create data references for `ACCOUNT` and `ACCCCDET` using `gc_struct_key` and `gc_struct_key_attr`
  3. Create the change request with the correct CR type, description, and edition
  4. Build the key and key+attribute tables from your input data
  5. Lock each entity with `enqueue_entity` using lock mode `E` and scope `1`
  6. Write the entity data with `write_entity`
  7. Run `check_crequest_data` and collect messages
  8. Call `save` to persist the CR data in the governance layer","Call `dequeue_crequest` and execute `COMMIT WORK AND WAIT`","Call `start_workflow` for the created CR and commit again","Optional: call `cl_usmd_wf_service->complete_crequest_wfkw

Referenced tables

ObjectPurpose
ACCOUNTGL account master data at chart-of-accounts level (A-segment), key `COA` + `ACCOUNT`.
ACCCCDETGL account master data at company-code level (B-segment), key `COA` + `ACCOUNT` + `COMPCODE`.
FSIFinancial statement item entity used by successor CR logic, not by a normal create request.

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

Related questions and keywords

Alternative questions

  • What is the standard ABAP flow to create a GL Account CR in MDG-F?
  • Which MDG API, entities, and steps are used for a GL Account change request?
  • How do I write ACCOUNT and ACCCCDET data into an MDG-F change request?

Possible questions

  • How do I create a GL account change request programmatically in SAP MDG-F model 0G?
  • Which MDG API and entities are used for GL account CR creation?
  • What is the ABAP flow to create and submit a GL account CR in model 0G?
  • How do I extend a GL account company-code segment in MDG-F?
  • How do I adapt the same MDG-F change-request pattern for create vs change scenarios?

Keywords

SAP MDGMDG-Fmodel 0GGL accountchange requestCL_USMD_GOV_APIACCOUNTACCCCDETFSIstart_workflowUSMD_CREQUEST_INTEGRATION