Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Plz help me

Former Member
0 Kudos

Hi,

How to extract integer value from c-101555

Thanks & Regards,

K P

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi use this

var = c-101555.

newvar = var+2.

write newvar.

Alternatively you can use try this FM

CY_IS_INTEGER

Regards,

Amit Kumar

9 REPLIES 9

former_member181962
Active Contributor
0 Kudos

Hi KP,

Can you be a bit more clearer?

Thanks,

Ravi

manuel_bassani
Contributor
0 Kudos

Hi,


data: int type i,
      str(8) value 'C-101555'.

int = str+2.

int now contains integer 101555

Regards, Manuel

Former Member
0 Kudos

hi use this

var = c-101555.

newvar = var+2.

write newvar.

Alternatively you can use try this FM

CY_IS_INTEGER

Regards,

Amit Kumar

Former Member
0 Kudos

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.

0 Kudos

ThanQ for ur kind replies

Regards,

K P

0 Kudos

K P

kindly remember to reward points and close thread if your question has been answered.

Thank you, Manuel

0 Kudos

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

0 Kudos

plz tell me how to close the thread

0 Kudos

You give the 10 point star to the person who has solved your problem. This closes the post.

Regards,

RIch Heilman