cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori/UI5 - Use destination for Ajax request (oDataV4)

alegarciamacedo
Explorer
0 Kudos
1,571

Hello, everyone!

Is it possible to send request, with Ajax methods, to oDataV4 using an existing Destination in SCP?

The backend is oDataV4 and, as far as I know, I can't use .read() and others direct methods to get response using the Model. The batch seems to be unavailable in the backend.

So far, the workaround was the use of Ajax requests, but with the complete URI in code, wich I would like to avoid.

It would be more correct to get at least the root URI from Destination config in SCP.

Does anyone had this issue?

Accepted Solutions (1)

Accepted Solutions (1)

arne_b1
Explorer

Hi,

that is right. The ODataV4 model only supports data access using bindings. You can not directly access any data.

But of course you can instead use Ajax. To get the root uri from an existing destination you have to configure the neo-app.json. This blog post might help you: https://blogs.sap.com/2018/07/10/how-to-read-data-using-ajax-call/.

Best Regards

Arne

alegarciamacedo
Explorer
0 Kudos

Thank you, Arne!
It worked just fine.

Answers (0)