Skip to Content
0
Jun 13, 2018 at 04:25 PM

Problem with EXTEND VIEW with ASSOCIATION

8064 Views

Hello ABAP and CDS gurus!

When trying to extend the view in the following way:

extend view C_Purchasereqitmdtlsext

with ZEXT_C_Purchasereqitmdtlsext

association[0..1] to Z_MM_PUR_SCENARIO_1 as _ext1

on $projection.banfn = _ext1.banfn

and $projection.bnfpo = _ext1.bnfpo

{

_Purchaserequisitionitem.PurchaseRequisition as banfn, _Purchaserequisitionitem.PurchaseRequisitionItem as bnfpo,

_ext1.scenario1 <<<<< PROBLEM HERE

}

I'm getting the error: "Association _sc1 cannot be used locally within the view".

It looks like i can not add external field: _ext1.scenario1

But when i extend it with association: _ext1, everything looks OK.

However I do not need this scenario, as my intention is to enhance OData at the end, i.e. $metadata should see this field.

I saw this page, where exactly the same thing is done.

https://help.sap.com/doc/erp2005_ehp_08/6.0.8/en-US/a3/ee51db743e44d9a4d21ae835b0ad3a/frameset.htm

But for me it's not working.

S/4: SAPK-10201INS4CORE, SAPK-75201INSAPBASIS

Thanks, Dima