Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Can an OData Service save the value of a selection?

Hello Experts,

My current question is more like a conceptual question. SAPGateway delivers an OData service with an entity type containing the following Properties:

  • ATNAM
  • ATWRT
  • ATWTB

The values of this entityset do never change and are as follows:

ATNAM

ATWRT

ATWTB

FIORI_PRG

BA

Barcelona

FIORI_PRG

BE

Berlin

FIORI_PRG

HA

Havanna

FIORI_TYP

SE

Sessel

FIORI_TYP

ZW

Zweisitzer

FIORI_TYP

DR

Dreisitzer

FIORI_FARBE

BL

Blau

FIORI_FARBE

BR

Braun

FIORI_FARBE

GR

Grün

FIORI_FARBE

SW

Schwarz

FIORI_BEZUGSSTOFF

ST

Stoff

FIORI_BEZUGSSTOFF

KL

Kunstleder

FIORI_BEZUGSSTOFF

NL

Naturleder

In UI5-Frontend, the data is consumed in different lists that filter the values of the property ATNAM and display accordingly the values of ATWTB just like you can see it in here: JS Bin - Collaborative JavaScript Debugging

Now the question: is it possible for this OData service to “be informed” of the selected value from any of these lists?  (assuming that UI5 can send a value).

Clarification: the service has only the get and getentityset methods redefined.  Or same question formulated differently: can the OData service save the result of a selection of a filtered list?

If someone wants to take a look at the metadata, the file can be seen in:  https://goo.gl/pAE4qz

Thank you very much for your support,

Gabriel

Former Member
replied

Hello Gabriel,

As suggested, you can implement a Function Import (passing the first filter as importing parameter and returning the dependent entity's table type) and call the same on the list close event of the facet filter. In the Function Import you can write a select query where you use the importing value in the where clause of the filter and export the table with second dependent entity. Then do the binding in the UI with the result set returned by the function import.

Function Import  - https://help.sap.com/saphelp_nw74/helpdata/en/c5/dc22512c312314e10000000a44176d/content.htm

Example - Let’s code CRUDQ and Function Import operations in OData service!

BR.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question