The SAP Business ByDesign OData API for Business Objects is designed for user centric applications to access business objects in SAP Business ByDesign.
The OData API provides you with additional metadata to ease UI development, such as localized field labels, code descriptions, value help support.
In addition the API supports typical navigations between business object nodes like “from header to detail”, navigations to associated business objects (for example “from sales order item to product details”) and efficient fine grained data access.
The authentication using business users enable you to combine frontend single sign-on and principal propagation using OAuth to benefit from the role-based authorization management of ByD. Of course you can use basic authentication (user/password) as well.
Using the work center view “Application and User Management – OData Services”, key users are empowered to decide which business objects, business object elements and actions are exposed via OData APIs. Those Custom OData Services may cover the OData-enabled part of the Public Solution Model (PSM) of ByD, key user extension fields and SAP Cloud Applications Studio Add-ins.
You find more information in the SAP Business ByDesign Help Portal by searching with key words “OData User Guide”.
API Sample Packages
To get some hands-on experience using the OData API for Business Objects you find a repository of API Examples on GitHub: SAP Business ByDesign – API Usage Samples.
The repository is structured in API sample packages. Each package contains Postman collections, a Postman environment and all ByD Custom OData Services required to run the OData requests of the Postman collection.
All sample Postman collections are tailored to SAP Business ByDesign Partner Demo Tenants (Full scope US) with preconfigured and loaded sample data provided by SAP.
Nevertheless you can use the Postman collections and sample Custom OData Services in other ByD systems as well, if you adopt Postman environment variables and Postman requests according the business configuration and master data of your ByD system.
The following API sample packages are available:
- End-to-End Scenarios: Run ByD business processes using APIs to get insights how to create, change and read involved business documents and how to create business document relationships to achieve a meaningful document flow
- Lead to Opportunity to Quote
- Selling Services
- Field Service and Repair
- Procure to Stock
- Sell from Stock
- Drop Shipment
- Make to Stock
- Clear Due Items using Bank Statements
- Projects: Create, change and read cost collecting projects and customer projects
- Cost collecting projects with task hierarchies
- Cost collecting projects with team and work
- Customer projects with planning data
- Selling project-based services incl. sales order, project and project time recordings
- Sales Orders: Create, change and sales orders; contains examples to use business object attachments as well
- Analytics: Access ByD built-in analytics incl. reports and data sources
- Product and Service Portfolio: Create, change and read price lists and discount lists
- Product Data: Create, change and read materials and service products
Please check the description of the respective Postman collection for further details about the individual steps performed for each scenario.
How to run an API Sample Scenario?
The easiest way to run an API sample scenario would be using a SAP Business ByDesign Partner Demo Tenant (Full scope US) with preconfigured and loaded sample data provided by SAP.
The following example is based on such a tenant and I am running the scenario “End-to-End Scenarios – Procure to Stock“:
- Install the API sample package “End-to-End Scenarios” and configure your ByD system following the instructions in chapters “Download and Installation” and “Configuration” of the GitHub repository readme file.
- Open the Postman Runner and select the collection “End-to-End Scenarios”, the collection folder “Procure to Stock” and the environment “ByD End-to-End Scenarios …“:
- Click on “Run Procure to Stock” and see the process flow:
If you are using OData services the first time or after ByD upgrades/patches you may need to start the process twice, because my settings in Postman might be too short for recompiling ByD objects.
For more detailed analysis you can open the Postman Console to log detailed traces or simply execute the requests one-by-one in the Postman collection itself.
By the way:
The sample Postman collections may serve as well as approach to create meaningful data along process chains to prepare a ByD system for demo purposes, or to run regression tests by processing end-to-end business processes.
Blog Posts with further Examples
- Extend SAP ByDesign using SAP Cloud Platform HTML5 Applications
- Configure OAuth 2.0 for SAP ByDesign OData Services
- OData Example: Read and Write Product Purchasing Data
- OData Example: Create and Update Product Data in ByD
- Create ByD Sales Orders using Alexa
- Alexa Meets SAP Business ByDesign
- SAP Business by Design – How to Create an OData Service (Youtube)
- SAP Business ByDesign Side-by-Side Extensions on SAP Cloud Platform