ABAP - Keyword Documentation → ABAP RAP Business Objects → RAP - Behavior Definitions → RAP - BDL for Behavior Definitions → RAP - BDEF Extension → RAP - Base BDEF Extension → 

    RAP - extension

    Description


    Extends an existing RAP behavior definition of type managed or unmanaged using a BDEF extension in the RAP BDL. An existing RAP behavior definition can have one or more BDEF extensions. The number of extensions is not limited.

    Naming: BDEF extensions themselves and each single extension element should use a separate namespace to avoid naming conflicts with the original BDEF and its elements. BDEF extensions created in non-SAP and non-partner development systems should use the customer namespace prefix Z or ZZ.

    A BDEF extension can have the following components:

    Example


    The following source code shows BDEF extension DEMO_RAP_EXTENSION_1. It extends BDEF DEMO_RAP_EXTENSIBLE_ROOT. The extension contains the following components:

    • BDEF extension header
    • Entity behavior extension
    • Extension entity behavior
    extension using interface demo_rap_ext_using_interface;
    foreign entity demo_rap_factory_ACTION;
    extend behavior for GrandChildInterface
    {
      association _Children4Ext { create; with draft; }
    }

    define behavior for DEMO_RAP_EXTENSIBLE_EXT alias ExtNode
      using DEMO_RAP_EXT_USING_INT_EXT
    persistent table demo_ggchl_ex_ba
    draft table demo_ggrch_ext
    etag master Timestamp
    ( lock, authorization ) dependent
    {
      update;
      delete;
      field ( readonly )
      KeyField, KeyFieldchild, Keyfieldgrchld;

      field ( readonly : update ) Keyfieldggchld;
      field ( readonly ) Timestamp;

      association _parent { with draft; }
      association _Sibling4 { with draft; }
      ancestor association _GrandParent2 { with draft; }
      ancestor association _GreatGrandParent1 { with draft; }

      mapping for demo_ggchl_ex_ba
      {
        Keyfield = key_field;
        Keyfieldchild = key_field_child;
        Keyfieldgrchld = key_field_grchld;
        Keyfieldggchld = key_field_ggchld;
        Datafield = data_field;
        Charfield = char_field;
        Timestamp = timestamp;
      }
    }

    Continue