cancel
Showing results for 
Search instead for 
Did you mean: 

SAP MDK Grouping with $select but not visible in App

Ladidudidadacat
Explorer
0 Kudos
529

Hello,

i have an analytic query and when i try something like "$select=Customer" in SAP Gateway Client it gives me a grouped result and everything is fine. But when i try it with my Service in the WEbIDE and have "$select=ClusterName" in my query options for a list there are no values visible 😞

Maybe someone can help me 🙂

Kind Reagrds

Fabian

Accepted Solutions (1)

Accepted Solutions (1)

ashishjain14
Advisor
Advisor
0 Kudos

Can you try setting the checkResults property in you .service configuration file to false and see if that helps.

Answers (2)

Answers (2)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Fabian,

As a workaround, in your MDK .service metadata, please set the Service Option for fixMissingNullValues to true.

"OnlineOptions": {
    "ServiceOptions": {
      "fixMissingNullValues": true
    }
}

This should allow the query to return the result set expected. We are still looking into this further as well from our side.

--Bill

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Fabian,

$select is used to return a subset of fields from the backend. If you are using a v4 service then you can look at using groupby and aggregate. These are not supported in Odata v2.

Another option would be to define an aggregate entity that does the aggregation in the backend and returns that aggregated data. This would work with either v2 or v4 but may require modifying your odata service to add the new entity set and associated backend logic.

--Bill

Ladidudidadacat
Explorer
0 Kudos

Hey Bill,
thanks for anwering. I requested our Basis team to activate OdataV4. I hope that i am somehow able to "convert" myOdata-Service into a V4-Service.
But the thing i dont get when using $select is that is is doing the right things when i call it frm the SAP Gateway. It seems that it is getting the correct data (See screenshot). But i dont really get why this is not visible in my app. Maybe you could help here again? 🙂
screenshot-select.jpg
Kind Regards

Fabian

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Please keep in mind that currently if you want to create an offline MDK application we only support OData v2 services.

Your screenshot appears to show that it is correctly only returning the one column. Can you share the metadata for your list page that you say is not showing anything? Could it be that you are attempting to bind to a property that doesn't exist in the result set when you use the $select?

--Bill

Ladidudidadacat
Explorer
0 Kudos

Thanks Bill. Anish answer solved my issue 🙂
Btw. i am only able to work with online data because i have an error when i try to use an analytic query for offline data. It means something like ID is too long or has values which are not allowed. I guess that the issue is here that my ID is to long. See my screenshot, there is they ID around 80 digits long 😄 You have a good hint here? 🙂
Kind Regards

Fabian

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Fabian,

I would need to see your $metadata for the service. Is that something you can share or possibly directly send? Is it possible the service indicates a max size for your key in the $metadata that is too small for the actual return value?

--Bill

Ladidudidadacat
Explorer
0 Kudos

Hey Bill,

I ws not able to find a way to send you a private message 😞 Maybe i can send you via mail? How can i reach you?

Kind Regards

Fabian

bill_froelich
Product and Topic Expert
Product and Topic Expert

Fabian,

We have reproduced this internally and are looking into it further.

--Bill

Ladidudidadacat
Explorer
0 Kudos

Bill,
Thanks!
Iif i can support you with more info (Metadata, Screenshot, etc.) just give me a hint 🙂
--Fabian