2007 Sep 28 1:39 PM
Hi ,
i have a requirment where i need to calculate the % discount for a order.
actual value before discount i_value = 165.
discount rate = 75.23%.
net value after discount will be = 40.87 (output)
able to get i_value as = 165.
discount value i am getting while reading into variable is = 752.30-
Can you please let me know how to calculate to get the value as '40.87'.
Thanks in advance,
Vind.
Hi ,
i have a requirment where i need to calculate the % discount for a order.
actual value before discount i_value = 165.
discount rate = 75.23%.
net value after discount will be = 40.87 (output)
able to get i_value as = 165.
discount value i am getting while reading into variable is = 752.30-
Can you please let me know how to calculate to get the value as '40.87'.
Thanks in advance,
Vind.
2007 Sep 28 1:42 PM
hi,
try like this.
If discout on 100 is 75.23 so how much on 165?
means (165 * 75.23)/ 100.
now subtract that value from 165.
reward if useful.
2007 Sep 28 1:48 PM
Hi
data: P type p decimals 2, dis type p decimals 2.
dis = 165 * 7523 / 10000.
p = 165 - dis.
write / P.
Regards
anji
2007 Sep 28 2:29 PM
Hi ,
i am able to get the per value in the variable i_per = 752.30- .
This should be shown as 75.23% on the sap script.
Please let me know how to get this and avoid the '-' sign at the end .
Thanks,
Vind.
2007 Sep 28 2:36 PM
Hi,
U can use ABS to avoid '-' sign.
<b>i_per = ABS( i_per ).</b>
Regards,
Padmam.
2007 Sep 28 1:49 PM
Hello Vind,
Check this:
REPORT ZV_TEST_SDN .
PARAMETERS: INPUT TYPE P DECIMALS 2,
DISCOUNT TYPE P DECIMALS 2.
DATA: OUTPUT TYPE P DECIMALS 2,
INPUT1 LIKE OUTPUT.
INPUT1 = INPUT / 100.
DISCOUNT = DISCOUNT * INPUT1.
OUTPUT = INPUT - DISCOUNT.
WRITE OUTPUT.
Cheers,
Vasanth
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |