‎2010 Jun 17 4:38 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:12 AM
Nagaraju,
I exexcuted the same program and if i enter 12,50 i am getting 12,50 only.
Thanks
Bala Duvvuri
‎2010 Jun 17 6:29 AM
i also execute same and i entering the 12.50 and i got 12.50
data: lv_amt type p DECIMALS 2.
lv_amt = '12.50'.
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.
‎2010 Jun 17 7:22 AM
H i thanks for reply
No its not working
If i enter 12.50 its coming 13 value and
I need like this
if i enter 12 then o/p 12
12.50 then o/p 12.50
12.33 then 0.p 12.50
12.67 then o/p 13
like this the logic is nt working
‎2010 Jun 17 7:50 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.Note : Please do not repeat the thread.
Regards,