Skip to Content
Dec 18, 2020 at 03:05 PM

CDS View - Session variable not all result


Hi team,

I am playing with CDS view and I am not really confortable on this.

So I try to create simple CDS view, and link these CDS with more complex CDS.

On several CDS, I have language column : SPRAS / LANGU ... so I try to put a session variable to filter the entries for only one language (the session language).

And it does not work, it is really strange. For a table I have 62 entries instead of 1212 for a second table I have 1120 entries instead of 1124

my code is really simple

@AbapCatalog.sqlViewName: 'ZIPMSTATUTLIB02'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'PM - Statut - xx'
define view ZI_PM_STATUT_USER_LIB as select from tj30t as Lib_Statut 

    key Lib_Statut.stsma  as Schema_Statut,
    key Lib_Statut.estat  as Code_Statut,
        Lib_Statut.txt04  as Libelle_court,
        Lib_Statut.txt30  as Libelle_long
  where spras = $session.system_language 

I have tried to replace language with fixe value, and it works perfectly

Thanks for help