cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 and SAP B1 Service Layer's Odata v4

Ondřej_Nekvinda
Participant
0 Kudos

Hello,

I would like to know if there is a possibility to connect SAPUI5 Apps directly to the Service Layer? We are looking for a solution deployable to HANA 1.0 On-Premise and in the future also to HANA 2

We were able to login and perform normal ajax requests, but it would be nice to be able to use OData v4 SAPUI5 models and smart controls with direct connection to the Service Layer’s OData v4.

Our problem with that is, so far, that we are unable to force the app to send SL session cookies together with it‘s http requests that are automatically generated after the OData model binding is done. In a simple ajax call we can force it to send the cookies via xhrFields: {"withCredentials": "true"} setting, but we haven‘t found any option to do that for the SAPUI5 odata v4 model and therefore we are always unauthorized.

Is there any solution to this issue? Preferably one that does not involve something like xsjs proxy, we would like to avoid deploying anything else on the HANA Server, except the SAPUI5 application.

Thank You,

Ondřej Nekvinda

View Entire Topic
former_member197733
Contributor
0 Kudos

- On Odata V2, you could specify custom headers upon the model creation.

- On Odata V4, this method isn't available. However, the documentation shows how to update the header of a model(see #changeHttpHeaders). You can use this approach to set the header 'Cookies' with the content provided by SL /Login response.

Overall this is quite ok if you just want to show B1 data on a HTML page, without any custom business logic (ui logic is fine).

That not being the case. I.e, you are building a solution that will communicate with SL, it should be better to revaluate your architecture decisions. Business Logic should not be placed on client side code (UI5/Javascript). So, the SL interactions are handled by the server (See here example with HANA 1.0).

MathiasUhlmann
Advisor
Advisor