02-26-2009 12:43 PM
Hi,
Can any one please let me know i have a filed having 13 characters.in that 3 are decimals.
now my requirement is that i need to remove dot as well as 3 decimals from the value.
For ex: user is giving the width as 50 but while displaying it is showing 50.000.
and another possibility is that user may give 50.50 then 50.50 only to be displayed in the output.
Please any one suggest me the solution.
Regards,
Koti
02-26-2009 12:45 PM
HI Koti
if it's classical output then use
WRITE <value> NO ZERO.
If alv then put no_zero in field catalog as 'X'
Pushpraj
02-26-2009 12:49 PM
Hi,
Check this logic:
data: val type p decimals 3.
data: val1 type i.
val = '234.000'.
move val to val1.
write:/ val1.
thanks\
Mahesh
02-26-2009 12:49 PM
02-26-2009 12:51 PM
Hi Kotireddy,
You can use round if its a packed number and give your decimal places as 2.
Much Regards,
Amuktha.
02-26-2009 1:50 PM
Hi,
This works for sure.
Try this.
DATA w_p TYPE p DECIMALS 2 VALUE '123.00'.( take ur packed with ur decimals needed )
DATA w_c(30) TYPE c.
DATA w_temp TYPE i.
w_c = w_p.
CONDENSE w_c.
SEARCH w_c FOR '...'.
IF sy-subrc EQ 0.
w_temp = sy-fdpos.
ENDIF.
ADD 1 TO w_temp.
IF w_c+w_temp EQ 0.
subtract 1 from w_temp.
WRITE 😕 w_c+0(w_temp).
ELSE.
WRITE 😕 w_c.
ENDIF.