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

ABAP CDS View showing different data as compared to SQL Console

former_member820215
Discoverer
0 Likes
2,340

We have a requirement to get TEXT1 for T012T table with SKB1 table.

Select SKB1~BUKRS,SKB1~saknr,SKB1~HBKID,SKB1~HKTID,T012T~text1 from SKB1

LEFT OUTER JOIN T012T On SKB1~BUKRS = T012T~BUKRS AND

SKB1~HBKID = T012T~HBKID AND

SKB1~HKTID = T012T~HKTID

The above code is working fine in SQL Console.

But while below code is being written for CDS View.Its not working i.e. T012T.TEXT1 is not getting populated.

@AbapCatalog.sqlViewName: 'ZBW_C1'

@AbapCatalog.compiler.compareFilter: true

@AbapCatalog.preserveKey: true

@AccessControl.authorizationCheck: #CHECK

@EndUserText.label: 'ZBW_HBD_CDS3'

@Analytics.dataExtraction:{enabled: true}

@Analytics.dataCategory: #DIMENSION

define view ZBW_HBD_CDS3 as select distinct from

skb1

left outer join t012t on skb1.bukrs = t012t.bukrs and

skb1.hbkid = t012t.hbkid and

skb1.hktid = t012t.hktid

{

key skb1.saknr as GL_Account,

skb1.bukrs as CompanyCode,

skb1.hbkid as HouseBank_ID,

skb1.hktid as BankAccount_ID,

t012t.text1 as HouseBank_Text,

}

Accepted Solutions (1)

Accepted Solutions (1)

Christophe_SW
Participant

Hi Alok,

There might be a compatibility view in your case replacing the old table content with newer content based on a CDS.
check your table via SE11 --> extras --> Replacement object
if there is a replacement object available, try selecting the data from there instead.
Some interesting Facts of Compatibility Views in SAP BW/4HANA and SAP S/4HANA | SAP Blogs

Marcelo_Rodrigues1
Discoverer
0 Likes
Hi my friend, thanks for this information.

Answers (1)

Answers (1)

MKreitlein
Active Contributor
0 Likes

Hi Alok,

did you recognize that in your first SQL there is no DISTINCT, whereas in the CDS there is?!

I did not check these tables, this was just obvious.

BR, Martin

former_member820215
Discoverer
0 Likes

Even removing distinct doesn't change the output...