Calling SAP BAPIs from Google Sheets
Integrating external systems into Google Sheet can be done through the AppScript system available through the “script editor”.
A prerequisite for this tutorial is a Callable instance which is already connected to an SAP system. In this case, we are using a Google Cloud Run hosted runtime to make API calls available.
Starting with an empty Sheet
Starting with an empty sheet, you need to open the script editor through the “tools -> Script editor” menu entry.
Script for API invocation
The full AppScript can be downloaded from the following GitHub gist. You just need to paste the script into the editor window and save the project.
The endpoint
still needs to be replaced with your endpoint.
Calling a BAPI within Sheets
After navigating back to the sheet, you can invoke the function with the parameters for rfcName
and payload
.
=invokeRFC("BAPI_FLIGHT_GETLIST")
With the second parameter, you can control, how the BAPI is called. The BAPI_FLIGHT_GETLIST
BAPI, for example, supports filtering by arbitrary criteria.
That is it for now. If you need more integration let us know under contact@callable.cloud.