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

Custom CDS View Association

Rawel
Explorer
0 Kudos
627

Hi Good day SAP

I am Creating Custom Cds View 

Scenario External API

How can i Expose MaterialDocumentItems on MaterialDocumentHeader.


I think i am doing it wrong

Rawel_0-1756813636306.png

Like this one 

MaterialDocumentHeader_2 = 1
_I_MaterialDocumentItem_2 = 1
_I_MaterialDocumentItem_2 = 2
_I_MaterialDocumentItem_2 = 3

MaterialDocumentHeader_2 = 2
_I_MaterialDocumentItem_2 = 1
_I_MaterialDocumentItem_2 = 2
_I_MaterialDocumentItem_2 = 3

 

View Entire Topic
DilanLatifSAP
Explorer
0 Kudos

Dear @Rawel , 

I have created in my own Public Cloud same and it works. Please check the following Data source and their Join Condition. 

 

DilanLatifSAP_0-1756821706485.png

DilanLatifSAP_1-1756821760270.png

if you have any other question let me know. 

 

Thanks and BR

Dilan

 

 

Rawel
Explorer
0 Kudos

Hi @DilanLatifSAP

I think I explained it wrong.

This is what I want to do:

I want to expose each items in the header by using ?$expand=to__I_MaterialDocumentItem_2,
but only with selected fields from I_MaterialDocumentItem_2.

Upon associating the I_MaterialDocumentItem_2. I got an error

Rawel_4-1756887909216.png

Rawel_0-1756886714636.png

 

Therefore, I am unable to publish it to my CDS view(s).

But this is the data I am getting in View Data.
The preview displays raw data without any aggregation or conversions.

Rawel_1-1756886938188.png

In Postman there's no I_MaterialDocumentItem_2 to expand
Rawel_2-1756887564250.png

I can see that each result line is based on Material Document item lines.

4900000000 = 10 Items = 10 Lines

 

 

DilanLatifSAP
Explorer

Dear @Rawel ,

please check this SAP Knowledge Base Article below,

https://me.sap.com/notes/3278639/E

Thanks and BR

Dilan