Search code examples
s4sdk

How to send Function Import request via S/4HANA SDK?


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.


Solution

  • 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.