Skip to Content
Technical Articles
Author's profile photo Knut Heusermann

SAP Business ByDesign – OData API Examples

The SAP Business ByDesign (ByD) provides REST/OData APIs to access ByD business objects, reports and data sources:

  • The OData API for Reports is tailored for remote access to pre-processed and formatted analytical data (reports). The remote application may extract a ByD analytical model as a cube incl. semantics like key figures, language-dependent texts and aggregated data.
  • The OData API for KPIs is tailored to access ByD KPIs incl. context information.
  • The OData API for Data Sources is designed to extract analytical raw data (data sources) in flat tables, free of redundancies from ByD.
  • The OData API for Business Objects is designed for UI-driven access to ByD business objects. A UI-like remote application or system interactively queries, reads, creates, updates, deletes or performs actions on ByD business objects and business documents. Using the work center “Application and User Management – OData Services“, key users are empowered to decide which business objects, nodes, elements and actions are exposed via OData API.

You find more information about ByD APIs in blog post SAP Business ByDesign – API Overview.

Where do I get OData examples?

To get some hands-on experience using SAP Business ByDesign OData APIs you find a repository of API Examples on GitHubSAP Business ByDesign – API Samples.

The GitHub repository provides sample ByD Custom OData Services for currently 44 business objects and 6 Postman collections with more than 600 example OData requests. The Postman collections illustrate hands-on how to access master data, business documents and analytical data in context of ByD business processes with a focus on ByD OData APIs.

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 GitHub repository contains the following Postman collecions:

  • Analytics: Access ByD built-in analytics incl. KPIs, reports and data sources.
  • Master Data: Access ByD master data objects using APIs.
  • Reference 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.
  • Projects: Create, change and read cost collecting projects and customer projects.
  • Sales and Commerce Scenarios: Run ByD sales and commerce 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.
  • Internal Logistics: Run internal logistical processes using APIs.
  • New Business: Run processes to generate new business such as leads, opportunities and quotes.

Please check the descriptions of the respective Postman collections for further details.

How to run API examples?

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 “Master Data – Service Product (write)“:

  1. Install the API sample package “Master Data and configure your ByD system following the instructions in  chapters “Download and Installation” and “Configuration” of the GitHub repository readme file.
  2. Open the Postman Runner and select the collection “Master Data, the collection folder “Service Product (write)and the environment “Master Data“:
  3. Click on “Run Service Product (write)” and see the process flow:

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

Assigned Tags

      58 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Update of API sample package "End-to-End Scenarios":

      • Sample OData service tmserviceorder.xml enhanced by service order lifecycle status
      • Scenario "Drop Shipment": SOAP request to create third-party delivery notification replaced by corresponding OData request.
      • Scenario "Procure to Stock": Request "Accept supplier invoice exception" removed (not needed after ByD update to SP02)
      Author's profile photo Marc Iserte
      Marc Iserte

      Thanks Knut Heusermann  for this very helpful blog.

      We have a doubt about Sales Order Item Pricing:

      We are building an integration which fits on "Selling Services Scenario" provided on the API Sample Package.

      Since our Services are not price defined, we tried to create a SalesOrder indicating the price on each Item, but we got an error.

      We also tried to update the SalesOrder when it is created, and since we get no error, the price is not updated.

      Could help us with that? We saw that it is possible to do on SOAP, but for this integration we are building, REST is a Must.

      Thank you.

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Marc,

      my OData sample for sales orders assume that prices and taxes are calculated by ByD. As of today sales order price components are not yet OData enabled and hence the sales order SOAP service would be the only possibility to create sales orders with given prices.

      In general I would suggest to request an enhancement of the public solution model as described in my blog post SAP ByDesign Public Solution Model, but very likely enabling the sales order price components is no quick fix.

      Best regards,
      Knut

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Update release 1908: Sales order price components can now be updated using OData service. Please find more details and examples in blog post OData Example: Create Update Delete Price Components of Sales Order in SAP Business ByDesign

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Update of API sample package “Projects”: Added a sample Custom OData Service and corresponding Postman OData requests to create and read project time recordings.

      Author's profile photo Marc Iserte
      Marc Iserte

      Hello.

      Using the provided POST request "Update fulfilled quantity" in the "Field Service and repair" Scenario, we are getting the following error:

      The server has not found any resource matching the Data Services Request URI.

      Has anyone ever found a solution for this?

      Thank you in advance.

       

       

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Marc,

      I'm using Postman environment variables in the OData URL. Those variables are either values provided or are populated by previous requests.

      In your request the environment variable "ServiceConfirmationItemScheduleLineObjectID" seems to be empty or invalid. Please enter a valid value for variable "ServiceConfirmationItemScheduleLineObjectID" in your Postman environment or run the OData requests of folder "Field Service and Repair" in the given sequence such that the variable is populated by request "Get service confirmation" (see Postman request test script of request "Get service confirmation").

      Best regards,
      Knut

      Author's profile photo Greg Neilson
      Greg Neilson

      Hi Knut,

      We've got a requirement to create Customer Invoice Requests directly via OData rather than via Sales Orders. Looking at the PSM, it should be possible to create a Customer Invoice Request by setting Business Process Variant Type to 3 (for a manual request), the CustomerInvoiceProcessingTypeCode to CI and buy setting the buyer party and sales unit party (as well as items of course).

      I've taken your example web service for Selling Services and have imported the customer invoice request service into my BYD tenant and then altered the service to expose the relevant fields and objects.

      However when I try to create a request with a POST, I find that the Sales Unit Party is read only. I am able to set the Business Process Variant Type, and the CustomerInvoiceProcessingTypeCode but the sales unit party ID is read only.

      Is this why you've used a sales order and then released the order, and then get the invoice request from the sales order ID, because you ca't create an invoice request directly?

      Greg

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Greg,

      I'm using sales orders because of the scenario that I realized (for example incl. deliveries and ATP check); using sales orders was not intended as workaround for creating invoice requests directly.

      You can change the sales unit party of customer invoice requests by a Patch on the corresponding resource of the SalesUnitPartyCollection. The fact that you can't create the sales unit party with the invoice request directly is a gap in our PSM for OData.
      However, if you dig deeper you will find out that there are more invoice request elements not yet create/update enabled or missing and hence as of today you can't create an external customer invoice request using OData.
      For that reason, I would suggest to use the SOAP API Manage Customer Invoice Requests to create external customer invoice requests. This API provides you with the possibility to create and change invoice requests incl. prices and external payments, and you can furthermore trigger invoicing directly.

      Here is an example for an invoice request using API Manage Customer Invoice Requests:

      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global" xmlns:glob1="http://sap.com/xi/AP/Globalization">
          <soapenv:Header/>
          <soapenv:Body>
              <glob:CustomerInvoiceRequestBundleMaintainRequest_sync>
                  <BusinessDocumentBasicMessageHeader>
                      <!-- Enter message header UUID for idem potency! -->
                      <!-- <UUID>?</UUID> -->
                  </BusinessDocumentBasicMessageHeader>
                  <CustomerInvoiceRequest actionCode="01" itemListCompleteTransmissionIndicator="false">
                      <ObjectNodeSenderTechnicalID>HDR_1</ObjectNodeSenderTechnicalID>
                      <BaseBusinessTransactionDocumentID>{{CustomerInvoiceRequestID}}</BaseBusinessTransactionDocumentID>
                      <Name>My customer invoice with external payment</Name>
                      <!-- SettlementPriorityCode: 
                       1 = Immediate - create custom invoice, 
                       2 = Urgent - stop if a down payment exists
                       3 = Normal - save invoice request with status "to be invoiced" -->
                      <SettlementPriorityCode>1</SettlementPriorityCode>
                      <ReferenceBusinessTransactionDocumentID>{{InvoiceRequestExternalReference}}</ReferenceBusinessTransactionDocumentID> <!-- External Reference -->
                      <BuyerParty>
                          <InternalID>{{CustomerID}}</InternalID>
                      </BuyerParty>
                      <SalesUnitParty>
                          <InternalID>{{SalesUnitID}}</InternalID>
                      </SalesUnitParty>
                      <CashDiscountTerms>
                          <!-- 1001 = immediately net; 1006 = 10 days 5% -->
                          <Code>1001</Code>
                          <!-- <FullPaymentEndDate>2019-05-30</FullPaymentEndDate> -->
                      </CashDiscountTerms>
                      <PaymentControl>
                          <!-- PaymentFormCode: 04 = Direct Debit, 20 = External Payment -->
                          <PaymentFormCode>20</PaymentFormCode>
                          <PaymentReferenceID>{{PaymentReferenceID}}</PaymentReferenceID>
                          <!-- used to clear the payment -->
                          <PaymentReferenceTypeCode>5</PaymentReferenceTypeCode>
                          <PaymentServiceSubscriberID>{{CompanyID}}</PaymentServiceSubscriberID>
                          <PaymentServiceCustomerID>{{CustomerID}}</PaymentServiceCustomerID>
                          <ExternalPayment actionCode="01">
                              <!-- <UUID>?</UUID> -->
                              <!-- Bank Account ID from UI screen My Bank >> View All >> Bank Accounts -->
                              <HouseBankAccountKeyInternalID>{{HouseBankAccountID}}</HouseBankAccountKeyInternalID>
                              <!-- House bank: 1000644 - ABN AMRO Bank -->
                              <PaymentTransactionReferenceID>{{PaymentTransactionReferenceID}}</PaymentTransactionReferenceID>
                              <DocumentDate>{{DocumentDate}}</DocumentDate>
                              <ValueDate>{{ValueDate}}</ValueDate>
                              <Amount currencyCode="USD">220</Amount>
                          </ExternalPayment>
                      </PaymentControl>
                      <PricingTerms>
                          <!-- PricingProcedureCode: PPGP02 = Standard Gross Procedure, PPSTD1 = Standard Procedure -->
                          <PricingProcedureCode>PPGP02</PricingProcedureCode>
                          <CurrencyCode>USD</CurrencyCode>
                      </PricingTerms>
      <!-- Invoice item | service product | tax code derived by system -->
                      <Item>
                          <BaseBusinessTransactionDocumentItemID>10</BaseBusinessTransactionDocumentItemID>
                          <!-- ReceivablesPropertyMovementDirectionCode: 1 = Invoice item, 2 = Credit memo item -->
                       <ReceivablesPropertyMovementDirectionCode>2</ReceivablesPropertyMovementDirectionCode>
                          <!-- <Description languageCode="EN">My invoice item</Description> -->
                          <CashDiscountDeductibleIndicator>false</CashDiscountDeductibleIndicator>
                          <Product>
                              <InternalID>{{ServiceProductID2}}</InternalID>
                              <TypeCode>2</TypeCode>
                          </Product>
                          <Quantity unitCode="HUR">10</Quantity>
                          <QuantityTypeCode>TIME</QuantityTypeCode>
                          <PriceAndTax>
                              <!-- List Price -->
                              <PriceComponent>
                                  <!-- TypeCode: 8PR1 = Gross list price, 7PR1 = Net list price -->
                                  <TypeCode>8PR1</TypeCode>
                                  <Rate>
                                      <DecimalValue>120</DecimalValue>
                                      <CurrencyCode>USD</CurrencyCode>
                                      <BaseDecimalValue>10</BaseDecimalValue>
                                      <BaseMeasureUnitCode>HUR</BaseMeasureUnitCode>
                                  </Rate>
                              </PriceComponent>
                          </PriceAndTax>
                          <ObjectNodeSenderTechnicalID>ITM_1</ObjectNodeSenderTechnicalID>
                      </Item>
      <!-- Invoice item | free text -->
                      <Item>
                          <BaseBusinessTransactionDocumentItemID>20</BaseBusinessTransactionDocumentItemID>
                          <ReceivablesPropertyMovementDirectionCode>2</ReceivablesPropertyMovementDirectionCode>
                          <Description languageCode="EN">My free text invoice item</Description>
                          <CashDiscountDeductibleIndicator>false</CashDiscountDeductibleIndicator>
                          <Quantity unitCode="EA">1</Quantity>
                          <QuantityTypeCode>EA</QuantityTypeCode>
                          <PriceAndTax>
                              <!-- List Price -->
                              <PriceComponent>
                                  <TypeCode>8PR1</TypeCode>
                                  <Rate>
                                      <DecimalValue>100.00</DecimalValue>
                                      <CurrencyCode>USD</CurrencyCode>
                                  </Rate>
                              </PriceComponent>
                          </PriceAndTax>
                          <ProductTaxDetails>
                              <ProductTaxationCharacteristicsCode listID="US">500</ProductTaxationCharacteristicsCode>
                          </ProductTaxDetails>
                          <AccountingCodingBlockAssignment>
                              <AccountingCodingBlock>
                                  <AccountingCodingBlockTypeCode>ACC</AccountingCodingBlockTypeCode>
                                  <GeneralLedgerAccountAliasCode>A-1700</GeneralLedgerAccountAliasCode>
                              </AccountingCodingBlock>
                          </AccountingCodingBlockAssignment>
                          <ObjectNodeSenderTechnicalID>ITM_2</ObjectNodeSenderTechnicalID>
                      </Item>
                  </CustomerInvoiceRequest>
              </glob:CustomerInvoiceRequestBundleMaintainRequest_sync>
          </soapenv:Body>
      </soapenv:Envelope>

      Best regards,
      Knut

       

      Author's profile photo Greg Neilson
      Greg Neilson

      Hi Knut,

      Sorry I didn't thank you for this at the time - for some reason I didn't get notified that you'd left a response, and I had moved onto something else. I am now back on this piece of work - thank you for the explanation; the gap in the ODATA PSM is still there today.

      I have a problem using the SOAP API though. Unless Sales Orders are scoped in, which in my customer's tenant it is not, the SOAP API cannot create a Customer Invoice Request. You get a very cryptic error:

      No scheme configuration found for scheme '&CIRHP&'

      On another tenant with Sales Orders scoped in, I can create the customer invoice requests no problem. However scoping Sales Orders in is not an option on the tenant I need to do this on. Any advice?

      Greg

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Greg,

      I don't think the error message is caused by the Sales Order scoping. Could you please log an incident in ByD to follow up on your issue?

      Thanks and best regards,
      Knut

      Author's profile photo Greg Neilson
      Greg Neilson

      Hi Knut,

      You are correct. After followup, it's emerged that the option "Upload of Invoice Requests" needs to be in scope. Otherwise you get that very unhelpful error! Thanks again for the help.

      Greg

      Author's profile photo Chester Eugene Arellano
      Chester Eugene Arellano

      Hello Greg,

      May I know what did you do to post the direct Customer Invoice Request via SOAPUI? Can you share you xml code for request in

      CustomerInvoiceRequestBundleMaintainRequest_sync

      Thanks,

      Chester

       

      Author's profile photo Jasmin Schaad
      Jasmin Schaad

      Hi Knut

      I tested your end-to-end scenario field service and repair.
      We also need to read and update the field "Incident Description" in our scenario.
      Can you give me a hint how to update the field?

      Thank you and best regards
      Jasmin

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Jasmin,

      please do the following:

      1. Add the node Root/TextCollection/Text to the service order OData service. As result you get a collection “ServiceOrderText” (I renamed it to “Text”) in the OData service.
      2. Now you can create, update and read the incident description using this collection. The text referring to the incident description has TypeCode “10006”.

      Text TypeCodes:

      • Incident description: 10006
      • Customer Information: 10024
      • Internal Comment: 10011

      Best regards,
      Knut

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      This example creates a service order incident description:

      POST /sap/byd/odata/cust/v1/tmserviceorder/TextCollection HTTP/1.1
      Host: ...
      Content-Type: application/json
      x-csrf-token: ...
      Accept: application/json
      cache-control: no-cache
      Postman-Token: ...

      {
      "ParentObjectID": "{{ServiceOrderObjectID}}",
      "Text": "Some incident description ...",
      "TypeCode": "10006"
      }

      I'll add this example to the next version of the OData samples on Github as well 🙂

       

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Update: Today I uploaded a new version of API sample packages to the GitHub repository:

      • I restructured the repository to simplify installation and configuration.
      • Refactored and new sample OData services for master data incl. organisational structures, employees, business partners, customer, suppliers, employees, positions, materials and service products
      • Enhanced sample OData services for sales order, customer invoice request, customer invoices, …
      • New examples to order services and procure services
      • New examples to sell products from stock with external payment
      • New examples to process customer returns
      • New examples to pre-confirm payments using clearing house statements
      • New examples to confirm payments and clear open items using bank statements
      • New examples to create and process invoices with external payment
      • New examples to create sales orders with external prices, discounts and surcharges
      • New examples to access the payment monitor
      • Correction of supplier invoice examples to post invoices
      Author's profile photo Olli Paavola
      Olli Paavola

      Hi Knut

       

      we are currently implementing incoming Bank Statements with Odata. We have ran into a problem as we cannot get full data for BankStatement items using Odata compared to what can be seen in the CAS using Repository Explorer. It seems that item details are not as well in place as we need. Could you please advise?

      Olli

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Olli,

      to enable business object nodes and element for OData comes with some additional requirements compared to a pure PSM release for CAS development. Please request an enhanced PSM release for your OData use case as described in blog post SAP ByDesign Public Solution Model.

      Thanks,
      Knut

      Author's profile photo Olli Paavola
      Olli Paavola

      Hi Knut,

      I have requested PSM release on 15.11. but w/o the OData details. We will enhance the request with OData details.

       

      Thanks

      Olli

       

      Author's profile photo Olli Paavola
      Olli Paavola

      Hi Knut,

       

      it seems that SAP development team is not able to open required BO object:

      "We have analyzed the issue and discussed the issue with our Development team and due to technical reasons we cannot write enabled the BO".
      This is quite an issue here as electronical banking is business as usual in nordic countries. Could we maybe have a sit down regarding this issue?
      Olli
      Author's profile photo Naveenprabu Pandiyan
      Naveenprabu Pandiyan

      Hi Knut,

      The EDM Type for the standard created on field is string instead of Datetime so we are not able to use all IntervalBoundaryTypeCode (ge, le etc..) for filter option.

      We have a requirement to filter the Odata query based on the creation datetime. Is there a way to achieve this.

       

      Thanks,

      Naveen

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Naveen,

      You find some examples to filter by the creation datetime in the Github repository. However, in my examples the edm type is always DateTime or DateTimeOffset. Which API type and entity are you looking for?

      Best regards,
      Knut

      Author's profile photo Jeong-Ju Choi
      Jeong-Ju Choi

      Hi Knut,

       

      We are currently implementing mass data upload with ODATA.

       

      We create Custom BO and Custom Odata Service.

       

      We have tens of thousands data to be uploaded, so, we're testing with reference to Create 2 sales orders + get (batch) scenario.

      But it doesn't work.

      POST : https://xxxxxxx.sapbydesign.com/sap/byd/odata/cust/v1/svinterface/$batch

      in the BODY,

      --batch_1
      Content-Type: multipart/mixed; boundary=changeset_2

      --changeset_2
      Content-Type: application/http
      Content-Transfer-Encoding: binary

      POST SvInterfaceCollection HTTP/1.1
      Content-Type: application/json
      Content-ID: 1
      Content-Length: 10000
      Accept: application/json

      {
      "SourceSystemDocumentID" : "Test097",
      "IFResult" : "FAIL",
      "SvInterfaceTransactionHead" :
      [
      {
      "Type1" : "10",
      "Type2" : "ORD001"
      }
      {
      "Type1" : "10",
      "Type2" : "ORD002"
      }
      ]
      }

      There is no response from system. there is '202 Accepted' message only.

      Could you please advice?

       

      Best regards,

      J Choi

      Author's profile photo Jeong-Ju Choi
      Jeong-Ju Choi

      We solved this issue.

       

      We changed some contents in body.

       

      Author's profile photo Ronald van Herk
      Ronald van Herk

      Hi Knut,

      We are testing ways to interface with our SAP ByDesign system and currently we are thankfully using your sapbydesign-api-samples on Github.

      I try to update some Project Task Expenses using your Custom Odata Service, but I cannot find a way to make the change in the correct Period Plan.

      Can you guide me how I can add these Period Plans data to the Custom Odata Service?

      Thanks in advance

      Ronald van Herk

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Ronald,

      to add period plans you need to add the business object node Project/Task/TaskExpense/TaskExpensePeriodPlan to your OData service.

      Please note the following:

      • Mandatory elements are PlannedCostAmount and PlannedPeriod.
      • Make sure you added task plan data (e.g. planned expenses) before adding period plans because otherwise the period plans cannot be propagated and aggregated to upper levels correctly.
        Take into account that you have to schedule the task as well.
      • The sum (total amount) of all task expense period plan items needs to match the task expense amount. If this is not the case, then the system creates an additional period plan item with the remaining amount (this item is marked by the element Indicator - so I would suggest to add this element to the OData service as well).
      • The Description of period plans is not mandatory, but might be important from a business semantics point of view.

      Don't mixup the TaskExpensePeriodPlan with the TaskExpense/PlannedPeriod. In ByD you can plan on multiple levels: task, work/material/expenses/revenues and on periods. The TaskExpense/PlannedPeriod refers to the timeframe for which a task expense item is planned in case you plan on that level.

      Sometimes you may observe, that you add a node to an OData service and some elements of this node are greyed out. In this case, save and activate your OData service, close it, reopen it, and now you can add the previously greyed out field (this is a known issue - we are working on it).

      Best regards,
      Knut

      Author's profile photo Ronald van Herk
      Ronald van Herk

      Hi Knut,

      Thank you for your quick response. I had to wait a few days before I could try because there was an issue in the latest release with uploading Custom Odata Service XML files.

      Now that works again, but the 2 mandatory fields PlannedCostAmount and PlannedPeriod.remain greyed out, even when I follow your instructions to save and activate and then close and re-open the service. Could it be that that is also an issue with the latest release?

      I am a little stuck now, I hope you have maybe an idea? Could you add them to your khproject.xml on github for example?

      Warm regards,

      Ronald

      Author's profile photo Ronald van Herk
      Ronald van Herk

      Hi Knut,

      I managed to select the 2 mandatory fields now, I think I overlooked something on my end.

      Maybe a more general question: How can I know that there are mandatory elements when constructing a Custom Odata service? Can we find that in the SAP documentation?

      Warm regards,

      Ronald

       

      Author's profile photo Adrian van Oyen
      Adrian van Oyen

      Hi Knut,

      thanks for this comprehensive summary when working with SAP ByD's API.

      I want to add a BusinessPartner (Company) to our system via API and therefore tried uploading your OData Services (khbusinesspartner.xml) from Githhub. Unfortunately this fails. Is it possible that with SAP 2005 the xml structure of OData Services changed?

      I also haven't been able to shift an ODataServices in May from our Testtenant (already ByD 2005) to our Productivetenant (still ByD 2002).

      If the xml structure has changed: Is there a possibility to merge your Services from Github to the new structure? Or can you download them once again and share with us?

      Thanks & Regards

      Adrian

      Author's profile photo Warut Warotpaiboon
      Warut Warotpaiboon

      Hi Knut,

      We are using SAP ByDesign OData to integrate with K2 software.

      K2 will create a service instance from the metadata of OData but not work with

      OData API for Reports because metadata of Key ID missing Nullable attribute.

      This is the Error message from K2 software.

      Could you have any idea? Or Is it possible we can fix metadata of OData API for Reports?

       

      Thanks & Regards

      Warut

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      UPDATE of the GitHub repository:

      Because of the new file format of Custom OData Service exports/imports, I uploaded new versions of all sample Custom OData Services with the new xml file format to the GitHub repository. The content of the Custom OData Services did not change with this update.

      With the new Custom OData Service xml files the upload problems in ByD tenants >= release 20.05 as reported by Warut and Adrian should be solved.

      Best regards,
      Knut

      Author's profile photo Konstantin Lautenschläger
      Konstantin Lautenschläger

      Hallo Knut,

       

      is there a chance to get an example for creating a customer invoice in the Github-Repo?

       

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Konstantin,

      in ByD you can create customer invoices from one or more customer invoice requests. This can be done via invoice run, via Soap or OData API or manually via UI.

      Customer invoice requests can be considered as billable representatives of a sales document. This means sales orders, customer contract items, server orders, service confirmations, ... create customer invoice request automatically if released. This can be done via the Soap/OData API of the corresponding sales document.

      You find examples for such scenarios in the Postman collection "Reference Scenarios" of the Github repo.

      In some cases the sales document may reside outside ByD and you would like to trigger an invoicing process in ByD by creating an "External customer invoice request". Unfortunately, as of today this is possible via Soap web service API only, because some mandatory elements for external customer invoice requests are not yet PSM-released or read-only released only (e.g. invoice type code, item type code, BaseBusinessTransactionDocumentID, BaseBusinessTransactionDocumentItemID, ...).

      You find an example to create exterbal customer invoice requests via Soap API in the Github repo in Postman collection "Sales and Commerce Scenarios", folder "Invoice External Billing Documents".

      You find a guideline to request PSM releases in my blog post https://blogs.sap.com/2017/10/02/sap-bydesign-public-solution-model/.

      Best regards,
      Knut

      Author's profile photo Pascal Markwalder
      Pascal Markwalder

      Dear Knut

       

      We have built a UI5 based Customer Portal and want to use the Sales Order OData Service with the Batch Variant to create sales orders. We have now built a view test cases and are uncertain about the load that this approach does on the ByD tenant. Our samples include a batch request, where we want to create 4 sales orders with 100 line items each. This seems to be too much for the process. Do you have any information what impact on the load the batch variant has? Unfortunately we don't know if any queuing happens with the batch components or not. So does a batch with 10 sales orders, each having 10 line items, have that same load as one sales order with 100 line items?

       

      Best regards

      Pascal

      Author's profile photo Yan Gerzon
      Yan Gerzon

      Hi.
      Im using the SOAP API for Suppliers to create new Suppliers.
      I am able to successfully create suppliers with addresses , contacts, sales and payment data etc...
      My only issue is that I cant seem to cretae the business communication E-MAil in the contacts tab for the contacts I create.
      The phone data is created, the fax data is created but not the email...
      This is how the contacts section of my template looks:

      <ContactPerson actionCode="01" workplaceTelephoneListCompleteTransmissionIndicator="true">
                      <DefaultContactPersonIndicator>true</DefaultContactPersonIndicator>
                      <FamilyName>name</FamilyName>
                      <GivenName>lastname</GivenName>
                      <WorkplaceEmailURI>name@gmail.com</WorkplaceEmailURI>
                      <WorkplaceFacsimileFormattedNumberDescription>fax number</WorkplaceFacsimileFormattedNumberDescription>
                      <WorkplaceTelephone>
                          <FormattedNumberDescription>phonenumber</FormattedNumberDescription>
                      </WorkplaceTelephone>
                  </ContactPerson>

      Like i wrote above, this all works except the email.
      thank you.

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Yan,

      thanks for bringing up this - looks like a bug. Could you please raise a ByD incident?

      Thanks and best regards,
      Knut

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Yan,

      I need to correct myself:

      There is a typo in the element name: The correct element name is "WorkplaceEMailURI" (with a capital "M"). 

      Best regards,
      Knut

      Author's profile photo Yan Gerzon
      Yan Gerzon

      Hi Knut,

      Thank you so much for your reply.
      I took the element name directly from the WSDL and/or the examples in the API guides.
      When it did not work i did raise an incident, was more than a week ago and i did not hear anything since.

      Best regards,
      Yan

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Update: Examples for Location master data and Goods Movement added.

      I added a new Postman collection "Internal Logistics" with a first example to post a goods movement to the Github repository. The example includes requests to read locations and logistics areas, and to get the current stock overview.
      To run the Postman collection I added the Postman environment "Internal Logistics" and two new custom OData services "khgoodsandactivityconfirmation" and "khlocation" to the Github repository as well. Please take into account the details in the description of the Postman collection.

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Update: Examples for SAP Business ByDesign KPIs.

      I added a new Postman collection "Analytics - KPIs" with examples to access ByD KPIs using the OData API for KPIs.
      The Postman collection works with the previously published Postman environment "Analytics".

      Author's profile photo Carl Önnheim
      Carl Önnheim

      Hi Knut Heusermann ,

      Thanks for maintaining this awesome blog!

      We are trying the "Customer (write)" sample from the Master Data collection. It fails at the step "Create account note".

      We have noticed that adding a note to the account before running this request makes the problem disappear, like this.

      Sending the same request after that addition works as expected. I am thus suspecting that it has something to do with the "TextCollection" node which is between the Customer node and the individual Text nodes.

      Have you seen this issue before, any advice?

      Thanks!

      //Carl

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Carl,

      For text collections we are using a reuse component in Custom OData Services without explicitely exposing the root node of the text collection. Therefore I think this is a bug in the reuse component. Could you please create an incident for the issue?

      Thanks and best regards,
      Knut

      Author's profile photo Markus Lyschik
      Markus Lyschik

      Hi Knut,
      I'm already crazy by solving an OData problem.
      I need to create and update customer quotes via OData but I have no idea which OData object I can use to set the CustomerQuoteItem price and amount.

      OrderQuantity in ItemActualValues is not writable.
      In PriceAndTaxCalculation are so many fields ans associations but I don't know which of them is writable or is the right I have to use.

      I just need to add a item with a product a quantity and a price.

       

      Could you please help and explane or just link to the information where this is documented?

       

      Kindly regards, Markus

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Markus,

      I added some examples to create sales quotes with item quantities and prices to the GitHub repository GitHub - ByD API Samples.

      Best regards,
      Knut

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Update: Examples for ByD Sales Quotes.

      I added a new Postman collection "New Business" with some first examples to to create sales quotes.
      To run the examples you need to upload the new version of the Custom OData Service khcustomerquote published in the GutHub repository today.
      The Postman collection "New Business" works with the Postman environment having the same name.

      Author's profile photo Markus Lyschik
      Markus Lyschik

      ItemPriceAndCalculation%20nodesItemPriceAndCalculation nodes

       

      Hi Knut, thank you very much the Postman works great (tested GET only).
      Bute there is still one question. How can I add PriceComponent and ItemPriceComponent to my OData service? The matter is I don't have this nodes within the object ItemPriceAndTaxCalculation, only four other nodes.

      Thank you, best regards,
      Markus

       

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Markus,

      I added the sub-nodes "OperationalPriceComponent" for the price components and header level and "OperationalItemPriceComponent" for price components on item level and renamed the nodes for simplicity.

      Best regards,
      Knut

      Author's profile photo Markus Lyschik
      Markus Lyschik

      Hi Knut Heusermann,
      it's working very well so far, thank you again.

      But now I have another question.
      I want to track which user did the last changes on a CustomerQuote when I transfer this data via webhooks to the SAP CPI. But I found no data source for the change history on an CustomerQuote object. Could you tell me where I have to search for?

      Best regards, Markus

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Markus,

      the change history is not available via OData because it is not part of the public solution model (PSM).

      However, if your you need to know the user responsible for the last changes only, then you may request to enhance the PSM by the element SystemAdministrativeData.LastChangeIdentityUUID and the association LastChangeIdentity (see as well https://blogs.sap.com/2017/10/02/sap-bydesign-public-solution-model/).

      Best regards,
      Knut

      Author's profile photo Markus Lyschik
      Markus Lyschik

      Hi Knut,

       

      thank you for this insights.

      An incident wouldn't be practicable to ask SAP for each change on any CustomerQuote.

      I hoped I could extract "This CustomerQuote was created/modified by [employee_name]".

      But it's ok I will do without this information.

      Best regards,
      Markus

      Author's profile photo Aydin Erturk
      Aydin Erturk

      Hi,

      Thanks for API samples.. But we have some issues about our CustomerInvoice senario Turkish e-Document services.

      We are using CustomerInvoiceCollection API for to get released Invoices. We need some informations about Invoice for example CustomerParty > TaxNumer and Item  > TaxCode, TaxRate, DiscountRate, DiscountAmount

      We are getting TaxNumber from CustomerCollection one by one and it is poor performance. is there any way to get it as $crossjoin. we tried $crossjoin but it's not working.

      We are not getting Item > TaxCode, TaxRate, DiscountRate, Discount Amount from CustomerInvoiceCollection

       

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Aydin,

      we don't support $crossjoin in ByD so far.

      However, you can add the information you are looking for by enhancing your custom OData service: You find the tax-ID of the buyer and seller in node ItemPriceAndTaxCalculation.ItemTaxationTerms, the tax code in node ItemPriceAndTaxCalculation, and all price components in node ItemPriceAndTaxCalculation.OperationalItemPriceComponent.

      Best regards,
      Knut

      Author's profile photo Aydin Erturk
      Aydin Erturk

      Hi Knut,

      Thank for your fast replay,

      I checked custom OData service and found some answers... But I have still some issue about Tax-ID

      There are two way to get BuyerTaxID...

      1. ItemPriceAndTaxCalculation.ItemTaxationTerms.BuyerTaxID  : it's empty in response
      2. PriceAndTaxCalculation.TaxationTerms.BuyerTaxID : There is value but it is not TaxNumber  it is getting from TaxOffice. it's not an Array like CustomerCollection service.
        "BuyerTaxID": "B.MÜKELLEFLER",
        "BuyerTaxIdentificationNumberTypeCode": "1",
        "BuyerTaxIdentificationNumberTypeCodeText": "Tax Office",

      And when I added new selection for Item.ItemPriceAndTaxCalculation. I receive

      <H1>500 SAP Internal Server Error</H1>

       

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Update: New samples for data sources and reports.

      Analytics - Data Sources:

      • New example for data source "Financial Statements (FINGLAU04)".

      Analytics - Reports:

      • New examples for report "Employee Lifecycle Events" (HCMPAU01_Q1001)
      • New examples for report "Planned Working Time and Absences" (HCMRPMU01_Q1001)
      • Update on report "Inventory Report" (stock overview with details)
      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Update: Enhancements of custom OData services and new sample requests for master data.

      Master data:

      • Enhanced custom OData service khcustomer.
      • Postman collection "Master Data" enhanced by new examples to create customers and prospects in a single OData request (without action "Create customer from businesspartner").

      Custom OData Service enhancements:

      • Custom OData service khsalesorder, khcustomerinvoicerequest, khgoodsandactivityconfirmation, khinbounddelivery and khconfirmedinbounddelivery enhanced to support products with identified stock and customer consignment scenarios.
      Author's profile photo Pierre HUGOT
      Pierre HUGOT

      Hi Knut,

       

      Thanks a lot for all the samples published for many objetcs : it is very helpfull !

      We have actually some performance issues on oData for projects tasks as we process them one by one for the interface to create/update task on project with up to 1000 tasks.

      We suspect performance issue coming from the unitary processing and we would like to know if it is possible to create multiple tasks on an existing project in one call ?

      We tried a "patch" operation in the root project with mulitple new tasks as sub-elements but despite no technical error, tasks are not created. Or maybe we didn't provide the right content ?

      Also, is multiple update supported by the system ?

      If it is supported, a sample based on your data model would be apreciated.

      Regards,

       

      Pierre

       

      Author's profile photo Knut Heusermann
      Knut Heusermann
      Blog Post Author

      Hi Pierre,

      unfortunately, ByD OData APIs for business objects does not yet support deep patches, i.e. a patch on a project root and multiple subnodes in one hierarchical json-structure.

      However, ByD supports OData batch-requests, which means you can include multiple OData requests with project task updates and creations in one http-request. You find some examples in the Postman collection "Sales and Commerce Scenarios", folder "Create Sales Order using batch". This approach may help to improve the performance, but it is still not the same as a mass-operation.

      Best regards,
      Knut