08-11-2007 2:58 AM
Hi,
val1 = R71234771
i should get val2 = R7123477.1
is my stmt correct r nt
concatenate val1(8) '.' val18(2) into val2
08-11-2007 3:01 AM
Hi Sravanthi,
You have to use like
CONCATENATE val10(8) '.' val18(<no.of characters you want>) INTO val2.
Regards,
Atish
08-11-2007 3:01 AM
Hi Sravanthi,
You have to use like
CONCATENATE val10(8) '.' val18(<no.of characters you want>) INTO val2.
Regards,
Atish
08-11-2007 3:16 AM
Hi,
Check this
types : begin of t_value,
val8(8) type c,
val9(1) type c.
types : end of t_value.
data : wa_value type t_vlaue.
move : 'R71234771' to wa_value.
concatenate wa_value-val8 '.' wa_value-val9 to v_value.
Here v_value will be R7123477.1
aRs
Message was edited by:
a®
08-11-2007 8:30 AM
Hi,
First confirm let us know the max length of the varaible. if is std, then you can use the above mentioned codes. else my option will be the following.
pass the val1 to FM conversion_alpha_input. to append by leading zeros.
data: l_len type i,
l_temp1 type val1,
l_temp2 type val1.
l_len = strlen( val1 ).
if you are sure that last 2 digits represnt the decimals then do the following.
l_len = l_len -2.
l_temp1 = val1 + 0(l_len).
l_temp2 = val1 + l+ len(2).
concatenate l_temp1 '.' l_temp2 into val2.
Regards,
Niyaz
08-11-2007 8:44 AM
Hi Gopal,
Check this code which will work for any length of your input.
DATA VAL1 TYPE STRING.
DATA VAL2 TYPE STRING.
DATA V_LEN TYPE I.
VAL1 = 'R71234771'.
V_LEN = STRLEN( VAL1 ).
V_LEN = V_LEN - 2.
CONCATENATE VAL10(V_LEN) VAL1V_LEN(1) SEPARATED BY '.' INTO VAL2.
WRITE:/ VAL2.
Thanks,
Vinay