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

EWM : FM/BAPI/Class to create Transportation Unit via /scwm/tu transaction

0 Likes
6,554

Hi Experts

I am new to EWM, i need to automate process below,

1) Enter Transaction /SCWM/TU.

2) on the transaction screen i need to click on create button and create TU. enter means of transport, TU no, carrier, Material and continue to create

Im not able to find any FM/BAPI for this purpose. kindly help

Accepted Solutions (1)

Accepted Solutions (1)

former_member543347
Active Participant
0 Likes

Hi Rajesh,

Unfortunately I'm not allowed to disclose the full code, but I hope this helps:

    
    ls_new_tu_head-tu_num_ext       = lv_tu_num_ext. "This is assuming you know the external TU identification.
    ls_new_tu_head-start_plan_tstfr = lv_timestamp_fr.
    ls_new_tu_head-start_plan_tstto = lv_timestamp_fr.
    ls_new_tu_head-end_plan_tstfr   = lv_timestamp_to.
    ls_new_tu_head-end_plan_tstto   = lv_timestamp_to.
    ls_new_tu_head-pmat             = lv_pmat_tu. "You need a packaging material for the TU
    ls_new_tu_head-yard             = lv_lgnum.
    "ls_new_tu_head-act_dir          = wmesr_sr_act_dir_outb. "This is commented, so I guess it's not needed and the direction will be determined by the first assigned deliveryr (inbound or outbound)
    ls_new_tu_head-mtr              = lv_mtr_tu.


    TRY.
        lo_tu_cntrl = /scwm/cl_sr_bom=>get_instance( ).
        lo_tu_cntrl->create_new_bo_tu( EXPORTING is_bo_tu_new = ls_new_tu_head
                                       IMPORTING eo_bo_tu     = eo_bo_tu ).
        IF eo_bo_tu IS BOUND.
          es_tu_act_num = eo_bo_tu->get_num( ).
        ENDIF.
        lo_tu_cntrl->save( ).
        COMMIT WORK AND WAIT.
        "Log something in case of success
      CATCH /scwm/cx_sr_error INTO lo_tu_exception.
        ROLLBACK WORK.
        "Log something in case of error
    ENDTRY.
0 Likes

Thanks Julio. Apologies for late reply. I managed to pull off by the class name and method name answer you have provided. Thanks a lot for your help. For check in check out i found class /scwm/cl_sr_bo_tu method check_in_out.

Answers (4)

Answers (4)

srinivas623
Discoverer
0 Likes

Hi @Kunal Kulkarni are you able to change the status of TU

former_member305715
Discoverer
0 Likes

juliolopez1945 , I have trying to change the status of an already created TU, which works from the standard transaction /SCWM/TU but when i try to replicate the same in the my custom report using class /scwm/cl_sr_bo_tu method check_in_out, I am getting an update error for "Assert Failed"

Can you please help me out here since standard debugging is pretty much inconclusive in this case.

atilay1
Participant
0 Likes

Hi Rajesh Kannan RS,

Did you try to use same number, sending shipment number (vt01n) to TU number?

If you set ıdoc, shipment number will be created TU automatically. I think it' s simple way.

Could you check document "How To Configure LE-TRA Integration"?

Best regards.

Atılay

former_member543347
Active Participant
0 Likes

Hi Rajesh,

Check class /SCWM/CL_SR_BOM, method CREATE_NEW_BO_TU.

0 Likes

Hi Julio,

Really thanks for your answer. Let me check the class. Meanwhile if you could help me with some reference program of creating TU with this class it will be really helpful.

Thanks again. Appreciate a lot.