Skip to Content
0

Condition Type value updated after Billing (Expecting no change in Condition value)

Jul 11, 2017 at 06:57 AM

75

avatar image
Former Member

Hi Experts,

We create Back to Back Trading contract(BTB TC) which has condition types for Purchase Price, Sales Price and Gross Margin. The Purchase Price, Sales Price and Gross Margin are updated via code from Purchase Pre-TC and Sales Pre-TC respectively. The Gross Margin is updated manually(only the Price, the condition comes up automatically in the condition tab, that is, condition type is not marked as 'Manual' in Pricing Procedure) in the Sales Pre-TC. We have over-written the standard logic of calculation of Gross Margin via custom calculation type, so that the value entered manually is retained.

The condition prices from BTB TC are copied into the follow-on documents Sales Order and Purchase Order after BTB is released. After the Billing is done for the Sales Order, if we enter the Condition tab (via calculation button) in BTB TC, in change or display mode, then the Gross Margin value is re-calculated as per the standard code, the custom calculation type is not triggered as the KOMV-KSTEU value is set to "F" (condition value fixed, billed). This is leading to Gross Margin being overwritten. In BTB Change mode, the re-calculated standard Gross Margin value is updated and this value gets updated even in Sales Order and in KONV database table.

Question: We would not want the Gross Margin re-calculation to happen after Billing. Can we avoid the standard code which is re-calculating the Gross Margin, just like the custom calculation type is not triggered, after billing.

Standard code Locations:

  1. In the include LWVK1FD8, routine ITERATIONSVARIABLEN_SETZEN_NEU calculates the gross margin
  2. It calculates it via standard formula, (Sales Price – Purchase Price) * 1000 / Purchase Price
  3. Routine AUFSX_IN_VKOMV_FUELLEN updates the same calculated value for “Gross Margin Condition” in the G_T_VKOMV
  4. Further routine VKPX5_ERMITTELN calls the PRICING function module, in which all the pricing value relevant calculation happen, inside the routine XKOMV_BEWERTEN
  5. Inside the routine XKOMV_BEWERTEN, routine XKOMV_KWERT_ERMITTELN calls our custom calculation routine at line 1149
  6. But before call it there is a check, at line 1133, to validate XKOMV-KSTEU i.e. condition control
  7. As per this check, KSTEU should not be equal to E, F or H. but once after billing it becomes ‘F’ for all the pricing conditions
  8. As result, condition price does not get update via custom routine and keep system calculated margin only as net price

Thanks in advance for your help.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

G Lakshmipathi
Jul 12, 2017 at 01:24 PM
0
We have over-written the standard logic of calculation of Gross Margin via custom calculation type,

We would not want the Gross Margin re-calculation to happen after Billing.

You have indicated that you have customized the standard logic and this being the case, if that is not working as expected, then you need to check with your technical team for code change. Meanwhile, there is one Wiki explaining how KSTEU field would fetch the value and search Google with this field value

Share
10 |10000 characters needed characters left characters exceeded