‎2011 May 25 6:05 PM
Hi
I have this requirement to be addressed:
Requirement: Packing fee to be charged to customers on sales orders. The way the condition type is configured is % based. The problem is when the value of the order goes up as the calculation is % basis there is no limitation for the packing fee to be charged for the order i.e. 30 $ (Max. Limit). I need to come up with a work around where in if the calculated value based on % is higher than 30 Dollars then the value should be restricted to 30 $ not more than that. If the value is below 30 then no changes are expected.
If there are two line items system should distribute the 30$ across two line items under Packing fee condition type.
Problem:
I am unable to set the value for the condition type (KRECH) changing it from A (% based calculation) to B (Fixed amount). On VA02 if you change the values: Calculation type (KRECH), Condition based Value (KWERT) & Amount (KBETR).
How to change the value of condition type (KRECH) in Condition value based Formula ?
Does the system allow the change ?
Is there any other way to achieve the same ?
Is there a configuration solution for this requirement ?
Thanks in advance for any answers.
SB
Edited by: Bapanapalli Suresh on May 25, 2011 1:07 PM
‎2011 May 25 6:20 PM
Hm... if you have a formula attached to your condition, then you should be able to calculate the condition value any way you want, and change all those fields you mentioned.
Or am I missing something?
‎2011 May 25 7:26 PM
‎2011 May 25 7:30 PM
Well, I just based my question on one of the standard formulas out there (routine 18 for condition values). There, the code sets XKOMV-KRECH. If that works for this formula, it should work for others I suppose.
That code looks like the following:
* Percent contribution margin
form frm_kondi_wert_018.
data: workfield(16) type p decimals 2.
* catch field-overflows
catch system-exceptions conversion_errors = 1
arithmetic_errors = 5.
xkwert = komp-netwr - komp-wavwr.
endcatch.
if sy-subrc = 1 or sy-subrc = 5.
clear xkwert.
endif.
xkomv-krech = 'A'.
clear xkomv-waers.
check: komp-netwr ne 0.
catch system-exceptions conversion_errors = 1
arithmetic_errors = 5.
workfield = xkwert * 100000 / komp-netwr.
xkomv-kbetr = workfield.
endcatch.
if sy-subrc = 1 or sy-subrc = 5.
clear xkomv-kbetr.
endif.
endform. "frm_kondi_wert_018Does something like this not work for you?
‎2011 May 25 9:36 PM
@Tamas: Your suggestion was correct. I would suspect that the poster has not checked the configuration of the condition type. The 'Calculation type' checkbox must be checked for the condition type in order to switch the value...
‎2011 Jun 01 4:33 PM
I could not resolve the siutaiton using Formulas on VOFM. I could complete the solution by manipulating values in Pricing communication table in run time.
‎2011 Jun 01 4:49 PM
But did you check the condition type config? As I mentioned before, switching the calculation type in a formula is supported based on the setting in the condition type config.
However, if you consider the question resolved, then close the thread...