cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Unassign Freight Unit (FU) from Freight Order (FO) using BOPF action in ABAP (SCMTMS/TOR)?

e_maino
Explorer
0 Likes
421

Hello SAP Community,

I am working on an ABAP development requirement within SAP Transportation Management (TM) and need to programmatically unassign a Freight Unit (FU) from a Freight Order (FO).

In an other development method DO_ACTION of class /bobf/if_tra_service_manager was used to assign to freight unit to freight order with the following code:

 

DATAlo_srv_mgr    TYPE REF TO /bobf/if_tra_service_manager.

*-- Initialize service manager for TOR
  lo_srv_mgr /bobf/cl_tra_serv_mgr_factory=>get_service_manager/scmtms/if_tor_c=>sc_bo_key ).

  TRY.
      CALL METHOD lo_srv_mgr->do_action
        EXPORTING
          iv_act_key    /scmtms/if_tor_c=>sc_action-root-add_fu_by_fuid   
          it_key        VALUE #key <la_un>-db_key_odn )     "GUID FREIGHT ORDER
*         it_key        = lt_n_fo_key
          is_parameters NEW /scmtms/s_tor_a_add_elementsstring lv_fu_str )  " FREIGHT UNI
*         is_parameters = lr_s_parameters
        IMPORTING
          eo_message    lo_message
          et_failed_key DATA(lt_fail).
    CATCH /bobf/cx_frw_contrct_violation.
  ENDTRY.

Now I was thinking about doing something similar, but I can't find the right action key among costants in /scmtms/if_tor_c=>sc_action .

Any suggestions?
Thanks in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

Ajit_Routray
Active Contributor

Hi @e_maino ,

Addition to @Dominik_Tylczynski , Please add the parameters too and let us know if you face any issues. Example code screen shot, its standard way working of delete button.Screenshot 2025-11-15 at 9.11.39 AM.png

Kind Regards,

Ajit

Dominik_Tylczynski
SAP Champion
SAP Champion

Hello @e_maino 

I think the /scmtms/if_tor_c=>sc_action-item_tr-delete_cargo_item action will do the job.

Best regards

Dominik Tylczynski