2005 Nov 14 10:31 AM
Hi,
How to extract integer value from c-101555
Thanks & Regards,
K P
2005 Nov 14 10:43 AM
hi use this
var = c-101555.
newvar = var+2.
write newvar.
Alternatively you can use try this FM
CY_IS_INTEGER
Regards,
Amit Kumar
2005 Nov 14 10:32 AM
2005 Nov 14 10:35 AM
Hi,
data: int type i,
str(8) value 'C-101555'.
int = str+2.
int now contains integer 101555
Regards, Manuel
2005 Nov 14 10:43 AM
hi use this
var = c-101555.
newvar = var+2.
write newvar.
Alternatively you can use try this FM
CY_IS_INTEGER
Regards,
Amit Kumar
2005 Nov 14 10:54 AM
Hi K.p,
If you want to find the integer any where in the string use below code.
REPORT ZSTRING .
data : v_string(20),
v_pos type i,
V_NUM(20),
v_temp,
v_len type i.
V_STRING = 'c-101555'.
V_LEN = STRLEN( V_STRING ).
V_POS = 0.
IF V_LEN GT 0.
DO V_LEN TIMES.
V_TEMP = V_STRING+V_POS(1).
IF V_TEMP CA '0123456789'.
CONCATENATE V_NUM V_TEMP INTO V_NUM.
ENDIF.
V_POS = V_POS + 1.
ENDDO.
ENDIF.
write : v_num.
Hope this will help you.
Kindly award points if the answer is useful.
Thanks & Regards,
Siri.
2005 Nov 14 11:31 AM
2005 Nov 14 11:33 AM
K P
kindly remember to reward points and close thread if your question has been answered.
Thank you, Manuel
2005 Nov 14 11:34 AM
Hi KP,
Assign points to those who have helped you, by clicking the points on the left hand side and close the thread.
Regards,
Ravi
2005 Nov 14 2:10 PM
2005 Nov 14 2:12 PM