09-02-2014 10:15 AM
Hi friends,
Need your help, there is one urgent requirement.
I have to treat a field in two different ways.
If string (content of field) is in English language, then i have to concatenate it in one way.
But if it's in Chinese then i have to concatenate it in another way.
Do we have any function module to detect the language or any SYST field for the same.
Help will be greatly appreciated. Thanks!!!!
09-02-2014 2:02 PM
If it is definetly either English or Chinese then it is simple i.e.:
DATA: text(20) VALUE 'Testing'.
START-OF-SELECTION.
IF text CA sy-abcde.
"CONCATENATE FIRST_WAY.
ELSE.
"CONCATENATE SECOND_WAY.
ENDIF.
But if you could possibly have other languages then of course this wouldn't work.
Hope this helps.
09-02-2014 10:32 AM
Hi Kulprakash,
can you use the system field sy-langu?
Regards.
JCD
09-02-2014 10:36 AM
Value to that field will come from a table (also field is free flow means it is accepting value in any language.), and SY-LANGU will consider sap log on language.
So, its not working
09-02-2014 10:48 AM
09-02-2014 10:56 AM
09-02-2014 11:32 AM
KP,
REGUH means you are dealing with F110 Payment Run data.
Get the Vendor or Customr Code of that Invoice.
Based on the Vendor or Customer Code find out which country he belongs to using LFA1 or KNA1 tables.
Then based on that Country Code you proceed with your validation.
Will that suffice ?
Let's see what experts say.
K.Kiran.
Message was edited by: Kiran K
09-02-2014 1:23 PM
09-02-2014 11:12 AM
Hi KP,
If string CS 'enter_all_chinese_characters_here'. " something like 'AaBb...Zz'
Concatinate name2 name1 name3 to name. "chinese format
else.
Concatinate name1 name2 name3 to name.
endif.
Thanks,
Anil
09-02-2014 11:23 AM
Good luck hardcoding thousands of characters. I would not recommend this
And operator should be CA not CS in this use...
09-02-2014 1:44 PM
Try to identify a character in Unicode Chinese specific ranges (Actually CJK ranges for China, Japan and Korea)
Block | Range |
CJK Unified Ideographs | 4E00-9FFF |
CJK Unified Ideographs Extension A | 3400-4DFF |
CJK Unified Ideographs Extension B | 20000-2A6DF |
CJK Compatibility Ideographs | F900-FAFF |
CJK Compatibility Ideographs Supplement | 2F800-2FA1F |
Regards,
Raymond
09-02-2014 1:59 PM
Hi Kulprakash Sharma,
Please use the field BANKS( Bank Country) to check the language.
IF BANKS = 'CN' " Chinese
CONCATENATE INTO STRING1....................
ELSE
CONCATENATE INTO STRING2
ENDIF.
Regards,
Pravin
09-03-2014 7:41 AM
Hi Pravin,
I checked the table, there are entries where BANKS = 'CN' but beneficiary name is maintained in English.
So, its not working.
Thanks!!
09-02-2014 2:02 PM
If it is definetly either English or Chinese then it is simple i.e.:
DATA: text(20) VALUE 'Testing'.
START-OF-SELECTION.
IF text CA sy-abcde.
"CONCATENATE FIRST_WAY.
ELSE.
"CONCATENATE SECOND_WAY.
ENDIF.
But if you could possibly have other languages then of course this wouldn't work.
Hope this helps.
09-03-2014 7:39 AM
For now, I am going with this solution but inconsistencies will come for sure in future.
Thanks!!
09-02-2014 2:04 PM
Well if its only English and Chinese that needs to be checked, then you can check, if its English and in the else condition concatenate the
if string CO sy-abcde.
*concatenate as in English.
else.
*concatenate as in Chinese.
endif.
09-02-2014 2:18 PM
I think way suggested by pravin s.(using Bank Country Key(BANKS) ) will work as expected.
you should go with that.