Application Development and Automation 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: 
Read only

Plz help me

Former Member
0 Likes
1,282

Hi,

How to extract integer value from c-101555

Thanks & Regards,

K P

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,265

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
Read only

Former Member
0 Likes
1,265

Hi KP,

Can you be a bit more clearer?

Thanks,

Ravi

Read only

manuel_bassani
Contributor
0 Likes
1,265

Hi,


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

int = str+2.

int now contains integer 101555

Regards, Manuel

Read only

Former Member
0 Likes
1,266

hi use this

var = c-101555.

newvar = var+2.

write newvar.

Alternatively you can use try this FM

CY_IS_INTEGER

Regards,

Amit Kumar

Read only

Former Member
0 Likes
1,265

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.

Read only

0 Likes
1,265

ThanQ for ur kind replies

Regards,

K P

Read only

0 Likes
1,265

K P

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

Thank you, Manuel

Read only

0 Likes
1,265

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

Read only

0 Likes
1,265

plz tell me how to close the thread

Read only

0 Likes
1,265

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

Regards,

RIch Heilman