Building an API out of SAP RFCs

aRFC/sRFC/tRFC/qRFC/pRFC

There a lot of different types of RFCs out there. In general, the type of RFC depends on your use case you are implementing. For now, we focus on sRFC, since those are the predominantly used types for synchronous request/reply communication.

To only demonstrate the capability, we do not implement custom RFCs here but will only use existing RFCs:

  • RFC_PING
  • RFC_PING_AND_WAIT
  • DATE_COMPUTE_DAY

Configure

Let us start with an empty Callable instance.

empty

Endpoints in OpenAPI represent single invokable entities. So we need to create one endpoint per RFC. To do so, we need to click on the create endpoint button. After a short amount of time, a list of all SAP registered RFCs will appear in the dialog.

Those entries can directly be filtered by entering the keyword into the filter textbox.

create_filtered

By clicking the create button, the endpoint gets configured with the selected RFC.

endpoints_created

Now we can inspect the endpoint for further information, like input and output model by simply expanding the endpoint node.

show_model

API definition

This is enough to make this RFC callable. The generated OpenAPI spec is now available under a fixed URL.

openapi_definition

Test the endpoint

Before we are sharing the definition with partners, it is always a good idea to test the endpoint/RFC.

In the run view we can directly invoke the endpoint without leaving the UI.

show_apidefinition

To invoke an endpoint, we can expand the operation and click the Try it out button.

Now an input field appears and allows us to provide a custom input for that operation. In this case, we are using the DATE_COMPUTE_DAY-RFC with the input date 2010-10-10.

input

After executing, we get the actual response back displayed on the same page.

output

Ready for Production

That is it. Now we ready for production use.

callable.cloud

SAP integration just a container away!

Powered by APImeister Consulting GmbH (imprint)