Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CDS View - Session variable not all result

FredericGirod
Active Contributor
2,535

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

Fred

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

Fred

2 REPLIES 2
Read only

prabhu_04
Explorer
2,060

Hi ,

In sap gui default language is English 'EN'.

@AbapCatalog.sqlViewName: 'zcdslang'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Scn'
define view zcds_scn as select from tj30t {
    stsma as Stsma,
    estat as Estat,
    spras as Spras,
    txt04 as Txt04,
    txt30 as Txt30,
    ltext as Ltext
} where spras = $session.system_language 
 

it will fetch corresponding Spras-EN filed only or Use Parameter.

Read only

0 Likes
2,059

Hi,

to fetch data for spras either you can use session variable or parameter.

You can fetch data for field spras = $session.system_language.

here number of entries that meet selection criteria is 288.

it will show 100 rows (partial output) but if u want to see all the records in output top right corner max row is there select how many rows you want and refresh it will display all the output as shown in below image