Typically, when creating applications that make use of the SAP S/4HANA Cloud APIs, you start with using the APIs found in SAP Business Hub. Once your application is working against the APIs found in SAP Business Hub, then you would replace the SAP Business Hub with the actual SAP S/4HANA Cloud. This eases the development effort and is ideal when you are trying out a proof-of-concept project. However, there is a small drawback with this approach. The APIs found in SAP Business Hub is read-only. So, it does not allow for CREATE, UPDATE and DELETE operations. In order to alleviate this problem, you could use the OData Mock Service for Business Partner API of SAP S/4HANA Cloud if you are using the Business Partner API.
OData Mock Service
The OData Mock Service for Business Partner API of SAP S/4HANA Cloud is a simple Node.js based project that represents a mock server for the purposes of testing the SAP S/4HANA integration capabilities of SAP S/4HANA Cloud SDK. The mock server makes it possible to test the SAP S/4HANA integration capabilities of SAP S/4HANA Cloud SDK without access to an SAP S/4HANA system. It hosts an OData v2 mock service that mimics the business partner API of SAP S/4HANA Cloud to a limited extent. It can be used as a stand-in for simple tests and experiments with the SAP S/4HANA Cloud SDK.
The functionality of the OData mock service is limited to the most essential features. It is by no means a complete OData service compliant with the OData v2 specification. Few of the limitations are listed below.
- Performs almost no business validations
- Behavior is not comparable at all to SAP S/4HANA Cloud
- No security: no authentication, no CSRF protection
Supported OData operations and capabilities
The OData mock service supports the following features centered around the API_BUSINESS_PARTNER and thus allows to test certain scenarios.
- Entity type Business Partner and Business Partner Address with all properties
- OData queries (GET) on entity sets and by key with query options expand, select, filter and orderby
- Creating (POST), updating (PATCH, PUT) and deleting (DELETE) entities