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: 

Update price condition automatically without update the collective condition

former_member493530
Participant
0 Kudos

Hi all,

I need to automatically update the price condition when I change the payment term, I used the exit USEREXIT_NEW_PRICING_VBKD and put the following code:

if vbkd-zterm ne *vbkd-zterm.

    new_pricing = 'C'.

    message 'New payment term, update price condition.' type 'I'.

  endif.


Update the price conditions correctly but when I create a sales order with reference to a contract and also update the sale deal (collective condition) and I need to keep the condition of the contract, I tried with new_pricing :


A

B

C

D

E

F

G

H

But does not work as I need.

Best regards,

Robert

2 REPLIES 2

VenkatRamesh_V
Active Contributor
0 Kudos

HI,

Program Name: MV45AFZZ

FIELD-SYMBOLS :  <fs_pricing> lIKE   LINE OF XKOMV.

FORM USEREXIT_PRICING_PREPARE_TKOMP.

CHECK  sy-tcode = 'VA01'

         AND    VBAK-AUART  = 'ZPS'

         AND NOT xkomv[] IS INITIAL.

LOOP AT  xkomv  assigning <fs_pricing>  WHERE  kposn = vbap-posnr. "AND

*                                                       kschl = 'ZGR'.

       CASE <fs_pricing>-kschl.

         WHEN  'ZCES'. "'ZECS'.

           <fs_pricing>-kbetr = '0.00'.

           <fs_pricing>-kwert = '0.00'.

           lv_success  = 'X'.

      ENDCASE.

     ENDLOOP.

ENDFORM.

Hope it helpful.

Regards,

Venkat.

0 Kudos

Hi Venkat,

I did like your example to return KBETR and KWERT which had before modify the payment term (exit USEREXIT_NEW_PRICING_VBKD -.> new_pricing = 'C') and even shown in the VA01 transaction the KBETR and KWERT values that I returned but after save and display the document in the VF03 transaction I saw that did not saved the values that I put in the exit USEREXIT_PRICING_PREPARE_TKOMP.

Please help me.

Best regards,

Robert