OData Example: Create and Update Product Data in SAP Business ByDesign (2024)

SAP Business ByDesign(ByD) provides you withREST/ODataaccess to product (material and service) business objects. This blog post provides you with an sample round trip example (create – read – update – delete) using ByD OData services for product business objects.

For details about ByD OData API usage samples along with prepackaged OData examples please refer to blogSAP Business ByDesign – API usage samples

Toget some hands-on experience using theOData API for Business Objectsyou find some examples in the GitHub repositorySAP Business ByDesign – API Usage Samples.

The GitHub repository has sample OData API packages. Product Data package containsPostman collections,aPostman environmentand all ByDCustom OData Servicesrequired to run the OData requests of the Postman collection.

Note:for the detailed steps of Product Data Postman collection please refer toREADME file in the GitHub repository

Example Scenario

In the example we are creating reading updating Materials and Service products using SAP Business ByDesign Custom OData Services. For details refer to demo video.

In the material maintenance scenario we are creating and updating the following information of material.

  • Create material with General information like ID, Description, Product Category, Identified stock type, Base UoM and quantity conversion data
  • Updates material with Purchasing data like purchasing unit of measure and sets the purchasing status to active
  • Updates material with Logistics data like logistics unit of measure, sites info and sets the logistics status to active
  • Updates material with Planning data like Planning Area ID, Default Procurement Method, Supply Planning Procedure, Lot Size Procedure Code and sets the planning areas status to active
  • Updates material with Availability Confirmation data like Planning Area ID, Availability Check Scope and sets the planning areas status to active
  • Updates material with Sales data like Item Group, Cash Discount Allowed indicator and sets the Distribution Chains status to active
  • Updates material with Sales data like Valuation Level Type, Company, Business Residence and sets the valuation status to active
  • Updates material with product tax classification data and deletes product tax classification data

In the service product maintenance scenario we are creating and updating the following information of service.

  • Create service with General information like ID, Description, Product Category, Identified stock type, Base UoM and quantity conversion data
  • Updates service with Purchasing data like purchasing unit of measure and sets the purchasing status to active
  • Updates service with Sales data like Item Group, Cash Discount Allowed indicator and sets the Distribution Chains status to active
  • Updates service with Sales data like Valuation Level Type, Company and sets the valuation status to active

ProductsCustom OData Services can be created in two ways:

Option 1:upload the Custom OData Services as explained in the configuration section ofREADME file in the GitHub repository.

Option 2: create the Custom OData Services in as explained in below stepsExpose ByD Materials as OData Service and Expose ByD Service Product as OData Service.

Expose ByD Materials as OData Service

Open work center viewApplication and User Management – OData Servicesand create aCustom OData Servicefor business objectMaterial.

Make sure you expose material properties that enable you to create, filter, read and update all relevant material data incl. nodes Root,MaterialCrossProcessCategory,ProcurementProcessInformation,QuantityConversion,MaterialInventoryProcessInformation,MaterialAvailabilityConfirmationProcessInformation,MaterialSupplyPlanningProcessInformation,MaterialSalesProcessInformation,MaterialFinancialProcessInformation andMaterialDeviantTaxClassification. In my example I included the following elements to my Custom OData Service “vmumaterial“:

  • InternalID
  • UUID
  • Description(incl.contentandlanguageCode)
  • BaseMeasureUnitCode
  • IdentifiedStockTypeCode
  • ProductValuationLevelTypeCode
  • ProcurementProcessInformation(embedded in collectionMaterial)
    • ProcurementMeasureUnitCode
    • ProcurementLifeCycleStatusCode
  • MaterialCrossProcessCategory
    • ProductCategoryInternalID
    • Description
    • DescriptionLanguageCode
  • QuantityConversion(created as separate collectionMaterialQuantityConversionwith all elements)
    • CorrespondingQuantity
    • CorrespondingQuantityUnitCode
    • BatchDependentIndicator
    • Quantity
    • QuantityUnitCode
  • ProcurementProcessInformation(embedded in collectionMaterial)
    • ProcurementMeasureUnitCode
    • ProcurementLifeCycleStatusCode
  • MaterialInventoryProcessInformation
    • SiteID
    • LifeCycleStatusCode
  • MaterialSalesProcessInformation
    • SalesOrganisationID
    • DistributionChannelCode
    • LifeCycleStatusCode
    • SalesMeasureUnitCode
    • ItemProcessingTypeDeterminationProductGroupCode
    • CashDiscountDeductibleIndicator
    • MinimumOrderQuantity
  • MaterialFinancialProcessInformation
    • CompanyID
    • PermanentEstablishmentID
    • LifeCycleStatusCode
  • MaterialSupplyPlanningProcessInformation
    • SupplyPlanningAreaID
    • LifeCycleStatusCode
    • DefaultProcurementMethodCode
    • SupplyPlanningProcedureCode
    • LotSizeProcedureCode
  • MaterialAvailabilityConfirmationProcessInformation
    • SupplyPlanningAreaID
    • LifeCycleStatusCode
    • AvailabilityConfirmationModeCode
  • MaterialDeviantTaxClassification
    • CountryCode
    • RegionCode
    • TaxExemptionReasonCode
    • TaxRateTypeCode
    • TaxTypeCode

Please note: In my example I changed some property names to align with UI element names for better usability.

OData Example: Create and Update Product Data in SAP Business ByDesign (1)

OData Example: Create and Update Product Data in SAP Business ByDesign (2)

Activate your custom OData service and note down theService URLfrom the OData Editor. In my example the service URL is

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial andhttps://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterialvaluationdata

If needed you can retrieve the metadata using the metadata URL

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/$metadata

Note: replace the{{TenantHostname}} with ByD tenant host name, example:my123456.sapbydesign.com

Create and Update Material General Information using the Custom OData Service

In the custom OData service select the general information relevant fields in co-relation with UI fields in general section of material.

OData Example: Create and Update Product Data in SAP Business ByDesign (3)

OData Example: Create and Update Product Data in SAP Business ByDesign (4)

Step 1: Create material

Using the http-method POST and entity setMaterialCollectionyou can create ByD materials and include header information like InternalID, BaseMeasureUnitCode, ProductCategoryID along with Description and Purchasing information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection

In my example I’m using the JSON body

{"InternalID": "{{MaterialID}}", "BaseMeasureUnitCode": "EA", "IdentifiedStockTypeCode": "01", "Description": "VMU Material", "languageCode": "EN", "ProductValuationLevelTypeCode": "1", "ProcurementMeasureUnitCode": "EA", "ProcurementLifeCycleStatusCode": "1", "MaterialCrossProcessCategory": { "ProductCategoryInternalID": "103" }}

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to create the material via POST service call ( note: the x-csrf-token is fetched in the GET service call , for details refer to postman example collection ).
  • Note: ProductCategoryInternalID should be the valid and existing id in system.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (5)

As you can see the material is created with relevant information.

Details about x-csrf-token:

  • SAP Business ByDesign System generates a CSRF token and sends it back in the HTTP response header field X-CSRF-Token.
    This happens in a non-modifying request (such as GET) if the header field X-CSRF-Token with the value Fetch is sent along with the non-modifying request.
  • Note: CSRF (Cross Site Request Forgery) token is a random, hard-to-guess string. the server would generate a random string and is stored in the session or by setting a cookie containing the value
  • For example Steps to Follow:
  • Step 1: call the Get service by setting the Header key field “x-csrf-token” with value “fetch”
  • Step 2: in the HTTP response header of above GET service call you read the field value “x-csrf-token”
  • Step 3: in the subsequent POST calls use the x-csrf-token .

Read and Update Material Procurement Data using the Custom OData Service

In the custom OData service select the procurement relevant fields in co-relation with UI fields in purchasing section of material.

OData Example: Create and Update Product Data in SAP Business ByDesign (6)

OData Example: Create and Update Product Data in SAP Business ByDesign (7)

Step 1: Get material data

Using the http-method GET and entity setMaterialCollectionyou can filter and read ByD materials and include quantity conversions:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection?$filter=InternalID eq ‘{{MaterialID}}‘&$expand=MaterialQuantityConversion&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{MaterialID}}to filter the materials by the internal ID,
  • $expand=MaterialQuantityConversionto include the product quantity conversions in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (8)

As you can see the material “{{MaterialID}}” has the base unit of measure and procurement unit of measure “Each” and no quantity conversion so far.

Step 2: Create quantity conversion

Before we can change the procurement UoM to a unit that differs from the base UoM, we need to create the quantity conversion between the base UoM and the new procurement UoM. In our example the ratio should be 1 Box corresponds to 42 Each.

Using http-method POST and the parent object ID (material object ID) provided by GET-response in step 1 you can create a new quantity conversion:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialQuantityConversionCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","CorrespondingQuantity": "42","CorrespondingQuantityUnitCode": "EA","Quantity": "1","QuantityUnitCode": "XBX","BatchDependentIndicator": false} 

OData Example: Create and Update Product Data in SAP Business ByDesign (9)
(XBX is the ISO code for “Box”)

Step 3: Update procurement unit of measure

Now we can set the purchasing UoM to “Box” (ISO code “XBX”).

We are again using http-method PATCH with the material object ID provided by the GET-response in step 1:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}", "ProcurementMeasureUnitCode": "XBX"}

OData Example: Create and Update Product Data in SAP Business ByDesign (10)

Step 4: Activate procurement

Now we can set the purchasing status to active ( ProcurementLifeCycleStatusCode = ‘2’ ).

We are again using http-method PATCH with the material object ID provided by the GET-response in step 1:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}", "ProcurementLifeCycleStatusCode": "2"}

OData Example: Create and Update Product Data in SAP Business ByDesign (11)

Step 5:Get the updated material data

Similar to step 1 we again get entity setMaterialCollection,filter by the material ID and expand the response by material quantity conversions:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection?$filter=InternalID eq ‘{{MaterialID}}‘&$expand=MaterialQuantityConversion&$format=json

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (12)

As you can see the material “{{MaterialID}}” now has the procurement unit of measure “Box” with procurement status “active” and a material quantity conversion node instance for the conversion between Each and Box.

Read and Update Material Logistics Data using the Custom OData Service

In the custom OData service select the Inventory information relevant fields in co-relation with UI fields in Logistics section of material.

OData Example: Create and Update Product Data in SAP Business ByDesign (13)

OData Example: Create and Update Product Data in SAP Business ByDesign (14)

Step 1: Get material data

Using the http-method GET and entity setMaterialCollectionyou can filter and read ByD materials and include material logistics information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection?$filter=InternalID eq ‘{{MaterialID}}‘&$expand=MaterialInventoryProcessInformation&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{MaterialID}}to filter the materials by the internal ID,
  • $expand=MaterialInventoryProcessInformationto include the logistics information in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (15)

As you can see the material “{{MaterialID}}” has the no material logistics / inventory process information so far.

Step 2: Create site

We can create and associate site information to material.

Using http-method POST and the parent object ID (material object ID) provided by GET-response in step 1 you can create and associate site information to material:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialInventoryProcessInformationCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","SiteID": "P1100"} 

OData Example: Create and Update Product Data in SAP Business ByDesign (16)
Note: SiteID is the valid ID and should be existing in the system.

Step 3: Activate logistics

Now we can set the logistics status to active ( LifeCycleStatusCode = ‘2’ ).

We are again using http-method PATCH with the material object ID provided by the GET-response in step 1:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialInventoryProcessInformationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "LifeCycleStatusCode": "2"}

OData Example: Create and Update Product Data in SAP Business ByDesign (17)

Read and Update Material Planning Data using the Custom OData Service

In the custom OData service select the supply planning information relevant fields in co-relation with UI fields in Planning section of material.

OData Example: Create and Update Product Data in SAP Business ByDesign (18)

OData Example: Create and Update Product Data in SAP Business ByDesign (19)

Step 1: Get material data

Using the http-method GET and entity setMaterialCollectionyou can filter and read ByD materials and include material planning information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection?$filter=InternalID eq ‘{{MaterialID}}‘&$expand=MaterialSupplyPlanningProcessInformation&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{MaterialID}}to filter the materials by the internal ID,
  • $expand=MaterialSupplyPlanningProcessInformationto include the planning information in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (20)

As you can see the material “{{MaterialID}}” has the no material planning process information so far.

Step 2: Create planning areas

We can create and associate planning area information to material.

Using http-method POST and the parent object ID (material object ID) provided by GET-response in step 1 you can create and associate MaterialSupplyPlanningProcessInformation to material:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSupplyPlanningProcessInformationCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","SupplyPlanningAreaID": "P1100"}

OData Example: Create and Update Product Data in SAP Business ByDesign (21)
Note: SupplyPlanningAreaID is the valid planning area ID and should be existing in the system.

Step 3: Get planning areas

Using the http-method GET and entity set MaterialSupplyPlanningProcessInformationCollection you can get the instance details of planning area information created in previous step and read material planning area information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSupplyPlanningProcessInformationCollection(‘{{ObjectID}}’)?$format=json

In my example I’m using the URL parameter

  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (22)

As you can see the material “{{MaterialID}}” has the planning process information which was created in previous step.

Step 4: Update planning areas

Now we can update the planning information details of material likeDefaultProcurementMethodCode,SupplyPlanningProcedureCode, LotSizeProcedureCode.

We are again using http-method PATCH with the material object ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSupplyPlanningProcessInformationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "DefaultProcurementMethodCode": "3", "SupplyPlanningProcedureCode": "1", "LotSizeProcedureCode": "1"} 

OData Example: Create and Update Product Data in SAP Business ByDesign (23)

Step 5: Activate planning

Now we can set the planning status to active ( LifeCycleStatusCode = ‘2’ ).

We are again using http-method PATCH with the material object ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSupplyPlanningProcessInformationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "LifeCycleStatusCode": "2"} 

OData Example: Create and Update Product Data in SAP Business ByDesign (24)

Read and Update Material Availability Confirmation Data using the Custom OData Service

In the custom OData service select the availability confirmation information relevant fields in co-relation with UI fields in Availability Confirmation section of material.

OData Example: Create and Update Product Data in SAP Business ByDesign (25)

OData Example: Create and Update Product Data in SAP Business ByDesign (26)

Step 1: Get material data and expand

Using the http-method GET and entity setMaterialCollectionyou can filter and read ByD materials and include material planning information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection?$filter=InternalID eq ‘{{MaterialID}}‘&$expand=MaterialAvailabilityConfirmationProcessInformation&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{MaterialID}}to filter the materials by the internal ID,
  • $expand=MaterialAvailabilityConfirmationProcessInformationinclude the availability confirmation information in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (27)

As you can see the material “{{MaterialID}}” has the no material availability process information so far.

Step 2: Create planning areas

We can create and associate planning area information to material.

Using http-method POST and the parent object ID (material object ID) provided by GET-response in step 1 you can create and associate MaterialAvailabilityConfirmationProcessInformationCollectionto material:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialAvailabilityConfirmationProcessInformationCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","SupplyPlanningAreaID": "P1100"}

OData Example: Create and Update Product Data in SAP Business ByDesign (28)
Note: SupplyPlanningAreaID is the valid planning area ID and should be existing in the system.

Step 3: Get planning areas

Using the http-method GET and entity set MaterialAvailabilityConfirmationProcessInformationCollectionyou can get the instance details of planning area information created in previous step and read material planning area information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialAvailabilityConfirmationProcessInformationCollection(‘{{ObjectID}}’)?$format=json

In my example I’m using the URL parameter

  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (29)

As you can see the material “{{MaterialID}}” has the availability confirmation process information which was created in previous step.

Step 4: Update planning areas

Now we can update the planning information details of material like AvailabilityConfirmationModeCode .

We are again using http-method PATCH with the material object ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSupplyPlanningProcessInformationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "AvailabilityConfirmationModeCode": "A11"} 

OData Example: Create and Update Product Data in SAP Business ByDesign (30)

Step 5: Activate availabilityconfirmation

Now we can set the availability confirmation status to active ( LifeCycleStatusCode = ‘2’ ).

We are again using http-method PATCH with the material object ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSupplyPlanningProcessInformationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "LifeCycleStatusCode": "2"} 

OData Example: Create and Update Product Data in SAP Business ByDesign (31)

Read and Update Material Sales Data using the Custom OData Service

In the custom OData service select the sales information relevant fields in co-relation with UI fields in Sales section of material.

OData Example: Create and Update Product Data in SAP Business ByDesign (32)

OData Example: Create and Update Product Data in SAP Business ByDesign (33)

Step 1: Get material data and expand

Using the http-method GET and entity setMaterialCollectionyou can filter and read ByD materials and include material planning information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection?$filter=InternalID eq ‘{{MaterialID}}‘&$expand=MaterialSalesProcessInformation&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{MaterialID}}to filter the materials by the internal ID,
  • $expand=MaterialSalesProcessInformationinclude the sales information in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (34)

As you can see the material “{{MaterialID}}” has the no material sales process information so far.

Step 2: Create distribution chains

We can create and associate sales information with distribution chains to material.

Using http-method POST and the parent object ID (material object ID) provided by GET-response in step 1 you can create and associate MaterialSalesProcessInformationto material:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSalesProcessInformationCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","SalesOrganisationID": "P1110","DistributionChannelCode": "01"}

OData Example: Create and Update Product Data in SAP Business ByDesign (35)
Note: SalesOrganisationID and DistributionChannelCode is the valid ID and should be existing in the system.

Step 3:Get distribution chains / sales info

Using the http-method GET and entity set MaterialSalesProcessInformationyou can get the instance details of sales process information created in previous step and read material sales process info:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSalesProcessInformationCollection(‘{{ObjectID}}’)?$format=json

In my example I’m using the URL parameter

  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (36)

As you can see the material “{{MaterialID}}” has the sales process information which was created in previous step.

Step 4: Update distribution chains / sales info

Now we can update the planning information details of material like CustomerTransactionDocumentItemProcessingTypeDeterminationProductGroupCode and CashDiscountDeductibleIndicator.

We are again using http-method PATCH with the material object ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSalesProcessInformationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "CustomerTransactionDocumentItemProcessingTypeDeterminationProductGroupCode": "PICK", "CashDiscountDeductibleIndicator": true} 

OData Example: Create and Update Product Data in SAP Business ByDesign (37)

Step 5: Activate distribution chains / sales info

Now we can set the sales information status to active ( LifeCycleStatusCode = ‘2’ ).

We are again using http-method PATCH with the material object ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialSalesProcessInformationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "LifeCycleStatusCode": "2"} 

OData Example: Create and Update Product Data in SAP Business ByDesign (38)

Read and Update Material Valuation Data using the Custom OData Service

In the custom OData service select the financials information relevant fields in co-relation with UI fields in Valuation section of material.

OData Example: Create and Update Product Data in SAP Business ByDesign (39)

OData Example: Create and Update Product Data in SAP Business ByDesign (40)

Step 1: Get material data and expand

Using the http-method GET and entity setMaterialCollectionyou can filter and read ByD materials and include material planning information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection?$filter=InternalID eq ‘{{MaterialID}}‘&$expand=MaterialFinancialProcessInformation&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{MaterialID}}to filter the materials by the internal ID,
  • $expand=MaterialFinancialProcessInformationinclude the valuation information in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (41)

As you can see the material “{{MaterialID}}” has the no material valuation information so far.

Step 2: Create companies and business residence

We can create and associate valuation information with company and business residence to material.

Using http-method POST and the parent object ID (material object ID) provided by GET-response in step 1 you can create and associate CompanyID and PermanentEstablishmentID to material:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialFinancialProcessInformationCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","CompanyID": "1000","PermanentEstablishmentID": "P1100 "}

OData Example: Create and Update Product Data in SAP Business ByDesign (42)
Note: CompanyID and PermanentEstablishmentID is the valid ID and should be existing in the system.

Step 3: Get companies and business residence

Using the http-method GET and entity set MaterialFinancialProcessInformationCollectionyou can get the instance details of valuation information created in previous step and read material financial process info:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialFinancialProcessInformationCollection(‘{{MaterialFinancialProcessObjectID}}’)?$format=json

In my example I’m using the URL parameter

  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (43)

As you can see the material “{{MaterialID}}” has the valuation / financial process information which was created in previous step.

Step 4: Query material valuation data

In the material Valuation section to update the Account Determination field value, user has to create a custom OData service on business object MaterialValuationData.

OData Example: Create and Update Product Data in SAP Business ByDesign (44)

OData Example: Create and Update Product Data in SAP Business ByDesign (45)

Using the http-method GET and queryMaterialValuationDataQueryByMaterialIDyou can filter and read the material valuation data information like AccountDeterminationMaterialValuationDataGroupCode:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterialvaluationdata/MaterialValuationDataQueryByMaterialID?MaterialID='{{MaterialID}}’

In my example I’m using the URL parameter

  • MaterialID=’{{MaterialID}}‘ to filter the materials by the internal ID

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.
  • Accept=application/json

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (46)

Step 5: Read material valuation data

Using the http-method GET and entity set MaterialValuationDataCollection you can filter and read ByD material valuation data and include.

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterialvaluationdata/MaterialValuationDataCollection?$filter=ObjectID eq ‘{{MVDObjectID}}‘&$expand=MaterialValuationDataAccountDeterminationSpecification&$format=json

In my example I’m using the URL parameter

  • $filter=ObjectID eq ‘{{MVDObjectID}}to filter the material valuation data by the MVDObjectID,
  • $expand=MaterialValuationDataAccountDeterminationSpecificationinclude the Account Determination GroupCodeinformation in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (47)

Read and Update Material Product Tax Classification using the Custom OData Service

In the custom OData service select the DeviantTaxClassification relevant fields in co-relation with UI fields in Product Tax Classification section in Taxes tab of material.

OData Example: Create and Update Product Data in SAP Business ByDesign (48)

OData Example: Create and Update Product Data in SAP Business ByDesign (49)

Step 1: Get material data and expand

Using the http-method GET and entity setMaterialCollectionyou can filter and read ByD materials and include material product tax classification:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection?$filter=InternalID eq ‘{{MaterialID}}‘&$expand=MaterialDeviantTaxClassification&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{MaterialID}}to filter the materials by the internal ID,
  • $expand=MaterialDeviantTaxClassificationinclude the sales information in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (50)

As you can see the material “{{MaterialID}}” has the no material tax classification information so far.

Step 2:Create product tax classification

We can create product tax classification information.

Using http-method POST and the parent object ID (material object ID) provided by GET-response in step 1 you can createMaterialDeviantTaxClassificationCollectionto material:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialDeviantTaxClassificationCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","CountryCode": "DE","RegionCode": "11","TaxTypeCode": "1","TaxRateTypeCode": "1","TaxExemptionReasonCode": ""}

OData Example: Create and Update Product Data in SAP Business ByDesign (51)
Note: RegionCode, TaxTypeCode andTaxExemptionReasonCodeis the valid data and should be existing in the system.

Step 3: Get product tax classification

Using the http-method GET and entity set MaterialDeviantTaxClassificationCollectionyou can get the instance details of tax information created in previous step and read material tax info:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialDeviantTaxClassificationCollection(‘{{ObjectID}}’)?$format=json

In my example I’m using the URL parameter

  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the material in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (52)

As you can see the material “{{MaterialID}}” has the tax information which was created in previous step.

Step 4: Update product tax classification

Now we can update the tax information details of material like RegionCode, TaxTypeCode andTaxExemptionReasonCode,TaxExemptionReasonCode .

We are again using http-method PATCH with the MaterialDeviantTaxClassificationobject ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialDeviantTaxClassificationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 3>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "CountryCode": "DE", "RegionCode": "", "TaxTypeCode": "1", "TaxRateTypeCode": "3", "TaxExemptionReasonCode": "1"}

OData Example: Create and Update Product Data in SAP Business ByDesign (53)

Step 5: Delete product tax classification

Now we can delete the tax information created in previous steps.

We are again using http-method POST with the MaterialDeviantTaxClassificationobject ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmumaterial/MaterialDeviantTaxClassificationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 3>
  • x-http-method = DELETE

OData Example: Create and Update Product Data in SAP Business ByDesign (54)

Expose ByD Service Product as OData Service

Open work center viewApplication and User Management – OData Servicesand create aCustom OData Servicefor business objectServiceProduct.

Make sure you expose service product properties that enable you to create, filter, read and update all relevant service data incl. nodes Root, ServiceProductCrossProcessCategory,ProcurementProcessInformation,QuantityConversion,ServiceProductSalesProcessInformation,ServiceProductFinancialProcessInformation. In my example I included the following elements to my Custom OData Service “vmuservice“:

  • InternalID
  • UUID
  • Description(incl.contentandlanguageCode)
  • BaseMeasureUnitCode
  • ProductValuationLevelTypeCode
  • ProcurementProcessInformation(embedded in collectionService)
    • ProcurementMeasureUnitCode
    • ProcurementLifeCycleStatusCode
  • ServiceProductCrossProcessCategory
    • ProductCategoryInternalID
    • Description
    • DescriptionLanguageCode
  • ServiceProductQuantityConversion(created as separate collection QuantityConversionwith all elements)
    • CorrespondingQuantity
    • CorrespondingQuantityUnitCode
    • BatchDependentIndicator
    • Quantity
    • QuantityUnitCode
  • ProcurementProcessInformation(embedded in collectionService)
    • ProcurementMeasureUnitCode
    • ProcurementLifeCycleStatusCode
  • ServiceProductSalesProcessInformation
    • SalesOrganisationID
    • DistributionChannelCode
    • LifeCycleStatusCode
    • SalesMeasureUnitCode
    • ItemProcessingTypeDeterminationProductGroupCode
  • ServiceProductFinancialProcessInformation
    • CompanyID
    • PermanentEstablishmentID
    • LifeCycleStatusCode

Please note: In my example I changed some property names to align with UI element names for better usability.

OData Example: Create and Update Product Data in SAP Business ByDesign (55)

OData Example: Create and Update Product Data in SAP Business ByDesign (56)

Activate your custom OData service and note down theService URLfrom the OData Editor. In my example the service URL is

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice andhttps://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservicevaluationdata

If needed you can retrieve the metadata using the metadata URL

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/$metadata

Note: replace the{{TenantHostname}} with ByD tenant host name, example :my123456.sapbydesign.com

Create and Update Service Product General Information using the Custom OData Service

In the custom OData service select the general data relevant fields in co-relation with UI fields in General section of service product.

OData Example: Create and Update Product Data in SAP Business ByDesign (57)

OData Example: Create and Update Product Data in SAP Business ByDesign (58)

Step 1: Create service

Using the http-method POST and entity set ServiceProductCollectionyou can create ByD service product and include general / header information like InternalID, BaseMeasureUnitCode, ProductCategoryID along with Description and Purchasing information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductCollection

In my example I’m using the JSON body

{"InternalID": "{{ServiceID}}", "BaseMeasureUnitCode": "HUR", "Description": "VMU Service", "languageCode": "EN", "ProcurementMeasureUnitCode": "HUR", "ProcurementLifeCycleStatusCode": "1", "ServiceProductCrossProcessCategory": { "ProductCategoryInternalID": "130" }}

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to create the service via POST service call ( note: the x-csrf-token is fetched in the GET service call , for details refer to postman example collection ).
  • Note: ProductCategoryInternalID should be the valid and existing id in system.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (59)

As you can see the service product is created with relevant information.

Read and Update Service Product Procurement Data using the Custom OData Service

In the custom OData service select the procurement information data relevant fields in co-relation with UI fields in Purchasing section of service product.

OData Example: Create and Update Product Data in SAP Business ByDesign (60)

OData Example: Create and Update Product Data in SAP Business ByDesign (61)

Step 1: Get service data

Using the http-method GET and entity set ServiceProductCollectionyou can filter and read ByD service and include quantity conversions:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductCollection?$filter=InternalID eq ‘{{ServiceID}}‘&$expand=ServiceProductQuantityConversion&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{ServiceID}}to filter the service by the internal ID,
  • $expand=ServiceProductQuantityConversionto include the service quantity conversions in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the service in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (62)

As you can see the service “{{ServiceID}}” has the base unit of measure and procurement unit of measure “Each” and no quantity conversion so far.

Step 2: Create quantity conversion

Before we can change the procurement UoM to a unit that differs from the base UoM, we need to create the quantity conversion between the base UoM and the new procurement UoM. In our example the ratio should be 1 EA corresponds to 8 HUR.

Using http-method POST and the parent object ID (service object ID) provided by GET-response in step 1 you can create a new quantity conversion:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductQuantityConversionCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","CorrespondingQuantity": "8","CorrespondingQuantityUnitCode": "HUR","Quantity": "1","QuantityUnitCode": "EA"} 

OData Example: Create and Update Product Data in SAP Business ByDesign (63)
(HUR is the ISO code for “Hour”)

Step 3: Update procurement unit of measure

Now we can set the purchasing UoM to “Hour” (ISO code “HUR”).

We are again using http-method PATCH with the service object ID provided by the GET-response in step 1:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}", "ProcurementMeasureUnitCode": "HUR", "ProcurementLifeCycleStatusCode": "2"}

OData Example: Create and Update Product Data in SAP Business ByDesign (64)

Step 4: Activate procurement

Now we can set the purchasing status to active ( ProcurementLifeCycleStatusCode = ‘2’ ).

We are again using http-method PATCH with the service object ID provided by the GET-response in step 1:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}", "ProcurementLifeCycleStatusCode": "2"}

OData Example: Create and Update Product Data in SAP Business ByDesign (65)

Step 5:Get the updated service data

Similar to step 1 we again get entity setServiceProductCollection,filter by the service ID and expand the response by service quantity conversions:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductCollection?$filter=InternalID eq ‘{{ServiceID}}‘&$expand=ServiceProductQuantityConversion&$format=json

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (66)

As you can see the service “{{ServiceID}}” now has the procurement unit of measure “Hour” with procurement status “active” and a service quantity conversion node instance for the conversion between Hour and Each.

Read and Update Service Product Sales Data using the Custom OData Service

In the custom OData service select the sales information relevant fields in co-relation with UI fields in Sales section of service product.

OData Example: Create and Update Product Data in SAP Business ByDesign (67)

OData Example: Create and Update Product Data in SAP Business ByDesign (68)

Step 1: Get service data and expand

Using the http-method GET and entity set ServiceProductCollectionyou can filter and read ByD service and include service sales information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductCollection?$filter=InternalID eq ‘{{ServiceID}}‘&$expand=ServiceProductSalesProcessInformation&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{ServiceID}}to filter the service by the internal ID,
  • $expand=ServiceProductSalesProcessInformationinclude the sales information in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the service in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (69)

As you can see the service “{{ServiceID}}” has the no service sales process information so far.

Step 2: Create distribution chains

We can create and associate sales information with distribution chains to service.

Using http-method POST and the parent object ID (service object ID) provided by GET-response in step 1 you can create and associate ServiceProductSalesProcessInformationCollectionto service:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductSalesProcessInformationCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","SalesOrganisationID": "P1110","DistributionChannelCode": "01"}

OData Example: Create and Update Product Data in SAP Business ByDesign (70)
Note: SalesOrganisationID and DistributionChannelCode is the valid ID and should be existing in the system.

Step 3:Get distribution chains / sales info

Using the http-method GET and entity set ServiceProductSalesProcessInformationCollectionyou can get the instance details of sales process information created in previous step and read service sales process info:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductSalesProcessInformationCollection(‘{{ObjectID}}’)?$format=json

In my example I’m using the URL parameter

  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the service in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (71)

As you can see the service “{{ServiceID}}” has the sales process information which was created in previous step.

Step 4: Update distribution chains / sales info

Now we can update the planning information details of service like CustomerTransactionDocumentItemProcessingTypeDeterminationProductGroupCode and CashDiscountDeductibleIndicator.

We are again using http-method PATCH with the service object ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductSalesProcessInformationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "CustomerTransactionDocumentItemProcessingTypeDeterminationProductGroupCode": "SECO", "CashDiscountDeductibleIndicator": false} 

OData Example: Create and Update Product Data in SAP Business ByDesign (72)

Step 5: Activate distribution chains / sales info

Now we can set the sales information status to active ( LifeCycleStatusCode = ‘2’ ).

We are again using http-method PATCH with the service object ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductSalesProcessInformationCollection(‘{{ObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "LifeCycleStatusCode": "2" } 

OData Example: Create and Update Product Data in SAP Business ByDesign (73)

Read and Update Service Product Valuation Data using the Custom OData Service

In the custom OData service select the financials information relevant fields in co-relation with UI fields in Valuation section of service product.

OData Example: Create and Update Product Data in SAP Business ByDesign (74)

OData Example: Create and Update Product Data in SAP Business ByDesign (75)

Step 1: Get service data and expand

Using the http-method GET and entity set ServiceProductCollectionyou can filter and read ByD services and include service financial information:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductCollection?$filter=InternalID eq ‘{{ServiceID}}‘&$expand=ServiceProductFinancialProcessInformation&$format=json

In my example I’m using the URL parameter

  • $filter=InternalID eq ‘{{ServiceID}}to filter the service by the internal ID,
  • $expand=ServiceProductFinancialProcessInformationinclude the valuation information in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the service in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (76)

As you can see the service “{{ServiceID}}” has the no service valuation information so far.

Step 2: Create companies

We can create and associate valuation information with company to service product.

Using http-method POST and the parent object ID (service object ID) provided by GET-response in step 1 you can create and associate CompanyID to service:

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductFinancialProcessInformationCollection

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 1>

and body:

{"ParentObjectID": "{{ParentObjectID}}","CompanyID": "1000"}

OData Example: Create and Update Product Data in SAP Business ByDesign (77)
Note: CompanyID is the valid ID and should be existing in the system.

Step 3: Get companies

Using the http-method GET and entity set ServiceProductFinancialProcessInformationCollectionyou can get the instance details of valuation information created in previous step and read service financial process info:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductFinancialProcessInformationCollection(‘{{ServiceFinancialProcessObjectID}}’)?$format=json

In my example I’m using the URL parameter

  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the service in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (78)

As you can see the service “{{ServiceID}}” has the valuation / financial process information which was created in previous step.

Step 4: Query service valuation data (SVD)

Using the http-method GET and query ServiceProductValuationDataQueryByServiceProductIDyou can filter and read the service valuation data information like AccountDeterminationServiceProductValuationDataGroupCode:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservicevaluationdata/ServiceProductValuationDataQueryByServiceProductID?ServiceID='{{ServiceID}}’

In my example I’m using the URL parameter

  • ServiceID = ‘{{ServiceID}}‘ to filter the service by the internal ID

and the http-header parameter

  • x-csrf-token = fetchto get the CSRF-token to update the service in the next step.
  • Accept = application/json

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (79)

Step 5: Read service valuation data (SVD)

Using the http-method GET and entity set ServiceProductValuationDataCollectionyou can filter and read ByD service valuation data and include.

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservicevaluationdata/ServiceProductValuationDataCollection?$filter=ObjectID eq ‘{{SVDObjectID}}‘&$expand=ServiceProductValuationDataAccountDeterminationSpecification&$format=json

In my example I’m using the URL parameter

  • $filter=ObjectID eq ‘{{SVDObjectID}}to filter the service valuation data by the SVDObjectID,
  • $expand=ServiceProductValuationDataAccountDeterminationSpecificationinclude the Account Determination GroupCodeinformation in the OData response, and
  • $format=jsonto use JSON as body format of the response (default is xml),

and the http-header parameter

  • x-csrf-token=fetchto get the CSRF-token to update the service in the next step.

As result ByD returns the following OData response body:

OData Example: Create and Update Product Data in SAP Business ByDesign (80)

Step 6: Update account determination group (SVD)

In the service Valuation section to update the Account Determination field value, user has to create a custom OData service on business object ServiceValuationData.

OData Example: Create and Update Product Data in SAP Business ByDesign (81)

OData Example: Create and Update Product Data in SAP Business ByDesign (82)

We can update valuation information with account determination group of service product in business object Service Valuation Data (SVD).

Using http-method PATCH and the parent object ID (SVD Account Determination Object ID) provided by GET-response in step 5 you can update the account determination group of service product :

Example URL:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservicevaluationdata/ServiceProductValuationDataAccountDeterminationSpecificationCollection(‘{{SVDAccountDeterminationObjectID}}’)

with the http-header parameters

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 5>

and body:

{"ObjectID":"{{SVDAccountDeterminationObjectID}}","ParentObjectID": "{{SVDObjectID}}", "AccountDeterminationServiceProductValuationDataGroupCode": "5000"} 

OData Example: Create and Update Product Data in SAP Business ByDesign (83)

OData Example: Create and Update Product Data in SAP Business ByDesign (84)
Note: Account Determination Group is the valid code and should be existing in the system.

Step 7: Activate companies

Now we can set the valuation information status to active ( LifeCycleStatusCode = ‘2’ ).

We are again using http-method PATCH with the service object ID provided by the GET-response in step 3:

https://{{TenantHostname}}/sap/byd/odata/cust/v1/vmuservice/ServiceProductFinancialProcessInformationCollection(‘{{ServiceFinancialProcessObjectID}}’)

with http-header parameters:

  • Content-Type = application/json
  • x-csrf-token= <as provided by the response header in step 3>

and body:

{"ObjectID":"{{ObjectID}}","ParentObjectID": "{{ParentObjectID}}", "LifeCycleStatusCode": "2" } 

OData Example: Create and Update Product Data in SAP Business ByDesign (85)

How to run an Product Data OData API Sample Scenario?

The following example creates material and service product by running the scenario“Product Data“:

  1. Install the API sample package “Product Data”and configure your ByD system following the instructions in chapters “Download and Installation” and “Configuration” of theGitHub repositoryreadme file.
  2. Open thePostman Runnerand select the collection “Product Data, the collection folder “Materials” , “Services” andthe environment “ByD Product Data – <your ByD tenant>“:
  3. Enter the postman environment variable UserName and Password
  4. Run the postman collection using collection runner

OData Example: Create and Update Product Data in SAP Business ByDesign (86)

OData Example: Create and Update Product Data in SAP Business ByDesign (87)

OData Example: Create and Update Product Data in SAP Business ByDesign (88)

OData Example: Create and Update Product Data in SAP Business ByDesign (89)

Related blog posts:

  • SAP Business ByDesing – API Usage Samples
  • OData for SAP Business ByDesign Analytics
  • Using Filter and Selection Parameter in ByD OData for Analytics
  • 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
  • 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
OData Example: Create and Update Product Data in SAP Business ByDesign (2024)

FAQs

How to update data in OData service? ›

Read and Update Material Procurement Data using the Custom OData Service
  1. Step 1: Get material data. ...
  2. Step 2: Create quantity conversion. ...
  3. Step 3: Update procurement unit of measure. ...
  4. Step 4: Activate procurement. ...
  5. Step 5: Get the updated material data.
Feb 28, 2019

How to create OData step by step? ›

In SAP, we use SEGW transaction code to create an OData Service. I tried to explain the process in few steps. Step 1: Go to transaction code: SEGW. Step 2: Click on 'New Project' icon, a new pop-up screen will appear, fill all the details and save either locally or give package where you want your project to be saved.

How to create a simple OData service in SAP? ›

Step by Step Process to create SAP OData service
  1. We will use SAP Service Gateway Builder (SEGW) to create a new project.
  2. We will Import DDIC/CDS or other Structure to create an OData Model.
  3. We will Generate our OData.
  4. We will Register and test our Service.
Jan 25, 2021

How to create OData API in SAP? ›

Procedure
  1. Choose Design.
  2. Choose Create.
  3. Enter the required data for the integration package. ...
  4. In the Artifacts tab, choose Add OData API.
  5. In the Add OData API dialog box, choose one of the following options: ...
  6. Enter the OData API details as listed in the following table. ...
  7. Choose Create. ...
  8. Deploy the OData API.

How do I update existing data? ›

A Brief Introduction to the UPDATE Query in SQL

The UPDATE command in SQL is used to modify or change the existing records in a table. If we want to update a particular value, we use the WHERE clause along with the UPDATE clause. If you do not use the WHERE clause, all the rows will be affected.

How to perform CRUD operations in OData? ›

How to perfrom CRUD operations in OData
  1. Sending Data from Frontend. Data is sent from UI (Client) to OData (Server) in form of query.
  2. Taking Data from Frontend. At OData we receive data from Frontend using data provider (Code implemented in CRUD Operation section) ...
  3. Sending Data to Frontend.
Jan 26, 2021

What is OData with example? ›

The OData Protocol is an application-level protocol for interacting with data via RESTful interfaces. It supports the description of data models, editing and querying of data according to those models.

How many ways we can create OData service in SAP? ›

Creating an OData service you can use: (1) “Classical” ABAP (needed for ABAP platform <= 7.4), which comes with significant higher efforts. (2) “SAP Fiori programing model” (ABAP platform = 7.5. 4) or SAP BTP, Steampunk/RAP and CAP (SAP BTP) both using CDS views. (see openSAP Fiori-EA1, Week1, Unit 4).

How to create OData service for table in SAP? ›

Creation of Odata services for beginners
  1. Provide the name of your project and a project with the following structure gets created.
  2. Data Model: It contains three subfolders. ...
  3. Right-click on entity type folder and choose to create. ...
  4. Double click on properties, here we add the fields to our entity type.
Oct 7, 2019

How OData is used in SAP? ›

Description. SAP OData is a standard Web protocol used for querying and updating data present in SAP using ABAP. In SAP, we use SEGW transaction code to create an OData Service. OData is used to define best practices that are required to build and consume RESTful APIs.

How does OData service work in SAP? ›

OData allows data, updates, and queries on SAP Gateway in formats like Atom, JSON, and XML. It also allows a uniform alternative for the structure, query, and display of data. Thanks to this, SAP and non-SAP developers no longer have a communication barrier.

How to get data from OData SAP? ›

Easy way to read data via a deep entity in OData
  1. Tables involved: VBAK(Sales Document: Header Data), VBAP(Sales Document: Item Data).
  2. Create a Project in SEGW(SAP Gateway Service Builder).
  3. Import the DDIC Structure: VBAK(Sales Document: Header Data).
  4. Import the DDIC Structure: VBAP(Sales Document: Item Data)
Feb 23, 2022

How to write an OData API? ›

Procedure
  1. Choose Design.
  2. Choose Create.
  3. Enter the required data for the integration package. ...
  4. In the Artifacts tab, choose Add OData API.
  5. In the Add OData API dialog box, choose one of the following options: ...
  6. Enter the OData API details as listed in the following table. ...
  7. Choose Create. ...
  8. Deploy the OData API.

What is OData in Web API with example? ›

The Open Data Protocol (OData) is a data access protocol for the web. OData provides a uniform way to query and manipulate data sets through CRUD operations (create, read, update, and delete). ASP.NET Web API supports both v3 and v4 of the protocol.

How to call OData service in SAP? ›

Go to transaction code /IWFND/MAINT_SERVICE . Click on push button Add services . Now click back and go to main screen of transaction /IWFND/MAINT_SERVICE and find your service. A new screen will come, Execute the transaction and check the response .

How to refresh metadata in OData service? ›

Solution
  1. Start transaction /IWBEP/REG_SERVICE (Maintain Service)
  2. Put your service name in the 'Technical Service Name' field.
  3. Click on 'Display'
  4. Click on 'Cleanup Cache' to cleanup the metadata cache.
  5. In Transaction /IWFND/MAINT_SERVICE now you can repeat reloading the metadata.
May 15, 2015

How to refresh OData metadata? ›

Clearing of OData Metadata Cache by using TCodes:

In this method, we make use of the TCodes /n/iwfnd/maint_service and /n/iwfnd/gw_client to clear our metadata cache. Follow the below steps: Go to the TCode /n/iwfnd/maint_service and from the list of services select your desired service.

How do you update data in SAP? ›

These are SELECT, INSERT, UPDATE, MODIFY and DELETE.
  1. The SELECT statement has, of course, already been used. ...
  2. INSERT allows new records to be inserted into a database table.
  3. UPDATE allows records which already exist in the table to be modified.
Jan 1, 2021

How to update data in database using API? ›

The API works the same way as the initial call for saving the object. To update a property value, simply modify it in the instance representing the saved object. The example below retrieves a saved object, modifies the “name” property, and saves it back in the data store.

Top Articles
Latest Posts
Article information

Author: Mrs. Angelic Larkin

Last Updated:

Views: 5601

Rating: 4.7 / 5 (47 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Mrs. Angelic Larkin

Birthday: 1992-06-28

Address: Apt. 413 8275 Mueller Overpass, South Magnolia, IA 99527-6023

Phone: +6824704719725

Job: District Real-Estate Facilitator

Hobby: Letterboxing, Vacation, Poi, Homebrewing, Mountain biking, Slacklining, Cabaret

Introduction: My name is Mrs. Angelic Larkin, I am a cute, charming, funny, determined, inexpensive, joyous, cheerful person who loves writing and wants to share my knowledge and understanding with you.