2006 Oct 20 2:57 PM
Hello people!
I have a problem with this exit. When I change the incoterms in VA01/VA02, the pricing must be recalculated. I'm using this exit, I'm setting the variable NEW_PRICING to 'B', but it doesn't work...
Anyone help me!!!
Thanks in advance,
Denis Nakamoto
2006 Oct 20 2:58 PM
Put
NEW_PRICING to C, it should help.
Example
if vbak-auart eq 'ZTA0'.
new_pricing = 'C'.
endif.
Reward if helpful ***
Message was edited by: Manish Patil
2006 Oct 20 2:58 PM
Put
NEW_PRICING to C, it should help.
Example
if vbak-auart eq 'ZTA0'.
new_pricing = 'C'.
endif.
Reward if helpful ***
Message was edited by: Manish Patil
2006 Oct 20 3:06 PM
Hi Denis,
Please try to set NEW_PRICING = CHARG.
Regards,
Ferry Lianto
2006 Oct 20 3:22 PM
Thanks for the answer, but it doesn't work both the solutions.
Thanks a lot!
Denis Nakamoto
2006 Oct 23 10:42 AM
2006 Oct 23 5:44 PM
if vbkd-inco1 ne *vbkd-inco1.
new_pricing = charb.
endif.
Only this
See ya
2006 Oct 23 6:53 PM
have you tried to create watchpoint for your NEW_PRICING after you assigned it in this exit to see if it's changed by some other code (assuming the exit is triggered and the pricing is set to B) ?
2006 Oct 23 6:58 PM
hello Siarhei!
The process pass many times in this exit. One time, execute correctly the code, but in other times, set the new_pricing = ''.
I tried to put new_pricing = 'B' with no validation, but it doesn't work!
Thanks!
Denis Nakamoto
2006 Oct 23 7:15 PM
well, this code it hit many times.
the question is - are you changing incoterms on header level or on item level, do you have VBKD records on item level or not.
It may trigger pricing on header level if your VBKD-POSNR = 0 when your code is triggered and you set new_pricing to 'B'.
So, I would just check in debug if your new pricing is actually triggered on item or on header level ... just click single step several times after your code set new_pricing to 'B'.
One more question is - what exactly does nto work for you if you say that new_pricing is set to 'B' at least once when you change incoterms ?
2006 Oct 23 7:34 PM
I'm changing the incoterms on header level.
On the first execution, VBKD-INCO1 = *VBKD-INCO1.
The other execution, the VBKD-INCO1 <> *VBKD-INCO1.
So, the code works correctly.
But the other times, the VBKD-INCO1 = *VBKD-INCO1!
And don't update the variable new_pricing.
I will try to look on item level.
- One more question is - what exactly does nto work for you if you say that new_pricing is set to 'B' at least once when you change incoterms ?
I've tried the this, but it doesn't work too!
Thanks!!!
2006 Oct 23 7:56 PM
what exactly does not work ? I mean what result you are trying to achieve by setting new_pricing = 'B' ?
Set breakpoint to FM PRICING and PRICING_COMPLETE, are they triggered with your pricing type = 'B' ?
OR set breakpoint to any of the pricing requirement routines if they are assigned to your condition types and check preisfindungsart there.
I believe your pricing is triggered, but perhaps you just do not get the resutls you are expecting.
BTW, do you get the expected result when you call new pricing in the transaction manually after you updated incoterms ?
2006 Oct 24 2:16 PM
Hi,
take an example of one sales order.
change inco1 or inco2 what ever is requirement and go to condition tab of the item hit update and select B or C based on you requirement.
B only carry out new pricing
C and also manuval pricing.
If it is updating prices your code also should work otherwise put break-point on your code try to see value of inco1 or inco2 fields and new_pricing. As final step see the pricing data in MV45AFZZ exit ( mean before save order ).
***********Poorna**********
2006 Oct 24 6:32 PM
Yeah...I understand.
If I understand the functionally of this exit, the pricing must be calculated if I set the variable new_pricing to 'B' or 'C'.
Should I have to complement this exit in another point?
Siarhei,
I did that you asked me to do, but this exit, runs many times before I can enter in conditions screen. but do the same thing. First, go with 'B', but the other times, go ''.
Thanks!
2006 Oct 24 6:40 PM
Hi
No! U should insert your validation in that exit and set the flag to redeterminate the price.
Max
2006 Oct 24 6:43 PM
2006 Oct 24 6:48 PM
2006 Oct 24 7:12 PM
2006 Oct 24 7:25 PM
Denis,
I still have not received any response on how you determine that it does not work.
setting new_pricing to B in this userexit is actually the same as calling repricing and selecting pricing type B.
So, the question is :
1) you change incoterms and have your code in place to set new_pricing to B. Does it update pricing as you expect or not - if not why you think new pricing is not called, is it because some of your conditions are not re-calculated ?
2) remove your code, change incoterms, MANUALLY call repricing and select pricing type 'B', do you get desired result or not ?
Just compare these 2 cases, manual repricing without code and automatic repricing triggered by your code -> if there is no difference between these 2 cases -> the problem is not in this userexit but in your pricing logic/config. If there is a difference - try to compare these 2 cases to see where it goes wrong.
2006 Oct 24 7:52 PM
Hi
Have you tried this?
if vbkd-inco1 ne *vbkd-inco1.
new_pricing = 'C'.
endif.
Max
2007 Mar 13 3:10 PM
Slightly late, but I've spent a few days trying to work this one out.
The problem is that after the user exit, two different pricing routines are called PREISFINDUNG_GESAMT (for the header) and PREISFINDUNG (for the line items). The issue I had was that the pricing was being re-calculated, but it is all done in the in the first pass in the header routine. If you haven't modified the line items by this point, then the pricing is the same.
I used this exit to modify the pricing type VBKD-PLTYP, but in order to do this I had to update all the records in XVBKD on the first pass, when VBKD-POSNR eq '000000'.
I'm still testing this, but this seems to be the problem.