Ansicht
Dokumentation

ABENBDL_ACTION_FACTORY - BDL ACTION FACTORY

ABENBDL_ACTION_FACTORY - BDL ACTION FACTORY

CPI1466 during Backup   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

- action, factory

$[internal$]$[static$] factory action
                  $[(
                  $[ features: ${instance $| global$}$]
                  $[precheck$]
                  $[authorization:none$]
                  $[ authorization:update$]
                  $[lock:none$]
                   )$]
                   ActionName $[external 'ExternalName'$]
                  $[InputParameter$]
                   [cardinality]


Effect

Factory actions are used to create RAP BO entity instances. Factory actions can be instance-bound (default) or static. Instance-bound factory actions can copy specific values of an instance. Static factory actions can be used to create instances with prefilled default values.

For factory actions, the same rules apply as for non-factory actions with the following differences:

  • Output parameters OutputParameter are not allowed.
Factory actions always produce one new BO entity instance with possible child entity instances. It is therefore not necessary to specify a result.
  • It is mandatory to specify a cardinality. The cardinality must always be [1] for factory actions.

The result of a factory action is returned in the response parameter MAPPED by a mapping between the BDEF derived type %cid and the key of the newly created entity instance.

Availability

Example

The following example shows a managed BDEF which defines two factory actions:

  • copy_instance: All values of the requested entity instance are copied and a new key value is assigned.
  • new_instance: A new entity instance is created with default values.

The actions are implemented in behavior pool BP_DEMO_RAP_FACTORY_ACTION. The program DEMO_RAP_FACTORY_ACTION accesses the business object using EML and executes both actions.

Result: the entity instance with key field '1' is copied and a new entity instance with default values is created.

The example above is explained in detail in the executable example CDS BDL - factory action.






BAL_S_LOG - Application Log: Log header data   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 5750 Date: 20240512 Time: 022136     sap01-206 ( 33 ms )