Hi All,
How can I assign the freight unit to a freight booking , I tried the below code but it is going to the dump.
READ TABLE lt_root_fb INTO lwa_root_fb INDEX 1.
IF sy-subrc = 0.
REFRESH lt_key_root.
* Existing Freight Booking Key
ls_key_root-key = lwa_root_fb-root_key.
APPEND ls_key_root TO lt_key_root.
* Freight Unit Key that we are used to assign to the existing Freight Booking
ls_key_item-key = <lfs_tor_item>-fu_root_key.
APPEND ls_key_item TO lt_key_item.
ls_parameters-target_item_keys = lt_key_item.
* Adding string for test planning
ls_parameters-string = '001'.
GET REFERENCE OF ls_parameters INTO lr_s_parameters.
* Assign the Freight unit to Freight booking
CALL METHOD lo_srv_mgr->do_action
EXPORTING
iv_act_key = /scmtms/if_tor_c=>sc_action-root-add_fu_by_fuid
it_key = lt_key_root
is_parameters = lr_s_parameters
IMPORTING
* eo_change = lo_change
eo_message = lo_msg
et_failed_key = lt_failed_key
et_failed_action_key = lt_failed_act_key.
* Saving the Action
if lt_failed_key is INITIAL and
lt_failed_act_key is INITIAL.
lo_tra->save( IMPORTING eo_message = lo_msg ).
endif.
ENDIF.
Thanks,
Arun