How to call bound functions / actions inside Java client using SAP Cloud SDK?

Matija Lazar

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

Artyom Kovalyov

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Generate VDM for SFSF using Java in SAP Cloud SDK: "Failed to convert response into ODataFeed""

From Java

Generate VDM for SFSF using Java in SAP Cloud SDK: Generated URI is wrong

From Java

Scanner How to Call inside the TextArea using Java

From Java

How to fix a DestinationAccessException thrown by the SAP Cloud SDK during application startup

From Java

How to avoid a DestinationAccessException when sending a POST request to an OData service using SAP Cloud SDK version 3.2.0

From Dev

How to call an action on a route using closure actions?

From Dev

Does Spring Cloud Feign client call execute inside hystrix command?

From Dev

Firebase: how to connect client SDK to cloud functions served locally?

From Dev

How do I access OData service using the SAP S/4HANA Cloud SDK in existing application?

From Dev

SAP RFC call using java spring application

From Dev

Call .dll functions using Java

From Dev

How to get the eTag(MetaData) from a DocumentInfoRecord get() call in SAP Cloud SDK for javascript?

From Dev

Google Cloud SDK Python Client: How to list files inside of a Cloud Storage bucket?

From Dev

How to use geofirex inside google cloud functions

From Dev

How to execute integrationtests for own OData service in SAP Cloud SDK

From Dev

Calling BAPI from Java using SAP Cloud SDK version 3.0

From Dev

Java SDK ignores sap-client property of Destionation on metadata request

From Dev

SAP Cloud SDK for javascript using the destination

From Dev

How do I handle the need for CSFR token when using SAP Cloud SDK?

From Dev

How do I use Firebase Admin SDK to change data in Firebase Realtime Database while using Cloud Functions?

From Dev

How to call SAP web service in Java?

From Dev

Getting JSON parser error when using sap-cloud-sdk

From Dev

How to get user info and authorities in SAP Cloud SDK 3.0 and above

From Dev

How to call an Express function in Google Cloud Functions?

From Dev

How to call Java/Kotlin GCP Cloud Functions from Android

From Dev

How to call function inside .map() using Streams in Java

From Dev

Using async/await inside firebase cloud functions

From Dev

Deploying firebase cloud functions using github actions

From Dev

Is it bad to use client SDK in backend? (Firebase cloud functions)

Related Related

  1. 1

    Generate VDM for SFSF using Java in SAP Cloud SDK: "Failed to convert response into ODataFeed""

  2. 2

    Generate VDM for SFSF using Java in SAP Cloud SDK: Generated URI is wrong

  3. 3

    Scanner How to Call inside the TextArea using Java

  4. 4

    How to fix a DestinationAccessException thrown by the SAP Cloud SDK during application startup

  5. 5

    How to avoid a DestinationAccessException when sending a POST request to an OData service using SAP Cloud SDK version 3.2.0

  6. 6

    How to call an action on a route using closure actions?

  7. 7

    Does Spring Cloud Feign client call execute inside hystrix command?

  8. 8

    Firebase: how to connect client SDK to cloud functions served locally?

  9. 9

    How do I access OData service using the SAP S/4HANA Cloud SDK in existing application?

  10. 10

    SAP RFC call using java spring application

  11. 11

    Call .dll functions using Java

  12. 12

    How to get the eTag(MetaData) from a DocumentInfoRecord get() call in SAP Cloud SDK for javascript?

  13. 13

    Google Cloud SDK Python Client: How to list files inside of a Cloud Storage bucket?

  14. 14

    How to use geofirex inside google cloud functions

  15. 15

    How to execute integrationtests for own OData service in SAP Cloud SDK

  16. 16

    Calling BAPI from Java using SAP Cloud SDK version 3.0

  17. 17

    Java SDK ignores sap-client property of Destionation on metadata request

  18. 18

    SAP Cloud SDK for javascript using the destination

  19. 19

    How do I handle the need for CSFR token when using SAP Cloud SDK?

  20. 20

    How do I use Firebase Admin SDK to change data in Firebase Realtime Database while using Cloud Functions?

  21. 21

    How to call SAP web service in Java?

  22. 22

    Getting JSON parser error when using sap-cloud-sdk

  23. 23

    How to get user info and authorities in SAP Cloud SDK 3.0 and above

  24. 24

    How to call an Express function in Google Cloud Functions?

  25. 25

    How to call Java/Kotlin GCP Cloud Functions from Android

  26. 26

    How to call function inside .map() using Streams in Java

  27. 27

    Using async/await inside firebase cloud functions

  28. 28

    Deploying firebase cloud functions using github actions

  29. 29

    Is it bad to use client SDK in backend? (Firebase cloud functions)

HotTag

Archive