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

Issues with CDS View Entity

Vasu_Sac
Participant
0 Likes
1,618

Hello, 

I am trying to create below CDS view entity, but getting error at lbkum field. This is due to reference information missing for unit of measure. 

Its allowing , If I create CDS view with same code but iF I want to create CDS View Entity, the code is failing. Please help how to fix the issue.

 

//@AbapCatalog.sqlViewName: 'ZTESTMBEW10'

//@AbapCatalog.compiler.compareFilter: true

@AccessControl.authorizationCheck: #NOT_REQUIRED

@EndUserText.label: 'Material DATA'

@VDM.viewType: #CONSUMPTION

 

define view entity ZTEST_MBEW_10

as select from Mbv_Mbew as A1

left outer join marc as A2

on A1.matnr = A2.matnr

and A1.bwkey = A2.werks

 

{

A1.matnr,

A1.bwkey,

A1.lbkum,

A2.prctr

}

 

Regards,

Vasu

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
SAP Champion
SAP Champion
0 Likes

if it is asking for uom, why not just give it?

Vasu_Sac
Participant
0 Likes

Hi @junwu

The uom field is not available in this CDS view tables, it is available in table (MARA-MEINS) and tried to join and getting same issue.

 

Vasu_Sac_0-1735313996587.png

define view entity ZTEST_MBEW_10
as select from Mbv_Mbew as A1
left outer join marc as A2
on A1.matnr = A2.matnr
and A1.bwkey = A2.werks

inner join mara as A3 //Unit of Measure > Meins
on A3.matnr = A1.matnr

{
A1.matnr,
A1.bwkey,
//@Semantics.unitOfMeasure: true
@Semantics.quantity.unitOfMeasure: 'LBKUMUnit'
@DefaultAggregation: #SUM
A3.meins as LBKUMUnit,
A1.lbkum,
A2.prctr
}

junwu
SAP Champion
SAP Champion
0 Likes
@Semantics.quantity.unitOfMeasure: 'LBKUMUnit' A1.lbkum,