cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic pricing redetermination at sales order item level when plant at shipping tab is changed

0 Kudos

Hi all,

I have a requirement which requires automatic redetermination at sales order item level when plant is changed at the shipping tab. The user does not want to manually update the pricing at the conditions tab in the order item. Can you please help and enlighten me with the approach I can use?

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

siva_vasireddy2
Active Contributor

This Exit -

  • USEREXIT_NEW_PRICING_VBAP

in the programme-MV45AFZB 

will meet your requirement,consult your abaper for the same

0 Kudos

Thank you for the prompt reply.

0 Kudos

Hi Siva,

I already made my modifications in the userexit but when I changed the plant, it does not redetermine the price automatically. is there something that I am missing in my code?

    IF t180-trtyp EQ 'H'.
      CLEAR xvbap.
      READ TABLE xvbap WITH KEY posnr = '000000'.
      IF sy-subrc EQ 0.
        lv_werks = xvbap-werks.
        READ TABLE xvbap WITH KEY posnr = vbap-posnr.
        IF sy-subrc EQ 0.
          IF lv_werks NE xvbap-werks.
* pricing will be re-determined
            NEW_PRICING = 'G'.
          ENDIF.
        ENDIF.
      ENDIF.
*   Change
    ELSEIF t180-trtyp EQ 'V'.
      CLEAR zz_org_xvbpa.
      READ TABLE zz_org_xvbap WITH KEY posnr = vbap-posnr.
      IF sy-subrc EQ 0.
        CLEAR xvbap.
        READ TABLE xvbap WITH KEY posnr = vbap-posnr.
        IF sy-subrc EQ 0.
          IF zz_org_xvbap-werks NE xvbap-werks
           OR ( xvbap-updkz EQ 'I' OR xvbap-updkz EQ 'U' ).
*pricing will be re-determined
           NEW_PRICING = 'G'.
        ENDIF.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.

siva_vasireddy2
Active Contributor
0 Kudos

Hi,

you have selected pricing type-G which copies the price elements unchanged Except Taxes which are Re-determined

if you need completely new pricing you need to select-B

0 Kudos

ah yes, you are correct, I did changed it to B and it work as expected. Thank you again for your help.

siva_vasireddy2
Active Contributor
0 Kudos

Hi John hope it is working fine