Skip to Content
0
Sep 06, 2022 at 09:53 AM

ABAP CDS View showing different data as compared to SQL Console

751 Views Last edit Dec 11, 2022 at 01:27 AM 2 rev

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,

}