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: 

How to find the language of a string in sap scripts maintaining EN JP as languages

vasu_srinu
Explorer
0 Kudos

Hi

I do have one peculiar requirement.

I need to check the language of that string, based on the logic I need to do other things.

could anybody let me know how to find the language of the string(note: it's not standard text, it's just a string)

best regards

Venu

2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos

You could look for CJK (Chinese, Japanese, Korean) characters in the string (4E00–9FEA?)

iftah_peretz
Active Contributor
0 Kudos

To break it down into the details. You would need to define a subroutine and call it from the Sapscript(you pass the string and change a var that indicates if its English or not, you can find examples online like so). In it, you check to see if it's English or not, I would use Regex .

Something like this (I'm not infront of SAP system, son this is an unchecked code regex is based on this😞

FIND REGEX ‘[^\x00-\x7F]+’ IN lv_string.
IF sy-subrc EQ 0.
   "Not English
ELSE.
   "English
ENDIF.