Skip to Content

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

string functions to check if string contains charactets other than digits

We have a string as an input.

We need to check if it contains any characters other than digits ( ie. 0123456789) The other characters could be special characters, albhabets etc.

Please suggest any RFC / Logic to get this .

Rohit

Tags:
Former Member
replied

if you know the solution better, than why ask at all?

if you get different replies, why don't you try them and see if works or not?

CA stands for contains any

IF string CA '0123456789'

it will be true if the string contains at least one digit

IF string CA '0123456789'
==> the string contains at least one digit
ELSE.
==> the string does NOT contain any digit (however could contain space or special characters)
ENDIF.

CO stands for contains only

IF string CO '0123456789'

it will be true if the string contains only digits

IF string CO '0123456789'
==> the string contains only digits
ELSE.
==> the string contains not only digits (could be no digits at all)
ENDIF.

==> the string contains only

</Spoonfeeding>

PS: Thomas: Thanks for your support / Vielen Dank für die Unterstützung!

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question