‎2006 Jun 09 3:39 AM
Dear experts.
i have a string data '3.1200'
how can i delete the two zero of last.
the result is :'3.12'
Thanks.
Johnmin.
Message was edited by: zhongming LIU
‎2006 Jun 09 3:52 AM
‎2006 Jun 09 3:52 AM
Hi,
Use following code to remove last 2 0's.
shift str1 right deleting trailing '0'.Cheers,
Vikram
Pls reward for helpful replies!!
‎2006 Jun 09 3:54 AM
use shift right.
sample code:
DATA : wa_source(7) VALUE '100.400'.
SHIFT wa_source RIGHT DELETING TRAILING '0'.
WRITE: wa_source.
‎2006 Jun 09 3:54 AM
Hi,
<b>1</b>.
Have a look at this sample code.
DATA :string_x TYPE string VALUE '3.1200',
string_y TYPE string.
string_y = string_x+0(4).
write string_y.
It solves ur problem
<b>Thanks,
Venkat.O</b>
‎2007 May 04 8:48 AM
DATA : wa_source type string VALUE '3.1200'.
SHIFT wa_source RIGHT DELETING TRAILING '0'.
SHIFT wa_source RIGHT DELETING TRAILING '.'.
‎2007 May 04 9:12 AM
Was it really neccessary to dig out this 1 year old post?
Regards
Tamá
‎2007 May 04 8:55 AM
Hi zhongming LIU,
refer this code :
DATA : wa_source type string VALUE '3.1200'.
SHIFT wa_source RIGHT DELETING TRAILING '0'.
u will get 3.12 as result.
Reward points if helpful.
Regards,
Hemant
‎2007 May 04 9:02 AM
DATA :x(6) VALUE '3.1200',
y(4) .
y = x.
write y.
or
DATA :x(6) VALUE '3.1200',
y(4) .
y = x+(4).
write y.
Reward if useful.