Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8704

How to map a single entity returned by an oData service to a table

$
0
0

Hi,

 

I am using an oData service which returns only a single entity in navigation i.e. for ex a Product can be provided by only one supplier so the navigation property will only return a single entity and not a collection or a set.

 

How should I bind this to a table?

 

Ex oData service URL:

 

https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/ProductCollection('HT-1000')/Supplier

 

this will return only a single record/entity and as such the normal binding code :

 

oTable.setBindingContext(context);

 

oTable.bindRows("Supplier");

 

will not work as it always expects a collection and in ui5 all oData service calls append "$skip=0&$top=1&$inlinecount=allpages" to the URI which will make the URI like :

 

https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/SalesOrderCollection(https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/ProductCollection('HT-1000')/Supplierr?$skip=0&$top=1&$inlinecount=allpages

 

which will give an error : System query options '$orderby,$skip,$top,$skiptoken,$inlinecount,' are not allowed in the requested URI

 

Can any one help me on this issue ASAP.

Thanks in advance.

 

Regards,

Manish


Viewing all articles
Browse latest Browse all 8704