2007 Apr 12 10:57 AM
Hi All,
I have a formula which I need to calculate. This formula is contained in a string, viz. something like :
LV_FORMULA = 'X + Y - 15*Z + 36'.
I have replaced the variables with values, so that LV_FORMULA is now something like :
LV_FORMULA = '10 + 15 - 15*12 + 36'
Now, LV_FORMULA is of type c. How can I find the value of this expression?
Hi All,
I have a formula which I need to calculate. This formula is contained in a string, viz. something like :
LV_FORMULA = 'X + Y - 15*Z + 36'.
I have replaced the variables with values, so that LV_FORMULA is now something like :
LV_FORMULA = '10 + 15 - 15*12 + 36'
Now, LV_FORMULA is of type c. How can I find the value of this expression?
2007 Apr 12 10:59 AM
Hi,
you've to use dynamic programming
-> look for dyn. subroutine pool
http://help.sap.com/saphelp_470/helpdata/en/9f/db999535c111d1829f0000e829fbfe/frameset.htm
A.
Message was edited by:
Andreas Mann
2007 Apr 12 11:00 AM
Hi
Declare LV_FORMULA as Type I field and use
LV_FORMULA = 10 + 15 - 15 * 12 + 36 .
the equation will be executed as per the order of preference of the operators
( +, -, *).
reward if useful
regards,
ANJI
2007 Apr 12 11:00 AM
2007 Apr 12 11:01 AM
data LV_FORMULA(10) type C.
LV_FORMULA = 10 + 15 - 15 * 12 + 36.
write lv_formula. (Contains the Value)..
regards,
santosh