1

I know we can use classes ODataXXXRequestBuilders to issue "CUD" ODATA operations, but how about "Function Import"? Regarding a custom "Function Import" ODATA API, how to use S/4HANA SDK to issue the request and get the returned result? I cannot find any example for this. Or is it not supported? Thanks very much.

Eric Jiang
  • 567
  • 1
  • 7
  • 20

1 Answers1

0

From your question I can derive that you use the SAP Cloud Platform SDK for Service Development.

In order to invoke functions imports in a convenient manner, we recommend to use the Virtual Data Model (VDM) for OData provided by the SAP S/4HANA Cloud SDK.

Leveraging this VDM you call OData APIs (including function imports) in a type-safe manner. You may check out the introduction to the VDM and the deep dive focusing on custom OData services.

Emdee
  • 1,689
  • 5
  • 22
  • 35
  • Hi Emdee, thanks very much for the reply. In fact, I also tried the way of VDM. However, I can generate the VDM code successfully but there are too many syntax errors in the generated source code. I have no idea how to trouble shoot these syntax errors, any tips for that? – Eric Jiang Mar 18 '19 at 08:54
  • Have a look at [this answer](https://stackoverflow.com/a/55118431/3275009). – Christoph Schubert Mar 18 '19 at 09:09
  • In case the answer provided by Christoph does not help, kindly create another question to address these syntax errors. – Emdee Mar 18 '19 at 09:35
  • Thanks very much, Christoph, it really helps. – Eric Jiang Mar 18 '19 at 09:44