Quantcast
Viewing all articles
Browse latest Browse all 249

BOPF Modify a node with a node type "Business Object Representation Node"

Hello,

 

the standard PDF "Root Cause Investigation" (EHHSS_INC_AIF_INV_ROOTCAUSE) has a section with "Planned action to Prevent Future Incident' and when this PDF goes to SAP...It modifies the incident. SAP did not code the section "Planned action..." which refer to the tab 'Task' in the incident...we opened an OSS message but SAP said it is delivered like that....

 

The PDF use the BOPF with business object EHHSS_INCIDENT and there is a "Business Object Representation Node" for EHHSS_INCIDENT_ACTION. I need to add an action(BO EHHSS_INCIDENT_ACTION) to the incident(BO EHHSS_INCIDENT) in the method "STORE_DATA" of the inbound persister CL_EHHSS_INC_AIF_INV_ROOTC_INB.

 

Image may be NSFW.
Clik here to view.
node.JPG

When I executed this code...I get a short dump and I think the problem is the association but I am new to BOPF...Can someone help me to get through this please?

 

 

   FIELD-SYMBOLS: <ls_mod> LIKE LINE OF lt_mod.

   DATA: lr_s_root TYPE REF TO ehfnds_act_root,

            mo_svc_mngr TYPE REF TO /bobf/if_tra_service_manager.

             lo_change      TYPE REF TO /bobf/if_tra_change.         
             lo_message   TYPE REF TO /bobf/if_frw_message.

      "Obtain a reference to the BOPF service manager:
    mo_svc_mngr =
      /bobf/cl_tra_serv_mgr_factory=>get_service_manager(
        if_ehhss_inc_c=>sc_bo_key ).

    CREATE DATA lr_s_root.

    lr_s_root->key = /bobf/cl_frw_factory=>get_new_key( ).
    lr_s_root->root_key_ref = ls_inc_root-db_key.                     "Key of the current incident
    lr_s_root->node_key_ref = /bobf/cl_frw_factory=>get_new_key( ).
    lr_s_root->bo_key_ref = if_ehhss_inc_c=>sc_bo_key.         "BO Incident key
    lr_s_root->category = '001'. "  Action
    lr_s_root->priority = '5'.   "  Normal
    lr_s_root->purpose = 'INC_ACTION'"  Incident Action
    lr_s_root->ehsm_component = 'HSS'.
    lr_s_root->variant = 'STANDARD'.

    lr_s_root->status = if_ehfnd_bo_status_c=>gc_transaction-new"'01'. "  New
    lr_s_root->title  = 'test'.
    lr_s_root->resp_id = 'USER123'.
    lr_s_root->implem_id = 'USER123'.
    lr_s_root->appr_id = 'USER123'.
    lr_s_root->due_timestamp = '20140418'.

    GET TIME STAMP FIELD lv_cur_timestmp.        
    lr_s_root->datetime_cr = lv_cur_timestmp.   
    lr_s_root->datetime_ch = lv_cur_timestmp.   


    APPEND INITIAL LINE TO lt_mod ASSIGNING <ls_mod>.
    <ls_mod>-node        = if_ehhss_iac_c=>sc_node-root.          "Incident action
    <ls_mod>-change_mode = /bobf/if_frw_c=>sc_modify_create.
    <ls_mod>-source_node = if_ehhss_inc_c=>sc_node-root.      "Incident
    <ls_mod>-association = if_ehhss_inc_c=>sc_association-root-ehhss_incident_action.
    <ls_mod>-source_key  = ls_inc_root-db_key.                       "Incident
    <ls_mod>-key         = lr_s_root->key.
    <ls_mod>-data        = lr_s_root.
   
    CALL METHOD mo_svc_mngr->modify
      EXPORTING
        it_modification = lt_mod
      IMPORTING
        eo_change       = lo_change
        eo_message      = lo_message.

 

Thank you!

 

 

Marie-Josée


Viewing all articles
Browse latest Browse all 249

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>