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: 

Identify non-english character in input and show error message.

former_member604279
Discoverer
0 Kudos

Hi all,
i want to show error message if my input contains any non-english or special characters.
i have tried some function module but it is completely removing it.
instead of removing i want to show error message.

can you please explain how it can be done ?

thanks in advance.

7 REPLIES 7

madhav93
Explorer
IF (Input field name) NA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
MESSAGE 'Enter ur message' TYPE 'E'.
ENDIF.

I guess you mean CN, not NA.

or preferably, use CO as it should contain only English characters, so NOT to trigger the error:

IF NOT (input field name) CO 'ABCDEF...'.

Sandra thats what I am thinking too lol 🙂 !!

NA I never seen

0 Kudos
saslove sap NA is equivalent to NOT CA

former_member596005
Participant
0 Kudos

HI Rishab Mishra,

If you think function module used in your program working correctly in removing special characters other than english letters then write sy-subrc condition below the function module .

function module.
if sy-subrc eq 0.
'Error message'.
 endif.

raymond_giuseppi
Active Contributor

Could you elaborate on 'English' characters... (ASCII?)

raymond_giuseppi
Active Contributor

If the FM removed the non-english character (Brexit?) then use a temporary field in the call compare the previous value with the new one, if different, non-english characters removed, then you have your answer?