‎2010 Jun 17 4:39 AM
PARAMETER: lv_amt type p DECIMALS 2.
data: lv_data type p.
lv_data = lv_amt.
if lv_data > lv_amt.
lv_amt = '0.50'.
lv_amt = lv_data - lv_amt.
else.
lv_amt = '0.50'.
lv_amt = lv_data + lv_amt.
endif.
WRITE lv_amt.
sample code: if I'm entering the value 12.33 then it comes 12.50
12.67 then 13
but i need when im entering the 12.50 then no chanegs same as value 12.50
first 2cases it is okay! for my program.
‎2010 Jun 17 6:06 AM
Hi,
I did not get you ..
but yuo can check ceil or floor function for same.
Ashutosh
‎2010 Jun 17 6:43 AM
Hi ..
Thanks for response...
I need that if i give the value 12.33 then its o/p = 12.50 and 12.67 then its o/p = 13 and 12.50 then its o/p 12.50 and 12 then its o/p 12 only i need
based on 0.5 value we can put condtion
‎2010 Jun 17 6:52 AM
Hello
Your code, but a little modified:
PARAMETER: lv_amt type p DECIMALS 2.
data: lv_data type p,
d type p decimals 2.
lv_data = lv_amt.
d = frac( lv_amt ).
if lv_data > lv_amt.
if d > '0.50'.
lv_amt = lv_data.
endif.
else.
lv_amt = '0.50'.
lv_amt = lv_data + lv_amt.
endif.
WRITE lv_amt.
‎2010 Jun 17 7:26 AM
Dear Nagaraju Gaddam,
I hope the below code will help you to fix the issue,
PARAMETER: lv_amt TYPE p DECIMALS 2.
DATA: lv_data TYPE p,
d TYPE p DECIMALS 2.
lv_data = lv_amt.
d = FRAC( lv_amt ).
IF lv_data > lv_amt.
IF d > '0.50'.
lv_amt = lv_data.
ENDIF.
ELSE.
IF d EQ 0.
ELSE.
lv_amt = '0.50'.
lv_amt = lv_data + lv_amt.
ENDIF.
ENDIF.
WRITE lv_amt.Regards
Harish Kumar