‎2007 Aug 16 12:05 PM
Hi,
DATA : L_KBETR TYPE P DECIMALS 2 VALUE 0.
BREAK-POINT. "TAX
SELECT single KBETR FROM KONP INTO G_KBETR
WHERE KSCHL = 'JIP6'
AND MWSK1 = 'V7'.
MOVE G_KBETR TO L_KBETR.
IF SY-SUBRC = 0.
L_KBETR = L_KBETR DIV 10.
ADD L_KBETR TO LTAX.
GV_TAX = GV_TAX + LTAX.
ENDIF.
here l_kbetr contain 125
after devide it contain 12 not 12.5..what is reason? could u suggest me..
‎2007 Aug 16 12:11 PM
well it´s the div statement, it calculates only full values. try / instead.
div is an extra operator like MOD
‎2007 Aug 16 12:11 PM
Hi,
'/' ->Division of the left by the right operand, it will give 12.50.
'DIV' ->Integer portion of the division of the left by the right operand , so this will return value 12.00 as per ur case.
‎2007 Aug 16 12:12 PM
Hi
instead of
L_KBETR = L_KBETR div 10 .
use
L_KBETR = L_KBETR / 10 .
because if u use L_KBETR = L_KBETR div 10 . and l_kbetr = 125 ur equation
L_KBETR = L_KBETR div 10 . will give result 12 not 12.5 .
regards
‎2007 Aug 16 12:17 PM
Hi
use '/' operator if u use DIV u will never get decimals
reward points to all helpful answers
kiran.M