ABAP - Keyword Documentation → ABAP RAP Business Objects → RAP - Behavior Definitions → RAP - BDL for Behavior Definitions → RAP - Managed and Unmanaged Behavior Definitions → RAP - EntityBehaviorDefinition → RAP - EntityBehaviorBody → RAP - RAP BO Operations → RAP - Non-Standard Operations → RAP - action → RAP - action, factory → 

    RAP - Default Factory Action

    Syntax


    [internal] static default factory action
                      [(
                      [features: global] 
                      [precheck] 
                      [authorization:none] 
                      [authorization:global] 
                       )] 
                       ActionName [external 'ExternalName'] 
                      [InputParameter] 
                       [cardinality]
                      [{default function GetDefaultsForActName [external 'GetDefaultsForExtName'];}]

    Description


    Exactly one static factory action per RAP BO entity can be defined as default static factory action using the syntax addition default. The same rules apply as for factory actions, see topic RAP - action, factory.

    The addition default is evaluated by consuming frameworks, such as OData. These frameworks use the default factory action as standard action in certain scenarios.

    Possible RAP BO operation additions to default factory actions:

    Availability


    Restriction


    The specification of default factory actions in a BDEF extension is not allowed.

    Example


    The following example shows a managed BDEF which defines a static default factory action:

    managed
    implementation in class bp_demo_rap_default_factory_a unique;
    strict ( 2 );

    define behavior for DEMO_RAP_DEFAULT_FACTORY_A alias Root
    persistent table demo_dbtab_root
    lock master
    authorization master ( global )
    {
      create;
      update;
      delete;

      field(readonly:update) key_field;

      static default factory action sdfa [1..*];

      static factory action sfa [0..1];
    }

    The projection BDEF reuses the static default factory action from the base BDEF and specifies a new static default factory action. Consuming frameworks consider the static default factory action from the projection BDEF as default.

    projection
    implementation in class bp_demo_rap_dfa_pv unique;
    strict ( 2 );

    define behavior for DEMO_RAP_DFA_PV alias RootProjection
    {
      use create;
      use update;
      use delete;

      use action sdfa;
      use action sfa;

      static default factory action sdfa_proj [1];
    }