Application Development 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: 

Unable to use the Multiple Assocation in CDs View

former_member375795
Participant
0 Kudos

I am unable to use the Multiple Assocation in CDS view below my code

@AbapCatalog.sqlViewName: 'ZFI_GSTR2GL101'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'G/L 101 Service Invoice'
define view ZFI_CDS_GSTRGL101 as select distinct from zfi_gst2vekbe as a
association  to zfi_cds_gstr2_po as gst2_po
    on a.ebeln = gst2_po.ebeln 
    and a.ebelp = gst2_po.ebelp 
association  to bkpf as b  on b.awkey = a.awkey 
association  to bseg as c1 on $projection.belnr =  b.belnr and c1.buzid = 'M'  and c1.zekkn = gst2_po.zekkn
 {
    a.ebeln,
     a.ebelp,
    a.zekkn,
    a.bwart,
    a.belnr as belnr1,
    b.belnr,
    b.gjahr
    // Make association public
} 
where a.bwart = '101'
and a.ebeln = '3600000028'

Getting Error when use the field c1.Hkont

3 REPLIES 3

pfefferf
Active Contributor
0 Kudos

What error do you get?

former_member375795
Participant
0 Kudos

Dear Florian Pfeffer,

Error c1 cannot be used locally within the view

Regards

Alok

0 Kudos

You can use left outer join instead of Associations to achieve the requirement as there are no path expressions and cardinality present in your scenario.