cancel
Showing results for 
Search instead for 
Did you mean: 

Does any one know the FM or BAPI to "Generate Outbound Delivery for TU" ?

Former Member
0 Kudos

Manual process:

T-Code /SCWM/TU

Enter TU number (Transportation Unit) and then select the record.

Next go to the menu "Transportation Unit" and click on "Generate Outbound delivery for TU".

It will create Final outbound delivery for each ODO (Outbound delivery order).

Now my requirement is to do the same pragmatically. So if any one can tell me the Function module or BAPI for the same it will be a great help.

Below is the screen shot of the manual process.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Got the answer.

FM: /SCWM/DLV_OD_CREATE_PAR

Thanks

Answers (1)

Answers (1)

0 Kudos

Hi!

I'm not sure, SAP use method /SCWM/CL_SR_BO_TU-SET_DLV_PRD_TO_FD_BY_TU

BR, Alex.

Former Member
0 Kudos

Hi Pal,

could you please give me sample code of FM: /SCWM/DLV_OD_CREATE_PAR.

I have called function module successfully but unable to save data into database.

Regards,

Kittu.

Former Member
0 Kudos

use class  /scwm/cl_dlv_management_prd and method create_od

DATA:  lo_message                     TYPE REF TO /scwm/cl_dm_message_no,

            lo_dlv_management_prd TYPE REF TO /scwm/cl_dlv_management_prd.


CREATE OBJECT lo_dlv_management_prd.

CALL METHOD lo_dlv_management_prd->create_od

       EXPORTING

         iv_whno                        = p_lgnum

*       iv_no_lock_in_main_process     =

*       iv_lock_check_queue            =

         iv_parallel_booking            = space

*       iv_object_instance_check       = 'X'

         it_od_creation                 = lt_od_creation

*       iv_no_tu_sync                  =

         it_tu_act_key                  = lt_tu_act_key

       IMPORTING

         eo_message                     = lo_message

         ev_parallel_booking_done       = lv_parallel_booking_done

         et_lock_errors                 = lt_lock_errors

         et_par_entries_not_changed_err = lt_par_entries_not_changed_err

         et_par_entries_saved           = lt_par_entries_saved

         et_od_created                  = lt_od_created

         et_items_new                   = lt_items_new

         et_par_object_instances_exist  = lt_par_object_instances_exist.


CALL METHOD lo_message->get_messages

       RECEIVING

         et_message = lt_message.

** Checking for errors.

     SORT lt_message BY msgty.

     READ TABLE lt_message WITH KEY msgty = gc_e

                           TRANSPORTING NO FIELDS

                           BINARY SEARCH.

     IF sy-subrc IS INITIAL.

       MESSAGE e008(zroute) INTO gv_message.

       EXIT.

     ELSE.

       REFRESH lt_message.

*** call SAVE method to save the newly created ODs

       CALL METHOD lo_dlv_management_prd->save

         EXPORTING

           iv_synchronously  = abap_false

           iv_do_commit_work = abap_true

           iv_wait           = abap_true

         IMPORTING

*         ev_rejected       =

*         ev_rollback_work_done =

*         ev_commit_work_done   =

           et_message        = lt_message.

Former Member
0 Kudos

If you are using FM then use commit and wait after that.

Former Member
0 Kudos

Hi Pal,

Thank you for given code. It's working fine.

Once again thank you and great help.

Regards,

Kittu