2006 Sep 14 3:23 PM
Hi everyone,
Our team has implemented 2 custom pricing procedures and formulas to be applied durring sales order entry. One procedure is to be triggered for sales item category of 'TAN' and the other is to be triggered for category 'TAS'. During order entry, if the category is set when the item is entered, the pricing is carried out and the correct conditions appear on the item.
However, if we first add an item with category 'TAN' and then change it to 'TAS' before saving, repricing doesn't seem to be triggered. In the debugger we can see that our pricing routines are being hit and work correctly, however the item conditions don't seem to change.
Has anyone experienced this issue before? Can we force repricing on item category change in the sales order entry screen?
Any ideas/suggestions would be helpful.
Thanks for your input,
- Suresh
2006 Sep 14 4:07 PM
Hi Suresh!
For this you can use an user-exit to trigger a new pricing on change of item category.
It's 'form userexit_new_pricing_vbap changing new_pricing.' in include MV45AFZB.
Here you can check, if
if vbap-pstyv ne *vbap-pstyv.
new_pricing = 'B'.
endif.
Then the position will be new calculated. The values for field new pricing are the same as in price analysis, button 'new pricing'.
Regards,
Christian
2006 Sep 14 3:54 PM
Hi Suresh
Pls refer the code below, see the sap note 701163 for repricing sales order.
FREE MEMORY ID 'SDCORRECT_LISTE'.
EXPORT liste TO MEMORY ID 'SDCORRECT_LISTE'.
SUBMIT sdcorrect WITH in_prog EQ 'ZSD_UPDATE_SALESORDER'
WITH perform EQ g_perform_incl
WITH hdr_only = space and return.
regards
Srikanth M
2006 Sep 14 4:07 PM
Hi Suresh!
For this you can use an user-exit to trigger a new pricing on change of item category.
It's 'form userexit_new_pricing_vbap changing new_pricing.' in include MV45AFZB.
Here you can check, if
if vbap-pstyv ne *vbap-pstyv.
new_pricing = 'B'.
endif.
Then the position will be new calculated. The values for field new pricing are the same as in price analysis, button 'new pricing'.
Regards,
Christian
2006 Sep 14 4:18 PM
Another idea we had was to either delete or mark the custom conditions as inactive in the XKOMV table in our pricing routine.
Do you think this would trigger repricing?
This would be more desirable for us as we wouldn't need to maintain code in the user exit.
- Suresh
Message was edited by: Suresh Vijayakanthan
2006 Sep 14 5:00 PM
Hi Suresh!
I'm not sure, if I get your problem. When you need a re-pricing, which is not done by SAP itself, then you need the coding in the exit to set 'new_pricing'.
If you have already a re-pricing, where you can change the active / inactive status of some of your conditions, then I don't see why you ask for a re-pricing.
Just switching the active / inactive flag does not trigger a new pricing.
How do you check, if you need a re-pricing? Easy. Just go into conditions tab of the order. If your values are wrong, but get alright after pushing 'new pricing' button, then you need a re-pricing. You can also trigger a new pricing for the whole document under Edit -> New pricing document (Ctrl+F6).
If you like to have your conditions active or inactive is a business decision - don't expect an answer from my side on this topic.
Regards,
Christian
2006 Sep 14 5:05 PM
Thanks Christian,
This was pretty much what was happening in our scenario. Pricing conditions were displaying incorrectly until we pressed the "Update" button.
You've been very helpful!
- Suresh