Business configuration content is usually not directly maintained in a productive system, but created in a development system, and then transported to the test system and productive system. As the developer of a business configuration app, you need to ensure that changes to the business configuration content is recorded onto a transport request of type Customizing and the user has the option to select the correct transport request.
With the factory class MBC_CP_API you can instantiate a transport API to validate and record entity keys of a RAP business object on a transport request.
DATA(api) = mbc_cp_api=>rap_tdat_cts( tdat_name = '/ITAPC1/CODE' table_entity_relations = VALUE #( ( entity = '/ITAPC1/I_Status' table = '/ITAPC1/STATUS' ) ( entity = '/ITAPC1/I_StatusText' table = '/ITAPC1/STATUST' ) ) ).
In the behavior implementation define an Additional Save Implementation in the header directly after the keyword managed. In the save_modified method you can record the changes on the transport request with the method record_changes of this API. Check the ABAP Doc of record_changes for more information and example implementation.
For each entity of the RAP BO define a Validation on save for create, update and delete. In the validation implementation call the method validate_changes of the API. Check the ABAP Doc of validate_changes for more information and example implementation.
The before mentioned API methods require a transport request to be passed. For the transport selection define an action with Abstract CDS Entity D_SelectCustomizingTransptReqP as the parameter. This CDS Entity returns all modifiable transport request of type Customizing where the user either owns the request or owns at least one open task. The transport request must have the attribute SAP_CUS_TRANSPORT_CATEGORY set to MANUAL_CUST or DEFAULT_CUST.
Save the result of the action in a virtual field of the draft entity. When recording or validating the changes the previously selected transport request can then be retrieved from the draft entity.
When using the ADT wizard to generate a business configuration maintenance object, you can choose No Transport for Transport Selection for an app without transport option. Suitable for configurations that are to be adjusted in the production client. For more information read this blog post.
For more information read this blog post.