Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Create Instances in the Transient Root Node and Sub Nodes from Root Node Query Method ?

Former Member
0 Kudos

Hi All,

I am Creating a BOPF BO with 3 Nodes,

Node 1) ROOT -- > contains a query,

using Root Node I have created Search UIBB Configuration in FBI.

In testing -- > when i enter Data in the Search Criteria Fields am able to get the details in to the query method

from Imporing parameter : 'IT_SELECTION_PARAMETERS'.

HERE I am fetching data from a standard table and trying to fill the data in the Node : 'MNR_SEARCH_RESULT'.

How to Append data to the Sub node 'MNR_SEARCH_RESULT' when there is no Node instance created in the ROOT Node ?

For This  I have created an instance in the ROOT Node and Using that I tried to create Instance in the Sub Node 'MNR_SEARCH_RESULT'.

Below is my code which i have placed in the Query method ..

DATA : LR_DATA TYPE REF TO ZBO_S_ROOT1.
DATA : LR_SEARCH_RES TYPE REF TO ZBO_S_MNR_SEARCH_RESULT.


DATA : LO_CI_SERVICE_MANAGER TYPE REF TO /BOBF/IF_TRA_SERVICE_MANAGER,
        LO_TRANSACTION_MANAGER TYPE REF TO /BOBF/IF_TRA_TRANSACTION_MGR.

   LO_CI_SERVICE_MANAGER = /BOBF/CL_TRA_SERV_MGR_FACTORY=>GET_SERVICE_MANAGER( IV_BO_KEY = ZIF_BO_TEST_PO_C=>SC_BO_KEY ).
   LO_TRANSACTION_MANAGER = /BOBF/CL_TRA_TRANS_MGR_FACTORY=>GET_TRANSACTION_MANAGER( ).

CREATE DATA LR_DATA.

LR_DATA->KEY = LO_CI_SERVICE_MANAGER->GET_NEW_KEY( ).
LR_DATA->ROOT_KEY   = IS_CTX-ROOT_NODE_KEY.
LR_DATA->PIPO_MAT_ID = '100100'.
LR_DATA->PIPO_MAT_DESC = 'MATERIAL'.
LR_DATA->PIPO_SPRAS = 'E'.
LR_DATA->PIPO_MATL_TYPE = 'ZPMI'.
LR_DATA->PIPO_MATL_GROUP = 'ZKK'.

     DATA lt_mod      TYPE /bobf/t_frw_modification.
     DATA lo_change   TYPE REF TO /bobf/if_tra_change.
     DATA lo_message  TYPE REF TO /bobf/if_frw_message.

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

    APPEND INITIAL LINE TO lt_mod ASSIGNING <ls_mod> .

    <ls_mod>-node        =   ZIF_BO_TEST_PO_C=>sc_node-ROOT.
    <ls_mod>-change_mode = /bobf/if_frw_c=>sc_modify_create.
    <ls_mod>-key         = LR_DATA->KEY.
    <ls_mod>-data        = LR_DATA.

DATA : LT_CHG_FIELDS TYPE /BOBF/T_FRW_NAME.
DATA : LS_CHG_FIELDS LIKE LINE OF LT_CHG_FIELDS.

DATA : LV_KEY TYPE /BOBF/CONF_KEY.


CALL METHOD IO_MODIFY->CREATE
   EXPORTING
     IV_NODE            = ZIF_BO_TEST_PO_C=>sc_node-ROOT
     IV_KEY             = LR_DATA->KEY
     IS_DATA            = LR_DATA
     IV_ROOT_KEY        = IS_CTX-ROOT_NODE_KEY
   IMPORTING
     EV_KEY             = LV_KEY .


CREATE DATA LR_SEARCH_RES.

LR_SEARCH_RES->KEY           = LO_CI_SERVICE_MANAGER->GET_NEW_KEY( )..
LR_SEARCH_RES->PARENT_KEY    = LV_KEY.
LR_SEARCH_RES->ROOT_KEY    = LV_KEY.
LR_SEARCH_RES->MATNR    = '123'.
LR_SEARCH_RES->ERSDA    = SY-DATUM.
LR_SEARCH_RES->ERNAM    = SY-UNAME.
**LR_SEARCH_RES->LAEDA    = .
**LR_SEARCH_RES->AENAM    = .
**LR_SEARCH_RES->VPSTA    = .
*LR_SEARCH_RES->LVORM    = .
LR_SEARCH_RES->MTART    = 'ZPI'.
LR_SEARCH_RES->MBRSH    = 'ZTP' .
LR_SEARCH_RES->MATKL    = 'MAT'.
**LR_SEARCH_RES->BISMT    = ''
**LR_SEARCH_RES->MEINS    =

CALL METHOD io_modify->create
           EXPORTING
             iv_node            = ZIF_BO_TEST_PO_C=>sc_node-MNR_SEARCH_RESULT
             is_data            = LR_SEARCH_RES
             iv_assoc_key       = ZIF_BO_TEST_PO_C=>sc_association-root-MNR_SEARCH_RESULT
             iv_source_node_key = ZIF_BO_TEST_PO_C=>sc_node-root
             iv_source_key      = LV_KEY
             iv_root_key        = LV_KEY.


I am Unable to set data to the Node . I did not get any error message or Dump while executing . when i tried to retrive data I got the details from the node but am unable to view those details in the FBI UI and BOBT UI while testing .

Please provide your valuable Suggestions.

Thanks in Adv.

Thanks ,

Kranthi Kumar M.

2 REPLIES 2

Former Member
0 Kudos

Hi Kranthi,

For your requirement you need only two nodes. Root Node and Result node. Use the same structure for both.

To create Instance while search.

Create Query method with input type which has the required fields for selection criteria.

Fetch the data and create instance in the root node.

Pass the new instance key as exporting parameter form Query Method.

To Move data from ROOT to Result.

Create a action at root node.

Write a code to create new entries in Result node.

Then configure the Search UIBB and display result in List UIBB. Add button and assign the action MOVE_MAT_2_RESULT.

Create another List uibb to display data from Result node.

Connect the UIBBs using wire schema. SEARCH -> LIST(ROOT) ---> LIST(RESULT).

Give src node association for ROOT to RESULT Configuration.

Regards,

Sunil

bharath_k6
Active Participant
0 Kudos

Dear Kranthi,

I doubt you should call END_MODIFY method with passing IV_PROCESS_IMMEDIATELY = ABAP_TRUE.

I know this method is called after DO_MODIFY method and it will commit the changes immediately, but not sure about after CREATE method is called.

Thanks,

Bharath,K