What does it do? Defines a RAP save action>. RAP save actions are RAP actions> that can only be called during a specified RAP saver method> in the RAP save sequence>. Any call during the RAP interaction phase> leads to a short dump>. Save actions are characterized by the syntax addition save >. The name of the RAP saver method > during which the action can be executed is specified in brackets. finalize>, adjustnumbers>, or both can be specified in brackets to indicate the saver method during which the action can be called. Non-factory actions> and factory actions> (instance-bound and static) can be defined as save action. A default factory action, however, cannot be a save action. The respective syntax rules of the kind of action apply (non-factory, static factory, instance-bound factory). The following RAP BDL operation additions > are allowed for save actions:
internal>> to make the respective action accessible only from within the business object implementation.
Global feature control with (features:global)>> enables or disables the action depending on BO-external preconditions.
precheck>> prevents unwanted changes from reaching the application buffer.
authorization:none>> excludes the operation in question from authorization checks>.
Input parameters InputParameter> > and output parameters OutputParameter> > can optionally be added to the action signature.
Calling RAP Save Actions A RAP save action can be called in the following contexts:
From an external RAP BO consumer>.
In the ABAP behavior pool>, from a finalize>> or adjust_numbers>> RAP saver method, according to the specification in brackets.
A save(finalize)> action can be called from the implementation of a RAP determination> on save>. ABAP_NOTE This does not apply to save(adjustnumbers)> actions. save(adjustnumbers)> actions must not be called in determinations on save>. Any attempt to do so results in a short dump. ABAP_CAUTION If a determination on save> is executed as part of a RAP BO determine action>, the execution takes place during the interaction phase. Therefore, if a RAP save action is called in a determination on save> and the determination is executed as part of a determine action, a short dump occurs. RAP save actions must not be called in the following contexts:
A RAP saver method other than the one specified in brackets. For example, a save(finalize)> action must not be called during the RAP saver method adjust_numbers>. Any attempt to do so leads to a syntax check error.
In the implementation of a RAP determination> on modify>. If this is done, a short dump occurs.
If called from the implementation of any other RAP handler method>, a short dump occurs. ABAP_NOTE Save actions cannot be called from other save actions of the same saver method. For example, a save(adjustnumber)> cannot call another save(adjustnumber)> action. Any attempt to do so results in a short dump.
ABAP_AVAILABILITY
Managed RAP BO>
Unmanaged RAP BO>
Base BDEF extensions>.
Not available in BDEFs of any other implementation type. ABAP_AVAILABILITY_END
Latest notes:
Save actions without a RAP saver method specification are obsolete. The following syntax is not valid: save action MySaveAction>. Existing save actions that do not specify a RAP saver method in brackets are automatically interpreted as save(finalize)>.
RAP save actions are required for the RAP representation of certain existing functionality which does not maintain a transactional buffer> but (from a RAP perspective) only has a save phase. NON_V5_HINTS ABAP_HINT_END
ABAP_FURTHER_INFO Development guide for the ABAP RESTful Application Programming Model, section about Actions>.
ABAP_EXAMPLE_VX5 - 1: Valid Calls of RAP Save Actions The following example shows an unmanaged BDEF with four save actions. 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_SAVE_ACTION_U The save actions are implemented in behavior pool BP_DEMO_RAP_SAVE_ACTION_U>>. The following calls are valid:
The save(finalize) action A1> can be called from an external EML consumer as demonstrated in the following code snippet: ABEXA 01740
The save(finalize) action A1> can be called from the RAP saver method finalize> as follows: METH BP_DEMO_RAP_SAVE_ACTION_U(CCIMP)=>FINALIZE
The save(finalize) action A1> can be called from the implementation of a determination on save> from another RAP BO, namely, DEMO_RAP_SAVE_ACTION_M>>. METH BP_DEMO_RAP_SAVE_ACTION_M(CCIMP)=>DET_ON_SAVE ABAP_EXAMPLE_END
ABAP_EXAMPLE_VX5 - 2: Invalid Call of a RAP Save Action The following example shows a RAP save action that is executed in an invalid context and leads to a short dump. 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_SAVE_ACTION_M The determination det_on_save1> calls the save(finalize)> action A4>. The implementation looks as follows: METH BP_DEMO_RAP_SAVE_ACTION_M(CCIMP)=>DET_ON_SAVE1 If executed, the determine action TriggerAll> executes the determination det_on_save1> during the RAP interaction phase. The determination det_on_save1> then calls the save(finalize)> action A4>. This is an invalid call and a short dump occurs. ABEXA 01742 ABAP_EXAMPLE_END