Get Example source ABAP code based on a different SAP table
• REPEATABLE ABAP_BDL_BODY
ABAP_RAP - repeatable>
ABAP_SYNTAX ... repeatable ...>
What does it do? Defines a non-factory RAP action> or a RAP function> as repeatable RAP BO operation>. A repeatable RAP BO operation can be executed multiple times on the same RAP BO entity instance> within the same ABAP EML> or OData > request. The BDEF derived type> of a repeatable RAP BO operation contains a %cid> > component and the RAP response parameters> are filled for each execution individually. Regarding actions, only non-factory, instance-bound RAP actions can be declared as repeatable>. Other kinds of RAP actions must not be declared as repeatable for the following reasons:
RAP factory actions> are always repeatable and an explicit declaration is not necessary. The BDEF derived type of a RAP factory action contains the %cid> component and multiple executions are possible.
Static RAP actions are always repeatable and an explicit declaration is not necessary. Static RAP actions are identified by means of a %cid > component and multiple executions are possible.
Draft actions must not be executed multiple times on the same RAP draft instance> within one request. This is not useful and not supported. The same rules apply and the same RAP BDL operation additions > are available as for non-factory actions, see topic TITLE >. There is only one exception: the syntax addition static> is not available for repeatable actions. Regarding functions, only instance-bound functions can be declared as repeatable>. Static RAP functions are always repeatable and they are identified by means of a %cid > component. Therefore, an explicit declaration of the repeatable characteristic is not required and not supported. The same rules apply and the same RAP BDL operation additions> are available as for functions, see topic TITLE >. There is only one exception: the syntax addition static> is not available for repeatable functions.
ABAP_AVAILABILITY
Managed RAP BO>
Unmanaged RAP BO>
Projection BO>: Reuse of repeatable RAP BO operations as well as definition of new repeatable RAP BO operations. For details on reuse, see topic TITLE >. For details on action definition, see topic TITLE >.
BDEF extensions> ABAP_AVAILABILITY_END
Latest notes: When executing a RAP repeatable action or function, a %cid> must be provided. NON_V5_HINTS ABAP_HINT_END
ABAP_FURTHER_INFO
Development guide for the ABAP RESTful Application Programming Model, section about Actions>.
Development guide for the ABAP RESTful Application Programming Model, section about Functions>.
ABAP_EXAMPLE_VX5 The following example shows a managed BDEF with multiple actions and functions. ABAP_NOTE This example is intentionally kept short and simple and focuses on specific RAP aspects. It does not fully meet the requirements of the RAP BO contract>. BDEF DEMO_RAP_REPEATABLE_ACTION The BDEF derived type of the non-factory instance-bound action Action> does not have a %cid> component. It looks as follows: IMAGE derived_type_action.jpg 424 48 The BDEF derived type of the repeatable action RepeatAction> has a %cid> component. It looks as follows: IMAGE repeat_action.jpg 461 65 The non-factory instance-bound action Action> must not be executed multiple times on the same RAP BO entity instance. The following execution results in a runtime error. ABEXA 01743 The repeatable action RepeatAction> can be executed multiple times on the same RAP BO entity instance as follows: ABAP_NOTE RepeatAction> is not implemented in this example. ABEXA 01744 ABAP_EXAMPLE_END