Thursday, 30 July 2020 13:35

Select only the highest freight condition at Sales document

Written by Jimmy Zhang
Rate this item
(0 votes)
“© 2020. SAP SE or an SAP affiliate company. All rights reserved.” “Used with permission of SAP SE”
Scale value fromScale value toFreight fee
1.0 GBP1000.00 GBP150 Eur
1000.01GBPmaximumFree, no charge

If two items belong to the same condition group and the system can’t calculate per item directly and have to calculate the total quantity at the header level, then split the total freight fee into items level. If item 2’s quantity been changed and item 2’s ZDEL will been always inactive as haven’t waited for total quantity been sum, the result of ZDEL amount per item been compared too earlier which lead to the wrong item been selected as the highest ZDEL.

Even try to trigger new pricing by user exit userexit_new_pricing_vbkd at program MV45AFZB will not work after item changes. Cause loop XKOMV at userexit_xkomv_bewerten_init is triggered by earlier than group conditions calculation, it’s impossible to get which item contains the highest ZDEL at that time. The key debug point is to find where all ZDEL been calculated correctly at the function module: PRICING_COMPLETE. You can check this article for more details about this FM.

Thought 2. Using freight condition as statistics

There’re so many customer user exits existed for pricing process, I try many of them and didn’t find the right place to catch the “final” highest ZDEL. Even if it’s achievable by some enhancement or with the help of access key to modify the pricing calculation function, the above method still has a major issue as only the highest ZDEL item been collected into the header item. This means other items are free of charge, the header ZDEL amount from a specific item is not split into all items which leaves a huge potential problem for delivery processing.

From the above experience, we know that ZDEL must keep active status all the time during the calculation, otherwise, it’ll impact the calculation of header level ZDEL for special cases like group condition or exclusion been involved. So the new idea is:

  1. Create another new condition ZDLX (which kind of mirror of condition ZDEL without condition records ) at the header level only (no item condition).
  2. Make its value always equal to the highest ZDEL at the item level at the loop of XKMOV inside RV61AFZB(no value for other lower ZDEL items), and keep all ZDEL as XKOMV-KINAK=’L’ and statistical XKOMV-KSTAT = ‘X’.
  3. At the setting of price procedure, make freight subtotal include ZDLX but exclude the ZDEL.

Read 33 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.