SAP MDG · ABAP FOUNDATIONS

How do you use ABAP EML to create, update, delete, read, and execute actions on a managed RAP business object with external numbering?

Use ABAP EML against the managed RAP business object's behavior definition, supply externally assigned keys, explicitly select the fields to change, and use content-ID references for related operations on newly created instances. Inspect interaction responses and save-sequence responses separately. The supplied example demonstrates CRUD, actions, parent–child operations, and reads using customer-namespace demo objects.

Use ABAP EML against the managed RAP business object's behavior definition, supply externally assigned keys, explicitly select the fields to change, and use content-ID references for related operations on newly created instances. Inspect interaction responses and save-sequence responses separately. The supplied example demonstrates CRUD, actions, parent–child operations, and reads using customer-namespace demo objects.

ABAP EML lets an ABAP consumer work through a managed RAP business object's behavior rather than directly updating its database tables. With external numbering, the consumer supplies the business keys when creating instances.

The supplied example uses a root entity and a composed child entity. It demonstrates standard create, update, delete, and read operations, a custom action, parent–child creation, and response handling. The behavior definition determines the available operations and the behavior pool implements the required custom behavior.

Before running the example in ADT, activate its provider dependencies and use an isolated demonstration environment: the original consumer's class constructor deletes the contents of both demonstration persistence tables.

Process flow

  1. Activate the managed RAP provider, its CDS composition model, behavior definition, behavior pool, and persistence dependencies in ADT.
  2. Review the original consumer's destructive initialization before running it with F9.
  3. Supply valid external business keys and unique content IDs for create requests.
  4. Select changed fields with a FIELDS list or explicit field-control flags.
  5. Use create-by-association and content-ID references for a new root and its children.
  6. Implement update, delete, and custom action requests using the operations exposed by the behavior definition.
  7. Inspect interaction responses and apply an explicit transaction failure policy.
  8. Commit from the external consumer and inspect save responses and the immediate return code separately from interaction responses.

Referenced tables

ObjectPurpose
zdemo_abap_rapt1Customer-namespace demonstration root persistence table. The original consumer clears, seeds, and displays it.
zdemo_abap_rapt2Customer-namespace demonstration child persistence table. The original consumer clears and displays it.

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

Related questions and keywords

Alternative questions

  • How do you implement an ABAP consumer for a managed RAP business object?
  • How do you create parent and child records together using RAP EML?
  • How do you handle field control, validations, and save errors in ABAP EML?

Possible questions

  • Why is a field value ignored during an EML create or update?
  • What is the difference between %cid and %cid_ref?
  • How do you handle FAILED and REPORTED responses?
  • When should an external RAP consumer call COMMIT ENTITIES?
  • How do you debug an EML action or create-by-association request?
  • Can this RAP example replace SAP MDG change request processing?

Keywords

ABAPRAPEntity Manipulation LanguageEMLmanaged business objectexternal numberingdeep createcreate by associationfield controlCOMMIT ENTITIESRAP validationRAP actionADTzcl_demo_abap_rap_ext_num_mzdemo_abap_rap_ro_m