Application Development and Automation 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: 
Read only

Change (convert) delivery quantity

kumaro412
Active Participant
0 Likes
2,690

Dear all,

Does anyone know how I can change the delivery quantity ?

What we ant to achieve is the following:

- an order has been created with a quantity in sales units for example 10 BAG

- at creation of delivery, we would like to convert the sales order quantity to the unit of issue (MARC-AUSME) if this one is different from the sales order sales unit (for example PAL iso BAG) ...

I tried a few things yet to change the quantity (and unit) to the converted one, but it all didn't work ...

Any idea how this can be done ?

Thanks in advance !

Greetz,

Kurt.

1 ACCEPTED SOLUTION
Read only

kumaro412
Active Participant
0 Likes
1,986

Problem will be 'solved' by changing the values only on printouts ...

Thanks to everyone anyway for thinking about this problem !

Dear all,

Does anyone know how I can change the delivery quantity ?

What we ant to achieve is the following:

- an order has been created with a quantity in sales units for example 10 BAG

- at creation of delivery, we would like to convert the sales order quantity to the unit of issue (MARC-AUSME) if this one is different from the sales order sales unit (for example PAL iso BAG) ...

I tried a few things yet to change the quantity (and unit) to the converted one, but it all didn't work ...

Any idea how this can be done ?

Thanks in advance !

Greetz,

Kurt.

7 REPLIES 7
Read only

Former Member
0 Likes
1,986

SO is this just a UOM thing?  You need to change the UOM and have the quantity change as calculated by UOM conversion?  There are FM's to do that.

Please correct me.

Neal

Read only

0 Likes
1,986

Hoi Neal,

First of all thanks for the answer !

It's not only the UoM that must change, but also the quantity ...

For example : the sales order has been created with quantity 10 BAG

The material has as unit of issue 'PAL', so the delivery-quantity should be in PAL ... Normally at delivery-creation, the quantity should also be 10 BAG, but we want it in PAL ... When I do the conversion at 'USEREXIT_MOVE_FIELD_TO_LIPS', it has no effect ...

So, what I need to know is the place where I can do the conversion to be effective ?

Greetz,

Kurt.

Read only

0 Likes
1,986

Can you show the code that you put into the user exit?

Read only

0 Likes
1,986

  select single kwmeng vrkme into (lv_kwmeng,lv_vrkme)

                             from vbap

                             where vbeln = lips-vgbel

                               and posnr = lips-vgpos.

  select single ausme into lv_ausme from marc

                                    where matnr = lips-matnr

                                      and werks = lips-werks.

  if sy-subrc eq 0 and lv_ausme is not initial.

    call function 'ZCF_UT_UNIT_CONVERSION'

      exporting

        matnr_imp      = lips-matnr

        unit_new_imp   = lv_ausme

        unit_old_imp   = lv_vrkme

        value_old_imp  = lv_kwmeng

      importing

        value_new_exp  = lv_lfimg

      exceptions

        invalid_input  = 1

        invalid_output = 2

        overflow       = 3

        others         = 4.

    if sy-subrc <> 0.

*     message id sy-msgid type sy-msgty number sy-msgno

*             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    endif.

    lips-lfimg = lv_lfimg.

    lips-vrkme = lv_ausme.

  endif.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,986

I suppose you called MD_CONVERT_MATERIAL_UNIT  to calculate new quantity.

And coded it in form USEREXIT_MOVE_FIELD_TO_LIPS of include MV50AFZ1 or method FILL_DELIVERY_ITEM of BAdI LE_SHP_DELIVERY_PROC, but this may be too late as onmy provided to fill customer fields.

Could you try method SAVE_DOCUMENT_PREPARE of BAdI LE_SHP_DELIVERY_PROC ?

Regards,

Raymond

Read only

0 Likes
1,986

I guess I would add, remember to condition what you change on document type and other components like that...

Neal

Read only

kumaro412
Active Participant
0 Likes
1,987

Problem will be 'solved' by changing the values only on printouts ...

Thanks to everyone anyway for thinking about this problem !