cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

conditional statement to make comparision between tables

devboy
Explorer
0 Likes
1,116

a table has two columns one for English language and one for french language if user is English then it should show English description if user is french then it should show french description then for that what i have to do if i use Conditional Statement then how can I make comparison In every table. If this two field i.e. English & French column so I need to Make logic for that.

Anyone can help me then most welcome.

Regards

Saurabh

Accepted Solutions (0)

Answers (2)

Answers (2)

venkateswaran_k
Active Contributor

Hi

You may use the union based on the session variable as below:

Provided, the COL1 , COL2, COL3 of same type.

SELECT COL1, COL2, COL3 
FROM TABLE
WHERE SESSION_CONTEXT('LOCALE_SAP') = 'EN'
UNION
SELECT COL1, COL2, COL3 
FROM TABLE
WHERE SESSION_CONTEXT('LOCALE_SAP') <> 'EN'

Regards,

Venkat

yannmiquel
Participant
0 Likes

the 'LOCALE_SAP' is a one letter convention ('E'), isn't it ?

devboy
Explorer
0 Likes

Thank You for your response but what I required I have a 5-6 table in which there are multiple field and in that table there is English description column and French description column also so we need to convert those column i.e. English to french. So, the challenge is How can we get that type of user either English or French user then we need to make comparison of that table and need to make change.

Regards,

Saurabh

venkateswaran_k
Active Contributor
0 Likes

Yes it is Single Char 'E'

yannmiquel
Participant

Hi,

If you can use the LOCALE of the users, then a calculation view with "Text join" can be a good option. Since you have one column for each language, you should do an union of these 2 in 1 column with a fixed input for the language (E or F) in a 2nd column.

Regards,

Yann