Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FM 'WS_DELIVERY_UPDATE_2' is not working when alternate UOM.

Former Member
0 Kudos
1,823

Hi All,

FM 'WS_DELIVERY_UPDATE_2' is not working when we use alternate UOM in sales document.

In my case  in material master the UOM is 'EA'. But I used UOM is 'PAC' in SO. Now by using one Z program 1 am doing PGI but the picking quantity is changed.If I pass picking quantity 2 then after PGI it will 1.

Can anyone suggest me how to erase this issue.

Thanks,

Satya

1 ACCEPTED SOLUTION

Former Member
546

Hi Guys,

I found the solution. Here we have to pass the actual quantity LIPS-LGMNG. because the FM could not understand the relation between the Alternate UOM between material master and sales document. So If we pass the value to the  table vbpok_tab. Then the problem is solved now.

Thanks and Cheers...

Satya

5 REPLIES 5

SimoneMilesi
Active Contributor
0 Kudos
546

You have to fill these fields for each item

UMVKZ1 TypesUMVKZDEC50Numerator (factor) for conversion of sales quantity into SKU
UMVKN1 TypesUMVKNDEC50Denominator (Divisor) for Conversion of Sales Qty into SKU
VRKME1 TypesVRKMEUNIT30Sales unit
MEINS1 TypesMEINSUNIT30Base Unit of Measure

If you already got the delivery, you have them on LIPS table, otherwise UMVKZ and UMVKN are read from MARM with VRKME (took from VBAP) and MEINS (took from MARA)

I do not remember (do some tests by yourself) if you also need UMREV field

Former Member
0 Kudos
546

This message was moderated.

0 Kudos
546

Sorry but which other clue you need?

I gave you the fields you MUST fill to avoid the issue and I also explained where to retrieve them.

Whatelse you need?

Former Member
0 Kudos
546

Hi

Always good to use BAPI's instead of FM's

Sample code I used for updating the quantity and UoM, Also there is a difference in passing UoM values....need to convert UoM values into their ISO codes.. for example PCE should be ST and so on.

    ls_header_data-deliv_numb    = ls_delivery_update-vbeln.

    ls_header_control-deliv_numb = ls_delivery_update-vbeln.

    lv_delivery                  = ls_delivery_update-vbeln.

    ls_tech_control-upd_ind      = 'U'.

    CLEAR ls_delivery_update.

    LOOP AT lt_delivery_update INTO ls_delivery_update.

      ls_item-deliv_numb        = ls_delivery_update-vbeln.

      ls_item-deliv_item        = ls_delivery_update-posnr.

      ls_item-dlv_qty           = ls_delivery_update-nista.

      ls_item-base_uom          = ls_delivery_update-meins.

      ls_item-sales_unit        = ls_delivery_update-vrkme.

      ls_item-fact_unit_nom     = ls_delivery_update-umvkz.

      ls_item-fact_unit_denom   = ls_delivery_update-umvkn.

      APPEND ls_item TO lt_item.

      ls_item_control-deliv_numb = ls_delivery_update-vbeln.

      ls_item_control-deliv_item = ls_delivery_update-posnr.

      ls_item_control-chg_delqty = 'X'.

      APPEND ls_item_control TO lt_item_control.

    ENDLOOP.

    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'

      EXPORTING

        header_data    = ls_header_data

        header_control = ls_header_control

        delivery       = lv_delivery

        techn_control  = ls_tech_control

      TABLES

        item_data      = lt_item

        item_control   = lt_item_control

        return         = lt_return.

    READ TABLE lt_return INTO ls_return WITH KEY type = 'E'.

    IF sy-subrc = 0.

      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

      lv_error_flag      = 'X'.               

    ELSE.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

        EXPORTING

          wait = 'X'.

    ENDIF.

Regards

Dwaraka

Former Member
547

Hi Guys,

I found the solution. Here we have to pass the actual quantity LIPS-LGMNG. because the FM could not understand the relation between the Alternate UOM between material master and sales document. So If we pass the value to the  table vbpok_tab. Then the problem is solved now.

Thanks and Cheers...

Satya