Cannot Access Values from Odata services
-
Carlos Erick Schöttler Tutiven1 year ago #38257
Hi Armin,
We are currently facing an issue while accessing an association we created in the SAP backend. The odata service retrieves the material and it’s associated suppliers.
Unfortunately, we are unable to successfully integrate the structure so that we can incorporate it into the app.
We would like to have the material list as the start screen. When we click on a material, the details should be displayed, and there should be a button called “ToLieferant” that shows the supplier on a new screen or popup.
Our problem is that the fields are not being populated with the correct values; they remain empty. The function call works, but when we are trying to adapt the schema, it’s creating a structure that is missing the relevant fields of the supplier entitySet. The only field we can use has the type of URI and the expected field should be a string.
We would be interested to know how to implement this structure/association in example mentioned above.
Thank you in advance,
Best regards,
C.Schöttler
Attachments:
You must be logged in to view attached files.Armin WinklerHas successfully completed the online course IntroductionHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)1 year ago #38266::Hi Carlos,
if I understand your output structure of the material correctly, then a single material isn’t exactly linked to one supplier but to multiple suppliers which could already be the problem that you’re facing. From my point of view these are the steps that you have to complete to achieve a navigation from the material list as starting point to a single supplier of that material:
- As your material list should be populated by retrieving the material entity set already, you can use our standard client-side business object ‘ITIZ_Utilities’ and its function ‘GetSelectedItem’ to save the chosen material entry from the list into a variable. This process logic should again be already existent if you’ve executed our app wizard ‘TableWithDetails’ beforehand.
- Now you need to execute the read connector call for the material (as shown in your screenshot) to retrieve all the details of the material because only this output structure will include the associated supplier details while the output of the read all connector call contains only the URI field that you mentioned.
- Save the output of your read call to a variable of the same type as is assigned to the output parameter for that connector call. Please note that the standard variable ‘oSelectedData’ created by the app wizard won’t have the additional fields of the associated suppliers per standard as this variable has the output structure of the read all call assigned to it (which – again – only contains the URI field). Therefore, you could either change the data type of that existing variable via the data workbench to the structure of the read call or alternatively, you could use a whole new variable of that structure type.
- If you’re going for the latter option, please keep in mind that you have to adapt the field bindings in your UI accordingly as the form in the details page can no longer be bound to the standard variable ‘oSelectedData’ to populate the form.
- Your detail section needs some kind of list again to display the associated suppliers. The data source for that list would be the field ‘To_Lieferant/results’ as saved in the variable in the previous step.
- After configuring the data source on the supplier list template item, you can do the field bindings to the widget properties as well by clicking on the button with the chain icon on it which is positioned right next to the properties in the respective panel on the righthand side of the UI Designer. This again will give you access to the bound data structure, i.e. a single supplier.
- From here on, the workflow would very much be the same as for choosing a material from the material list and then displaying its details: Again you can save the chosen supplier to a variable that has the supplier structure (like the output parameter of the respective read call) assigned to it and then use it to populate some kind of details form on a dedicated view / dialog. Please repeat the steps from above and adapt your configuration appropriately.
Hope this helps. Please let us know if there’s further questions from your side regarding the implementation.
Kind regards,
Armin
You must be logged in to reply to this topic.