Hi Experts,
I am currently working on a CAP project where I consume products via an OData V4 service (Link to API Hub)). My goal is now to display the description of the product in a Fiori Elements list report in addition to the product (One column product and one column description). The external OData service offers an association with the different languages for the description of the products.
My problem now is that I can't resolve the association correctly via the language, so I have a 1:1 relationship which I can consume in the Fiori Elements app (Listreport). Unfortunately, I could not find anything in the CAP documentation. The description should also be searchable via the filter bar.
Does CAP perhaps support an out-of-the-box solution here? Somehow with localised data?
Here is my service.cdsusing { CE_PRODUCT_0002 as Product } from './external/CE_PRODUCT_0002.csn';
service MyService{
@readonly
entity Products as projection on Product.Product {
Product as Product,
ProductType as ProductType,
_ProductDescription
}
@readonly
entity ProductDescriptions as projection on Product.ProductDescription{
ProductDescription,
Language,
Product
} and here my service.js
this.on("READ", Products, async (req: Request, next: any) => {
return PRODsrv.tx(req).run(req.query);
});
this.on("READ", ProductDescriptions, async (req: Request, next: any) => {
return PRODsrv.tx(req).run(req.query);
});
I am thankful for your support
Best regards