Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

numeric containing in char - how to extract

HI,

Field1 = 'HELLO WORLD 20'.

Field1 contains characters and one number between 01 and 999.

How to extract the number of field1.

Note: the number can be somewhere in that field.

Thx,

Gordon

Tags:
replied

Hi

You can try this

Field1 = 'HELLO WORLD 20'.

data : len type i.

data : num(5).

data : count type i.

count = 0.

len = strlen (field1).

do.

if FIELD1+COUNT(1) co '0123456789'.

concatenate num field1+count(1) into num.

endif.

count = count + 1.

if count = len.

exit.

endif.

enddo.

enddo

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question