Skip to Content
Author's profile photo Senthil Kumar

BOPF Working on Delegated nodes


Business Object Processing Framework (BOPF) is an infrastructure available for SAP Business Suite to simplify the development process of business applications.

Many modules of SAP such as Environment, Health and Safety (EHS), Transport Management, Commercial Project Management are designed based on BOPF framework.

With this framework the developer can concentrate more on the business logic rather than the development of application infrastructure such as authorization control, buffer management etc. Also, BOPF offers seamless integration with various UI Components (FPM, UI5, OData and etc.), Infrastructure Components (Application Logging, BRF+). As a user we no need to worry about development of adapters or integration layers.

Business Object

A Business object is a hierarchical tree of nodes.

Similar to the objects in Object Oriented Programming, each Business Object has two parts:

  • Data
    • Attributes and Alternative Keys of Nodes forms the Data Part of the BO.
  • Business Logic
    • Entities associated with nodes forms the Business Logic Part of the BO.


Fig 1. Business Object


Working with Delegated nodes

Business Objects will have several common properties such as address, text collection, attachments and etc. Instead of maintaining these properties in a node of all BO separately, we can create one Dependent Business Object which can be reused by all the Business Objects during run-time.

These Dependent Object’s Root Node are linked to Delegated Node of other Business Objects i.e. Business Object within another BO. Association will exists between these BOs.

Fig 2. Delegated nodes


The Master Project BO /CPD/PFP_BO_PLAN_HEADER is the Host Object and the BO that are linked to its Delegated nodes are called as Delegated Objects.

Unlike Standard Node, the association key (which is used to retrieve data from a related node) between Delegated Node and Dependent Business Object cannot be derived directly from the Constants Interface. This is because the structure and modelling of the dependent object is not known to the Delegated node of BO until the runtime. The modeling is loaded into the Delegated node only at the run-time.

To solve this we can use the GET_CONTENT_KEY_MAPPING method from the framework Configuration reference. This method will provide the association key between two different nodes that has been generated during runtime.

Fig 3. Delegated object at Runtime


As highlighted in Figure 2, PLAN_HEADER_LONG_TEXT is a Delegated node in the Business Object /CPD/PFP_BO_PLAN_HEADER. This Node is linked to the Root node of the Dependent Business Object /BOBF/TEXT_COLLECTION.

For any CRUD operation over this node we need the Node key and association key which will be available only at the runtime. The Constants Interface for /BOBF/TEXT_COLLECTION Business Object is /BOBF/IF_TXC_C.

Fig 4. Dependent Object


From the below code we will get the Node key and Association key of the Dependent Object’s Node at run-time.

Declare and create Transaction, Service and Configuration instance for master project BO.

DATA : lr_tran_mgr  TYPE REF TO /bobf/if_tra_transaction_mgr,
       lr_serv_mgr  TYPE REF TO /bobf/if_tra_service_manager,
       lr_bo_conf   TYPE REF TO /bobf/if_frw_configuration.

*-- Transaction Manager Reference
    lr_tran_mgr = /bobf/cl_tra_trans_mgr_factory=>get_transaction_manager( ).
*-- Service Manager Reference
*--Export the Business Object Key of the Node
    lr_serv_mgr = /bobf/cl_tra_serv_mgr_factory=>get_service_manager(
      iv_bo_key = /cpd/if_mp_pws_bo_c=>sc_bo_key ).

*-- Configuration Reference
*--Export the Business Object Key of the Node
    lr_bo_conf  = /bobf/cl_frw_factory=>get_configuration(
     iv_bo_key  = /cpd/if_mp_pws_bo_c=>sc_bo_key ).

Get Node key and association key between text nodes.

*-- Node Key of TEXT node
lv_txt_key = lr_frw_conf->get_content_key_mapping( 
             iv_content_cat      = /bobf/if_conf_c=>sc_content_nod
             iv_do_content_key   = /bobf/if_txc_c=>sc_node-text
             iv_do_root_node_key = /cpd/if_pfp_bo_plan_hdr_c=>sc_node-plan_header_long_text ).

*-- Association Key of ROOT->TEXT
lv_txt_assoc = lr_frw_conf->get_content_key_mapping( 
               iv_content_cat      = /bobf/if_conf_c=>sc_content_ass
               iv_do_content_key   = /bobf/if_txc_c=>sc_association-root-text 
               iv_do_root_node_key = /cpd/if_pfp_bo_plan_hdr_c=>sc_node-plan_header_long_text ).

*-- Association Key of TEXT->TEXT_CONTENT
lv_cont_assoc = lr_frw_conf->get_content_key_mapping( 
                iv_content_cat      = /bobf/if_conf_c=>sc_content_ass
                iv_do_content_key   = /bobf/if_txc_c=>sc_association-text-text_content 
                iv_do_root_node_key = /cpd/if_pfp_bo_plan_hdr_c=>sc_node-plan_header_long_text ).


After getting the run-time Node key and Association key, we have to create BO Instances (Records for Root node, Text node, Text_Content node of Dependent BO).

lv_key is the GUID of Financial Plan.

First the Records for Root node is created and its reference is passed to lt_mod along with its Root key, Source key, Node and Association. Then the same is repeated for Text and Text_Content Node.

Get_new_key method is used to generate GUID which will be unique for all BO Instance that we create. After calling the modify method it is always necessary to call Save method to reflect all the changes that we made. Those changes will be reflected in Database. We can also check at lr_message at save and modify method whether particular action is successfully completed or not.

*-- LV_KEY is the GUID of any Financial Plan

*-- Details of Dependent Object ROOT Node
" Generate New Key
lw_root-key             = /bobf/cl_frw_factory=>get_new_key( ).
lw_root-parent_key      = lv_key.
lw_root-root_key        = lv_key.
lw_root-host_bo_key     = /cpd/if_pfp_bo_plan_hdr_c=>sc_bo_key.
lw_root-host_node_key   = /cpd/if_pfp_bo_plan_hdr_c=>sc_node-plan_header.
lw_root-host_key        = lv_key.
lw_root-text_schema_id  = 'DEMO'.
lw_root-text_exists_ind = abap_true.
GET REFERENCE OF lw_root INTO lr_root.

*-- The ROOT node and PLAN_HEADER_LONG_TEXT are one and the same. 
*-- So the Plan Header will act as Source Node as well as Root Node.
lw_mod-key          = lr_root->key.
lw_mod-source_key   = lv_key.
lw_mod-source_node  = /cpd/if_pfp_bo_plan_hdr_c=>sc_node-plan_header.
lw_mod-root_key     = lv_key.
lw_mod-node         = /cpd/if_pfp_bo_plan_hdr_c=>sc_node-plan_header_long_text.
lw_mod-association  = /cpd/if_pfp_bo_plan_hdr_c=>sc_association-plan_header-plan_header_long_text.
lw_mod-change_mode  = /bobf/if_frw_c=>sc_modify_create.
lw_mod-data         = lr_root.
APPEND lw_mod TO lt_mod.

*-- Details of Dependent Object TEXT Node
lw_text-key           = /bobf/cl_frw_factory=>get_new_key( ).
lw_text-root_key      = lw_root-key.
lw_text-parent_key    = lw_root-key.
lw_text-user_id_ch    = sy-uname.
lw_text-language_code = 'EN'.
lw_text-text_type     = 'DEMO'.
lw_text-datetime_ch   = sy-datum.
lw_text-datetime_cr   = sy-datum.
GET REFERENCE OF lw_text INTO lr_text.

lw_mod-key          = lr_text->key.
lw_mod-source_key   = lw_root-key.
lw_mod-source_node  = /cpd/if_pfp_bo_plan_hdr_c=>sc_node-plan_header_long_text.
lw_mod-root_key     = lw_root-key.
lw_mod-node         = lv_txt_key.	“ TEXT Node Key
lw_mod-association  = lv_txt_assoc.	“ ROOT -> TEXT Node Association
lw_mod-change_mode  = /bobf/if_frw_c=>sc_modify_create.
lw_mod-data         = lr_text.
APPEND lw_mod TO lt_mod.

*-- Details of Dependent Object TEXT_CONTENT Node
lw_cont-key         = /bobf/cl_frw_factory=>get_new_key( ).
lw_cont-parent_key  = lw_text-key.
lw_cont-root_key    = lw_root-key.
lw_cont-text        = 'TEXT_CREATE'.
GET REFERENCE OF lw_cont INTO lr_cont.

lw_mod-key          = lr_cont->key.
lw_mod-source_key   = lw_text-key.
lw_mod-source_node  = lv_txt_key.
lw_mod-root_key     = lw_root-key.
lw_mod-node         = lv_cont_key.	" TEXT_CONTENT Node Key
lw_mod-association  = lv_cont_assoc.	“ TEXT –> TEXT_CONTENT Association
lw_mod-change_mode  = /bobf/if_frw_c=>sc_modify_create.
lw_mod-data         = lr_cont.
APPEND lw_mod TO lt_mod.

*-- Create BO Instance for /BOBF/TEXT_COLLECTION 
    it_modification = lt_mod
    eo_change       = lr_change
    eo_message      = lr_message

*-- Save the Transaction to get reflected in DB
CLEAR : lr_change, lr_message.
    eo_change       = lr_change
    eo_message      = lr_message


This document explains basic concepts to begin work in Business Object Processing Framework. It describes the Delegated node and Dependent BO in detail. The document also elaborates the Class / Methods that are necessary to work with Business Objects. With this understanding readers can explore various options available in BOPF further.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Adrián Pérez Melchor
      Adrián Pérez Melchor

      Hi great work but a bit confussing, is it me or you are mixing the BOPF of CPM project /CPD/IF_MP_PWS_BO_C with the BOPF of plan /cpd/if_pfp_bo_plan_hdr_c.


      Thank you!


      Author's profile photo Senthil Kumar
      Senthil Kumar
      Blog Post Author

      Hi Adrian,

      Thanks for pointing out that CPM project is used instead of PFP. Yes it should be PFP only.

      DATA : lr_tran_mgr  TYPE REF TO /bobf/if_tra_transaction_mgr,
             lr_serv_mgr  TYPE REF TO /bobf/if_tra_service_manager,
             lr_frw_conf  TYPE REF TO /bobf/if_frw_configuration.
      *-- Transaction Manager Reference
          lr_tran_mgr = /bobf/cl_tra_trans_mgr_factory=>get_transaction_manager( ).
      *-- Service Manager Reference
      *--Export the Business Object Key of the Node
          lr_serv_mgr = /bobf/cl_tra_serv_mgr_factory=>get_service_manager(
            iv_bo_key = /cpd/if_pfp_bo_plan_hdr_c=>sc_bo_key ).
      *-- Configuration Reference
      *--Export the Business Object Key of the Node
          lr_frw_conf = /bobf/cl_frw_factory=>get_configuration(
           iv_bo_key  = /cpd/if_pfp_bo_plan_hdr_c=>sc_bo_key ).

      Thanks and Regards,

      Senthil kumar K

      Author's profile photo madjid khanevadegi
      madjid khanevadegi

      thank you Senthil Kumar

      for share your information ,

      in your sample code i don't understand what is the reference for these variables

      lw_root , lr_root , lw_mod , lt_mod , lw_text , lr_text , lw_cont , lr_cont

      may be share the true  and complete code


      thanks you  so much

      Author's profile photo Rafael Esquenazi Assayag
      Rafael Esquenazi Assayag

      I am looking for a programmatic way to attach documents to chemicals. It's about a task to migrate data from an old application to SAP. I have already succeeded to create new registries for business object EHFND_CHEMICAL. However, when trying to attach a document to it, the algorithm fails.

      Even having deeply studied delegated nodes (EHFND_CHEMICAL_ATF or EHFND_ATF_DOC_WITH_ATTRIBS), the maximum I get, is to establish the root-document-doc_details-chm_details hierarchy. The FILE_CONTENT is persisted in table /BOBF/ATF_CREP. I have already verified it. The "path" to reach it, however, is not that used by SAP standard application or classes to retrieve it, what turns all this process useless.

      I appreciate any tip, any cue about it.