Skip to Content

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

How can I search a field character by character.

Hi people,

I have a field with this numbers: 000089562 and I need to send a e-mail of one person if the first character is equal to '8'. But, the problem is that ever the field have '0' as first character in the field and I can't erase the '0' because I need them. How can I search the character in the field to check if have an eight in the front.

Thanks for the help.

Tags:
replied

Hi,

The following code will not remove the leading zero but will check if eight is in the front

Data: lv_original type char10,

lv_without_leading_zero type char10.

lv_original = '000089562'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

input = lv_original

IMPORTING

output = lv_without_leading_zero.

if lv_without_leading_zero+0(1) eq 8

"your logic. if the orginal value is needed you can use lv_original.

endif.

Regards,

Sameena

Message was edited by: sameena attarwala

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