I have question regarding SAP Cloud SDK. First of all, I need to say that this is one really good library for consuming OData services and I just wanted to pointed that you are doing good job! Tutorials on generating VDMs and other stuff are simply awesome!
Onto the question. How can I call Bound Functions or Actions from client? I have searched/watched videos and only thing I found was that on May 5, 2020 in video SAP Cloud SDK: Update Call for SAP Community you said that Bound functions are not yet supported. What is the status of that and how could I implement client using bound functions?
Hope you will be able to help me. Matija
P.S. Get All, Get By Key, Post, Patch, Delete, Unbound Functions and Actions work FLAWLESS
Thanks for the kind words about the SDK! That is a great encouragement for the team.
We're actively working on supporting OData v4 bound functions/actions at the moment. The type-safe support for these operations should be released rather soon. Preliminary you can expect it between the end of March and the beginning of April, no guarantees though. We'll communicate it via our release notes.
As a workaround, you can leverage our generic OData client, which already provides support for the bound function and action calls.
Here is a generic code snippet to make such a call:
// this code will build the following URL:
// "/service/Entity(key1='foo%2Fbar',key2=123)/Model.Function(param1='foo%2Fbar',param2=123)"
ODataEntityKey key = new ODataEntityKey(ODataProtocol.V4)
.addKeyProperty("key1", "foo/bar")
.addKeyProperty("key2", 123);
ODataFunctionParameters params = new ODataFunctionParameters(ODataProtocol.V4)
.addKeyProperty("param1", "foo/bar")
.addKeyProperty("param2", 123);
ODataResourcePath functionPath =
new ODataResourcePath()
.addSegment("Entity", key)
.addSegment("Model.Function", params);
ODataRequestFunction request =
new ODataRequestFunction("/service", functionPath, null, ODataProtocol.V4);
We hope it helps! Let us know if we can help with anything else.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments