cancel
Showing results for 
Search instead for 
Did you mean: 

BOPF Enhancement Workbench. I Can't modify a node

Former Member
0 Kudos

Hi All

I'm implementing an enhancement for the business object /SCMTMS/TRQ in the action ROOT~BUILD_FUS method EXECUTE to modify the field BLK_PLAN (and others)  of the Freight Unit when is created by with the Transport Request. My knowledge about Busines Object Framework is very poor, and then I tryed with the next code:

*** Previus I retrieved the data without problem.

LOOP AT lt_root_tor INTO ls_root_tor.

    CLEAR ls_mod.    

    CREATE DATA lr_root_tor.    

    lr_root_tor->* = ls_root_tor.    

    lr_root_tor->blk_plan  = 'X'.    

    NSERT /scmtms/if_tor_c=>sc_node_attribute-root-blk_plan  INTO TABLE ls_mod-changed_fields.   

    ls_mod-change_mode = /bobf/if_frw_c=>sc_modify_update.    

    ls_mod-node                = /scmtms/if_trq_c=>sc_node-tor_bo. "80E0ED0A0C021DDE8EABA0E0DF78CB06     

    ls_mod-key                  = ls_root_tor-key.   

 

    INSERT ls_mod INTO TABLE lt_mod. 

ENDLOOP.

And then call the method io_modify->do_modify

But the problem is outside this method when the program try to get the asociation node. There is not a node and then finalize with error.

My question is I have to complete something more in the lt_mod table? or I have to do something diferent?

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hello,

As the action BUILD_FUS is from /SCMTMS/TRQ ROOT node, and You are trying to modify data for /SCMTMS/TOR ROOT node, you should use Service manager Modify of TOR.

As the modification being carried out here is on Cross BO, IO_MODIFY will not work here.

Decaration :

Data : lo_srvmgr_tor type /BOBF/IF_TRA_SERVICE_MANAGER.

Instantiate Service manager :

lo_srvmgr_tor = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( /scmtms/if_tor_c=>sc_bo_key ).

Do modification :

CALL METHOD lo_srvmgr_tor->modify(

EXPORTING
it_modification = lt_mod
IMPORTING
eo_message = lo_msg ).

0 Kudos

Hi Carlos,

Can you make one correction -
ls_mod-node                = /scmtms/if_trq_c=>sc_node-root.


And can you tell why you are trying to modify a transient node tor_bo. Because field blk_plan is in root node, so can you try modifying the root node.


Thanks

Former Member
0 Kudos

Hi Ravi,

Thanks for your answer. Actualy the field is in both nodes in trq and in tor. At first I was using /scmtms/if_trq_c=>sc_node-root  but this action blocks the transportation request and I have to block the Freight Unit.

I was thinking that maybe I have to put the enhancement in the TOR node. Do you know if I have to add an action to the node or enhance some existing action?

Regards Carlos