Skip to Content
0

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

Dec 05, 2017 at 02:09 PM

29

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Raymond Giuseppi
Dec 05, 2017 at 02:57 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Iftah Peretz
Dec 05, 2017 at 03:33 PM
0

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.
Share
10 |10000 characters needed characters left characters exceeded