cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 valueHelp, distinct Values with OData-Service

Former Member
0 Kudos

Helloes,

I have a question regarding implementing valueHelp in SAP UI5 with distinct values coming from OData.

The following is my architecture/setting:

1. Frontend (Browser) --calls--> 2. Fiori APP (SAP Gateway) --uses--> 3. OData-Serice (SAP Gateway) --routes--> 4. OData-Serice (XS Engine, SAP HANA) --reads-> 5. Scripted Calculation View (HANA)

The OData-Service provides me with an EntitySet "ArticleSet" with the Entity "Article" with the ( not all) properties "matnr" "material group", etc.. etc.."

In my SAP UI5 - application i have a table that is bound against the EnitySet "ArticleSet" and shows all the articles the OData-Service provides me.

The Binding of that table to the OData-Service is filtered with a filterBar, that has filter on "material group". In this Filter I am implementing a valueHelp.

My Question:

If i normally bind the property "materialgroup" to the column of the valueHelp i naturally get a big amount of non distinct values of "material group". I want a distinct amount of all the material groups the OData-Service provides me. I Know that i can implement some frontend-javascript-logic to do that, or let the OData-Service provide another EntitySet that holds the distinct materialgroups.

But isnt there a more "nice" way? Having this as a functionality of SAP UI5 or the definition of ODATA? Can anyone give advice on that?

thanks in advance, if you need more information, just ask .

Martin

Accepted Solutions (1)

Accepted Solutions (1)

former_member227918
Active Contributor
0 Kudos

Hello,

I am concluding this issue as below points

1: If distinct values are not coming from oData service itself( issue with query while fetching the records in backend code)

this issue can be handled by using DELETE ADJACENT DUPLICATES, check below,

abap - Extracting unique values from an internal table - Stack Overflow

2: If once valuehelp popup opened on the screen and while scrolling the results table, values are getting repeated(same values coming again and again).

this issue can be handled by Implementing for $skip and $top query option, check below:

3: In case of xsjs code, you can write a select query with where condition to get the distinct record from views.

apologize if I understood wrong;)

Regards,

Akhilesh

Former Member
0 Kudos

Hello,

thanks for your help.

Using $Skip in the URL of the ODATA Service, as it gets called by the SAP UI5 app etc. is not applieable to our case.

Using ABAP-Coding in the DPC of the Gateway OData-Service is of course possible, but its connected with implementation during the "data route". The Data we select is located in Tables on our HANA. The Gateway just has the task to route the ODATA from HANA and to give a single point of entry for all the other Services. If possible i would like to avoid implementation logic in the gateway.

so that would take a lot of coding in the XS-Engine...

I hoped that there is some built-in Fiori mechanismn that selects the distinct values of a column/Entityset in the OData-Model the OData-Service provides. Is there any mechanismn you know of?

Thanks and greetings

Martin

Answers (1)

Answers (1)

former_member868537
Discoverer
0 Kudos

Hi
I have a same requirement, If you got the answer please let me know