Quantcast
Channel: SCN : Popular Discussions - SAP NetWeaver Gateway Developer Center
Viewing all articles
Browse latest Browse all 1657

Navigation Properties and the $orderby command

$
0
0

Hi All

 

I am trying to sort results using a Gateway OData Service as follows:

 

http://<hostname>:<port>/sap/opu/odata/sap/<Service>/MaterialHeaderSet('ABC')/NP_MatlHeader_SOItem?$expand=NP_SOHeader&$orderby=NP_SOHeader/DocumentDate%20desc,OrderId%20desc&area=SP&sap-ds-debug=true

 

Which means:

a) Find me all the Sales Order Items that are for Material 'ABC' using the Navigation Property 'NP_MatlHeader_SOItem' (Material Header to Sales Order Item using the Property of Material (MATNR) that is common to both MatlHeader and SOItem).

b) Expand to the Sales Order Header using the Navigation Property 'NP_SOHeader' (Sales Order Item to Sales Order Header using the property of OrderId (VBELN) that is common to both SOItem and SOHeader).

c) Order the results using the Properties of 'DocumentDate' (in Descending order) and 'OrderId' (in Descending order) which are contained in the Entity SOHeader and can be navigated to using the Navigation Property 'NP_SOHeader'.

 

The issue I have is that I get the following response:

 

Navigationproperties are not supported in ABAP select options

 

So the Gateway Framework does not support the use of Navigation Properties for specification of the $orderby command.   The exception is thrown at the following point in the Gateway Framework:

 

Exception /IWCOR/CX_DS_INTERNAL_ERROR occurred in Class /IWFND/CL_SODATA_PROCESSOR Method EXPR_NODE_TO_PROPERTY_PATH and Line 26

 

If I try this same command on public OData services such as Northwind, it works fine.  The business requirement behind the query (explained in points A-C above) is not unusual, indeed quite common.

 

Does anyone have suggestions about how I might be able to implement a solution for this?

 

Thanks very much for your consideration of my question.

 

Tony


Viewing all articles
Browse latest Browse all 1657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>