cancel
Showing results for 
Search instead for 
Did you mean: 

xsodata and $.request.language

WRoeckelein
Active Participant
0 Kudos

I want expose via xsodata a cds view which does a select on a table with a where clause comparing a column to the equivalent of $.request.language.

How can I do this? While I have eg CURRENT_USER for the view definition, how can I use something like $.request.language? And while I can modify CUD operations with xsjs, I can't modify READ operations...

Any ideas?

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

You can use

  • SESSION_CONTEXT('LOCALE') -> ISO-Code
  • SESSION_CONTEXT('LOCALE_SAP') -> SAP encoding

in your CDS view where clause.

If you need more flexibility it would also be possible to add a calculation view with a parameter on top of your CDS view. With the parameter you are able to restrict the output (e.g. by language). How you pass the parameter to the OData service can be found here: OData Parameter Entity Sets - SAP HANA Developer Guide for SAP HANA Studio - SAP Library

Answers (0)