cancel
Showing results for 
Search instead for 
Did you mean: 

Custom CDS Views | Association not available

Vivek0459
Participant
0 Kudos
3,488

Hi SAP Folks,

Is there any reason while creating custom CDS view sometimes associations are not added and you receive a warning association not added.

In my case i am creating a Custom CDS view - Scenario Analytical as Cube i have selected all relevant fields from primary CDS view but when i activate i see warning association not available. Am i doing something wrong while selecting fields ? Please guide if any one knows possible reason behind this.

Thanks

VIvek Singh

Shivaraj_Gowda
Explorer
0 Kudos

Hi Amith Nair / Vivek,
I am getting similar issue explained  below.

Accepted Solutions (1)

Accepted Solutions (1)

Amith_Nair
Product and Topic Expert
Product and Topic Expert
0 Kudos

This is a common scenario while preparing analytical query using your custom CDS View. In order to avoid the warning you can check mark the association itself. for example for currency check mark _Currency Association(screen shot attached). As you must have realized, this should not stop you from publishing your view.

please find the KB article articulating some rules to know while creating Analytical Queries.

https://launchpad.support.sap.com/#/notes/2657021

Thank you!

Amith Nair

Vivek0459
Participant
0 Kudos

Thanks amiths.nair2 ,

but after adding that association why i see error "Association _CompanyCode ignored: Field CompanyCode_01 is not used in the ON condition"

Attached screen shot

Amith_Nair
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Vivek,

You should not be selecting any fields inside the association, but just the association alone. For example, you select the field WorkPackage and then its association _WorkPackage. Please dont select any other field inside an association as this could impact the cardinality of the result set.

Shivaraj_Gowda
Explorer
0 Kudos

Hi @Amith Nair / @vivek,
I am getting issue like below. What would be the root cause? "Association of field STOTYPE ignored: Association for field PURCHASINGDOCUMENTCATEGORY is inconsistent [Analytics]"
Basic data type of STOType  is same as  PurchasingDocumentType.
Defined association as below in analytical view

@Analytics.dataCategory: #CUBE
association
[0..1] to I_PurchasingDocumentType as _PODocType on $projection.PurchasingDocumentCategory = _PODocType.PurchasingDocumentCategory and

$projection.STOType = _PODocType.PurchasingDocumentType


{
...

PurchasingDocumentCategory,

@ObjectModel.foreignKey.association: '_PODocType'

STOType,

_PODocType,
...
}

Answers (0)