on 03-28-2013 6:39 AM
Hello All,
We already know that by using this we can get the system lang --
SESSION_CONTEXT('LOCALE_SAP')
But I want to have this information as a calculated column in analytical view so that I can filter my table based on this.
Please help me .
Regards,
Sharath
Hello Sharath,
I don't think that you actually want the logon language to be part of your table.
What you want to do - or what would make sense here - is: you want to filter your data, based on the logon language settings of the current session.
That's easy to have. Just implement a filter for a language column (single character) that equals to "$$language$$".
That's how e.g. text joins work.
- Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. I have a table which has data and text fields in multiple languages. Ideally the table and text table are seperate entities but in my case both the values and the corresponding texts are in the same table.
I want to apply filter based on logon language. But how do i know the logon language ?
Hi again,
as I wrote, you'd use the system variable $$language$$.
That's all. After activation, you can query the view without any additional settings:
select session_context('LOCALE_SAP'), session_context('LOCALE') from dummy;
/*
SESSION_CONTEXT('LOCALE_SAP') SESSION_CONTEXT('LOCALE')
D de
*/
SELECT TOP 5
"MATNR","SPRAS","MAKTX","MAKTG","MANDT"
FROM
"_SYS_BIC"."lars/AT_LANGDEPTEXT";
/*
MATNR SPRAS MAKTX MAKTG MANDT
T-FUC09 D Flatscreen MS 1460 P FLATSCREEN MS 1460 P 800
T-FUC10 D Flatscreen MS 1460 P FLATSCREEN MS 1460 P 800
T-FUC11 D Flatscreen MS 1460 P FLATSCREEN MS 1460 P 800
T-FUC12 D Flatscreen MS 1460 P FLATSCREEN MS 1460 P 800
T-FUC13 D Flatscreen MS 1460 P FLATSCREEN MS 1460 P 800
*/
--> connect with english locale
select session_context('LOCALE_SAP'), session_context('LOCALE') from dummy;
/*
SESSION_CONTEXT('LOCALE_SAP') SESSION_CONTEXT('LOCALE')
E en
*/
SELECT TOP 5
"MATNR","SPRAS","MAKTX","MAKTG","MANDT"
FROM
"_SYS_BIC"."lars/AT_LANGDEPTEXT";
/*
MATNR SPRAS MAKTX MAKTG MANDT
100-110 E Slug for spiral casing SLUG FOR SPIRAL CASING 800
100-300 E Hollow shaft HOLLOW SHAFT 800
100-302 E Hollow shaft HOLLOW SHAFT 800
102-300 E Hollow shaft HOLLOW SHAFT 800
T-BQ500 E Hollow shaft HOLLOW SHAFT 800
*/
Easy as pie, isn't it? 🙂
- Lars
Madalina,
this question has been explained and answered already multiple times here in SCN.
Searching for it is not a crime!
Anyhow: LOCALE => iso-code language, LOCALE_SAP => SAP encoding (both set automatically based on user parameter or logon parameter).
Filtering in information models is easily done by variable $$language$$.
Alright, and from now on I am not going to answer this question again .
- Lars
Hi Lars,
We have a requirement to display language specific description for calculation views.
When checking the table _sys_repo.active_object_text_content the lang column had the language specific information
but the language code was stored in ISO 639 format. (en, de...).
From the query select session_context('locale') from dummy i am able to get the language code in posix format (en_US..)
How would i fetch the language specific description from the above mentioned table using the locale information from the session.
Thanks in advance!
Best Regard
Cherry
Hi Cherry,
actually LOCALE does not provide the locale information in POSIX format, but in whatever format was specified during logon by the client app.
For SAP HANA Studio this is a JAVA (Locale (Java Platform SE 7 ) which is mostly in the form of <lang>_<country> (e.g. en_US).
The SAP HANA contents are saved with just the language code provided (two or three letters).
This means, you could simply do a substring and use only the language part of your LOCALE settings.
Besides that, I am not too sure about your requirement. Why do you think it's necessary to access internal repository tables? Had you have a look into the translation tools for the repository objects (rtt folder in your SAP HANA client installation)?
- Lars
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.