Skip to Content
0
Sep 06, 2023 at 01:41 PM

Combining fiori elements and navigation via association from custom entity to custom entity.

149 Views Last edit Sep 06, 2023 at 05:22 PM 5 rev

Hi Fellow Developers,

I am struggling to prepare such scenario:

There are two custom cds entities. One of them (Master) has inside an association to second (Detail)

_detail       : association [1..*] to SUB_ENTITY on 
$projection.plant      = _detail.plant
$projection.machine    = _detail.machine.<br>

When I am calling it from SAP Gateway Client (in gui)

/sap/opu/odata/ZZ_SERV/Master(plant='Factory1', machine='Machine1')/to_detail<br>

I get the proper results. As the cardinality is set to 1...* I get 2 results (which is fine).

Now, the problem is following:

I am trying to build the fiori elements app that uses the Master EntitySet and when pressing one record in the specified row (Going into Details):

image.png

I would like to follow the association to the Detail cds view entity (via Association).

I have defined the following Page setting in manifest.json:

"pages":

{ "ListReport|Master":

{ "entitySet": "Master",

"component": { "name": "sap.suite.ui.generic.template.ListReport",

"list": true,

"settings": { "condensedTableLayout": true, "smartVariantManagement": true, "enableTableFilterInPageVariant": true, "filterSettings": { "dateSettings": { "useDateRange": true } } } },

"pages": { "ObjectPage|Master":

{ "entitySet": "Detail",

"navigationProperty": "to_detail",

"component": { "name": "sap.suite.ui.generic.template.ObjectPage",

"list": true,

"settings": { "tableSettings": { "multiSelect": false, "selectAll": false, "type": "GridTable" }, "defaultContentView": "table" } }

and it seems to process logic (custom classes) but only when I change the cardinality to 1...1.

( The batch Request:

GET Master(plant='Factory1',machine='Machine1')/to_detail?sap-client=100 HTTP/1.1).

Unfortunalety, as there are 2 results we get:

image.png

Is there a way to do this approach (using association from one custom entity to another)?

Attachments

image.png (2.2 kB)
image.png (11.5 kB)