01-29-2015 11:02 PM
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
01-30-2015 1:07 AM
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.
02-03-2015 3:03 PM
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