Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
knutheusermann
Product and Topic Expert
Product and Topic Expert
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


114 Comments
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
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)

former_member765205
Discoverer
0 Kudos
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>

 
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.
docly
Explorer
0 Kudos
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
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
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
docly
Explorer
0 Kudos
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
Pecoros
Explorer
0 Kudos
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

 
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
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
knutheusermann
Product and Topic Expert
Product and Topic Expert
Update: Enhancements of custom OData service khproject to support task scheduling.
scloutier
Explorer
This blog is an awesome resource and definitely the #1 starting point for any new ByD Odata developer. Thank you very much for it!

I am currently trying to find a way to create Site Logistics Tasks confirmations as well as Production Tasks confirmation, which the documentation seems to imply is possible. Unfortunately I can't find any example or code sample on the matter.

The use-case scenario is as following: Lets say a Warehouse Request is created from a sales order process, and a Warehouse Order/Warehouse Task is created manually by an employee:


By selecting the Warehouse Task in the Execution workcenter and confirming it, a Site Logistics Confirmation is created as well as the Outbound Delivery business object as soon as the request has been fully processed.

Now, I understand that this behavior can in theory be replicated in Odata using the SiteLogisticsLot business object, (or ProductionLot in case of a ProductionTask) but the actual usage of it is very poorly explained in the doc. I was hoping that could be improved and/or exemplified?

If on the contrary it is in fact impossible to "confirm" tasks (logistics, production or otherwise) using odata, At least here we could make it official once and for all.

Either way, thank you for your awesome contribution!
0 Kudos
Hi Knut,

Thank you very much for the OData examples.
I am trying to create identified stock using OData service. However, I cannot find the way to associate a product sepcification to the identified stock. The screenshot below is the custom OData setting in ByDesign:


I tried the following body in POST to IdentifiedStockCollection.
{
"MaterialUUID": {{materialUUID}},
"ProductRequirementSpecification":
{
"ID":{{specID}}
}
}

However I am receving the following error:
{
"error": {
"code": "CX_ODATA_ANNOTATION_ERROR",
"message": {
"lang": "en",
"value": "Create not allowed for properties: ID. Check metadata for ProductRequirementSpecificationCollection"
}
}
}

I also tried to create the identified stock first without product specification and then assign product spec while activating the identified stock (with PATCH):
{
"ObjectID": {{objectID}},
"LifeCycleStatusCode":"2",
"ProductRequirementSpecification":
{
"ID":{{specID}}
}
}

The identified stock was activated successfully without error, but the product specification was not assigned.

Could you provide some guidance?

Thanks,

Alan
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Alan,

by adding the node ProductRequirementSpecification you include an the association and the business object "ProductRequirementSpecification" itself in your OData service. Therefore the element ProductRequirementSpecification/ID cannot be used to setup the association.

The element to enter the reference to a product specification would be the element ProductRequirementSpecificationVersionUUID on identified stock root level. However, this element is not yet write enabled in the public solution model.

Please request to enhance the public solution model of the identified stock to edit the ProductRequirementSpecificationVersionUUID and the ProductRequirementSpecificationID on identified stock root level. For more details please check my blog post SAP ByDesign Public Solution Model.

Best regards,
Knut

 
Jay_Bhambhani
Explorer
0 Kudos
Hello Knut,

I am creating a supplier via POST http request from Postman. Then I have odata Adapter in receiver end. I am passing basically just name to test.

Payload:

<?xml version='1.0' encoding='UTF-8'?><SupplierCollection><Supplier><FirstLineName>TestPostman</FirstLineName></Supplier></SupplierCollection>

CPI Scenario:

image.png

 

BYD:

 

 

image.png

I am getting the following error :

"Business partner category does not exist; use 1, 2 or 3 Diagnosis This error occurs in the following cases: An attempt was made to use a business partner category that does not exist.

The following values are currently permitted: 1 Person 2 Organization 3 Group No category was specified (content blank)."

FYI I am using khSupplier odata service imported from SAP Business ByDesign – OData API Examples | SAP Blogs / GitHub - SAP-samples/byd-api-samples: A set of Postman collections that enables users to consume SAP...

Business object is : Supplier

Please assist if you can.

Regards

Jay
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Jay,

the minimum data to be provided to create a supplier would be: name, category code and role. Unfortunately, the role is read-only and the category code is not exposed in the public solution model so far. Please request an enhancement of the public solution model (PSM) as described in my blog post SAP ByDesign Public Solution Model.

As an alternative approach, you may use the SOAP-service ManageSupplierIn to create the supplier.

Best regards,
Knut
Jay_Bhambhani
Explorer
0 Kudos
Thanks Kurt.

I tried SOAP referring your GitHub repository > Master Data > Create Supplier. Worked like a charm.

Much helpful.

 

Regards

Jay
0 Kudos

Hi Knut,

Thanks for the informative article.

I am using the khsalesorder Custom OData Service and trying to create a Sales Order via API calls through postman. But when I send multiple items in the Item object, I am facing an issue where the  unitCode is not getting populated for one of the items. I tried posting the community - https://answers.sap.com/questions/13497746/creating-a-sales-order-with-multiple-items-using-o.html

Can you please provide some guidance?

 

Thanks,

Srilekha

knutheusermann
Product and Topic Expert
Product and Topic Expert

Update 18 Feb. 2022:
Enhancement of OData service khproject: I added the live cycle status and the blocking status (referring to the UI field "On Hold") to the project summary task collection.

knutheusermann
Product and Topic Expert
Product and Topic Expert
Update 17. March 2022:

Custom OData service changes:

  • khsupplierinvoice: attachment folder added

  • tmserviceorder: execution block, reason for rejection, additional status codes, admin data, due dates

  • khemployee: org assignment added

  • khreportinglineunit (new custom OData service)


Postman collection Master Data changed:




  • New sample requests:

    • read reporting line units,

    • read org assignments with position, employees and managers



  • Misleading price list samples using OData removed (deviations between OData response and UI => recommend to use SOAP services to query price lists and price specifications)

ronald_vanherk
Explorer
0 Kudos
Hi Knut,

Is there also a way to create non project related time recordings? (Leave, Holiday etc)
EelcoE
Participant
0 Kudos
Hi Knut!

 

Thanks for this great resource.

I have a very specific question that we are a bit stuck on: is it possible to create a Purchase Request for Services through OData services?

We have setup an OData service for Purchase Requests, but somehow I suspect this will limit us to creating PRs for To-Stock Materials (same as creating a manual PR in the ByD UI) - is that correct?

We know we can create any kind of PR through SOAP webservices, so if OData will not work we'll go that way, but if OData is possible that would have our preference.

 

Thanks & kinds regards,

Eelco

 
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Update: Added project status elements to the root node of OData service khproject.
former_member799008
Discoverer
0 Kudos
Hello Knut !


Thank you very much for this documentation.
Your work is awesome. You clearly are our hero (in a french company working on CPI)

We have an issue with the khbusinesspartner, while trying to create a contact using BusinessPartnerCollection.

 


When using Postman and a JSon body, everything is working fine :

 
{
"SalesforceId_KUT": "SF123-224RFERE",
"LifeCycleStatusCode": "2",
"CategoryCode": "1",
"PersonGivenName": "Jacques",
"PersonFamilyName": "ROCHER",
"PersonGenderCode": "1",
"PersonBirthDate": null,
"Role": [
{
"RoleCode": "BUP001"
}
],
"CurrentDefaultAddressInformation": {
"ConventionalPhone": {
"FormattedNumberDescription": "+33 1 01 01 01 01"
},
"MobilePhone": {
"FormattedNumberDescription": "06 01 02 01 02"
},
"EMail": {
"URI": "test@test.com"
},
"PostalAddress": {
"HouseID": "12",
"StreetName": "rue du test",
"StreetPostalCode": "75000",
"CityName": "paris",
"RegionCode": null,
"CountryCode": "FR"
}
}
}

 

 


But, while in a CPI integration flow, we are able to register name, gender, role, but not any information in CurrentDefaultAddressInformation (ConventionalPhone, Email etc.) :


 
<?xml version='1.0' encoding='utf-8'?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://test.sapbydesign.com//sap/byd/odata/cust/v1/khbusinesspartner/">
<id>https://test.sapbydesign.com/sap/byd/odata/cust/v1/khbusinesspartner/BusinessPartnerCollection</id>
<title type="text">BusinessPartnerCollection</title>
<updated>2022-06-23T13:11:14.635Z</updated>
<category term="cust.BusinessPartner" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="BusinessPartnerCollection('A')" rel="edit" title="BusinessPartner"/>
<link href="BusinessPartnerCollection('A')/Role" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Role" title="Role" type="application/atom+xml;type=feed">
<m:inline>
<feed xml:base="https://test.sapbydesign.com//sap/byd/odata/cust/v1/khbusinesspartner/">
<id>https://test.sapbydesign.com/sap/byd/odata/cust/v1/khbusinesspartner/RoleCollection</id>
<title type="text">RoleCollection</title>
<updated>2022-06-23T13:11:14.635Z</updated>
<author>
<name/>
</author>
<link href="RoleCollection" rel="self" title="RoleCollection"/>
<entry>
<id>https://test.sapbydesign.com//sap/byd/odata/cust/v1/khbusinesspartner/RoleCollection</id>
<title type="text">RoleCollection</title>
<updated>2022-06-23T13:11:14.636Z</updated>
<category term="cust.Role" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="RoleCollection('A')" rel="edit" title="Role"/>
<content type="application/xml">
<m:properties>
<d:RoleCode>BUP001</d:RoleCode>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<link href="BusinessPartnerCollection('A')/CurrentDefaultAddressInformation" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentDefaultAddressInformation" title="CurrentDefaultAddressInformation" type="application/atom+xml;type=entry">
<m:inline>
<entry xml:base="https://test.sapbydesign.com//sap/byd/odata/cust/v1/khbusinesspartner/">
<id>https://test.sapbydesign.com//sap/byd/odata/cust/v1/khbusinesspartner/CurrentDefaultAddressInformationCollection</id>
<title type="text">CurrentDefaultAddressInformationCollection</title>
<updated>2022-06-23T13:11:14.636Z</updated>
<category term="cust.CurrentDefaultAddressInformation" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="CurrentDefaultAddressInformationCollection('A')" rel="edit" title="CurrentDefaultAddressInformation"/>
<link href="CurrentDefaultAddressInformationCollection('A')/EMail" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/EMail" title="EMail" type="application/atom+xml;type=entry">
<m:inline>
<entry xml:base="https://test.sapbydesign.com//sap/byd/odata/cust/v1/khbusinesspartner/">
<id>https://test.sapbydesign.com/sap/byd/odata/cust/v1/khbusinesspartner/EMailCollection</id>
<title type="text">EMailCollection</title>
<updated>2022-06-23T13:11:14.636Z</updated>
<category term="cust.EMail" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="EMailCollection('A')" rel="edit" title="EMail"/>
<content type="application/xml">
<m:properties>
<d:URI>test.test@test.com</d:URI>
</m:properties>
</content>
</entry>
</m:inline>
</link>
<content type="application/xml">
<m:properties/>
</content>
</entry>
</m:inline>
</link>
<content type="application/xml">
<m:properties>
<d:CategoryCode>1</d:CategoryCode>
<d:LifeCycleStatusCode>2</d:LifeCycleStatusCode>
<d:PersonGivenName>Gérard</d:PersonGivenName>
<d:PersonFamilyName>GUIGUILLE</d:PersonFamilyName>
<d:PersonGenderCode>1</d:PersonGenderCode>
<d:SalesforceId_KUT>SF23143-test102</d:SalesforceId_KUT>
</m:properties>
</content>
</entry>

 

Do you have any idea why it's not working properly from SAP CPI ?


Thank you in advance for your kind help !

Best regards.
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Guillaume,

Thanks a for your kind words 🙂 

Are you sending an xml-payload or json-payload from CPI to the ByD OData API? I think there are more detailed insights required to identify the root cause. Could you please address an incident to the CPI team to check the difference in the request send to ByD?

Thanks, Knut

former_member799008
Discoverer
0 Kudos
Hello Knut !

We are sending an xml-payload from CPI to ByD.

We will try to contact CPI Team with an incident.

Have a nice day.
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Update of OData examples for analytical data sources:

I enhanced the Postman collection "Analytics - Data Sources" and the associated Postman environment "Analytics" by new examples to illustrate how to expand the OData response of data sources to master data details and how to filter by master data IDs.
StefanieSchulke
Explorer
0 Kudos

Hi Knut,

Thanks for all the examples, they are really helpful!

In ByDesign it is possible to combine multiple customer invoice requests into one customer invoice. Is that also possible with one of your custom OData services?

 

Thanks, Stefanie

knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Stefanie,

in general customer invoice requests are combined into customer invoices by the invoice run. In the invoice run, you define as well the filter criteria to select the invoice requests to be taken account  and the invoice split criteria.

This means you cannot combine multiple invoice requests into a single invoice using an OData service on business object Customer Invoice Request, but you would need to create an OData service on the Invoice Run object. Unfortunately, the invoice run object is currently not part of the ByD public solution model (PSM). However you may request SAP to add the invoice run to the PSM as described in my blog post: SAP ByDesign Public Solution Model.

Exception:

ByD allows you to create "External Customer Invoice Request", which represent a billable document in a remote system. These external customer invoice requests can be created and released via SOAP web service, and if you send multiple external invoice requests with "SettlementPriorityCode>1</SettlementPriorityCode>" as bundle to ByD, then ByD combines those external invoice requests into a single invoice (of cause split criteria apply here as well).

Example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
<soapenv:Header/>
<soapenv:Body>
<glob:CustomerInvoiceRequestBundleMaintainRequest_sync>
<BusinessDocumentBasicMessageHeader>
</BusinessDocumentBasicMessageHeader>
<!-- Invoice request 1 -->
<CustomerInvoiceRequest actionCode="04" itemListCompleteTransmissionIndicator="false">
<ObjectNodeSenderTechnicalID>HDR_1</ObjectNodeSenderTechnicalID>
<BaseBusinessTransactionDocumentID>KH-BUNDLE-10</BaseBusinessTransactionDocumentID>
<Name>CIR Bundle Test 1</Name>
<!-- Settlement prio code: 1 - create invoices and release, 3 - Save invoice request.
Multple invoice requests with settlement prio code 1 are bundled into 1 invoice
if possible according invoice split criteria (same buyer, same sales unit, ...) -->
<SettlementPriorityCode>1</SettlementPriorityCode>
<BaseCancelledIndicator>false</BaseCancelledIndicator>
<ReferenceBusinessTransactionDocumentID>?</ReferenceBusinessTransactionDocumentID> <!-- External Reference -->
<BuyerParty>
<InternalID>CP100120</InternalID>
</BuyerParty>
<SalesUnitParty>
<InternalID>P1110</InternalID>
</SalesUnitParty>
<PricingTerms>
<PricingProcedureCode>PPSTD1</PricingProcedureCode>
<CurrencyCode>EUR</CurrencyCode>
</PricingTerms>
<CashDiscountTerms>
<!-- 1001 = immediately net; 1006 = 10 days 5% -->
<Code>1006</Code>
</CashDiscountTerms>
<!-- Invoice item | service product | tax code 505 derived by system -->
<Item>
<BaseBusinessTransactionDocumentItemID>10</BaseBusinessTransactionDocumentItemID>
<ReceivablesPropertyMovementDirectionCode>2</ReceivablesPropertyMovementDirectionCode>
<Description languageCode="EN">Repair (CIR 1)</Description>
<CashDiscountDeductibleIndicator>false</CashDiscountDeductibleIndicator>
<Product>
<InternalID>S200108</InternalID>
<TypeCode>2</TypeCode>
</Product>
<Quantity unitCode="HUR">10</Quantity>
<QuantityTypeCode>TIME</QuantityTypeCode>
<PriceAndTax>
<!-- List Price -->
<PriceComponent>
<TypeCode>7PR1</TypeCode>
<Rate>
<DecimalValue>10</DecimalValue>
<CurrencyCode>EUR</CurrencyCode>
<BaseDecimalValue>1</BaseDecimalValue>
<BaseMeasureUnitCode>HUR</BaseMeasureUnitCode>
</Rate>
</PriceComponent>
</PriceAndTax>
<ObjectNodeSenderTechnicalID>ITM_1</ObjectNodeSenderTechnicalID>
</Item>
</CustomerInvoiceRequest>
<!-- Invoice request 2 -->
<CustomerInvoiceRequest actionCode="04" itemListCompleteTransmissionIndicator="false">
<ObjectNodeSenderTechnicalID>HDR_1</ObjectNodeSenderTechnicalID>
<BaseBusinessTransactionDocumentID>KH-BUNDLE-11</BaseBusinessTransactionDocumentID>
<Name>CIR Bundle Test 2</Name>
<SettlementPriorityCode>1</SettlementPriorityCode>
<BaseCancelledIndicator>false</BaseCancelledIndicator>
<ReferenceBusinessTransactionDocumentID>?</ReferenceBusinessTransactionDocumentID> <!-- External Reference -->
<BuyerParty>
<InternalID>CP100120</InternalID>
</BuyerParty>
<SalesUnitParty>
<InternalID>P1110</InternalID>
</SalesUnitParty>
<PricingTerms>
<PricingProcedureCode>PPSTD1</PricingProcedureCode>
<CurrencyCode>EUR</CurrencyCode>
</PricingTerms>
<CashDiscountTerms>
<!-- 1001 = immediately net; 1006 = 10 days 5% -->
<Code>1006</Code>
</CashDiscountTerms>
<!-- Invoice item | service product | tax code 505 derived by system -->
<Item>
<BaseBusinessTransactionDocumentItemID>10</BaseBusinessTransactionDocumentItemID>
<ReceivablesPropertyMovementDirectionCode>2</ReceivablesPropertyMovementDirectionCode>
<Description languageCode="EN">Workshop (CIR 2)</Description>
<CashDiscountDeductibleIndicator>false</CashDiscountDeductibleIndicator>
<Product>
<InternalID>S200107</InternalID>
<TypeCode>2</TypeCode>
</Product>
<Quantity unitCode="HUR">10</Quantity>
<QuantityTypeCode>TIME</QuantityTypeCode>
<PriceAndTax>
<!-- List Price -->
<PriceComponent>
<TypeCode>7PR1</TypeCode>
<Rate>
<DecimalValue>20</DecimalValue>
<CurrencyCode>EUR</CurrencyCode>
<BaseDecimalValue>1</BaseDecimalValue>
<BaseMeasureUnitCode>HUR</BaseMeasureUnitCode>
</Rate>
</PriceComponent>
</PriceAndTax>
<ObjectNodeSenderTechnicalID>ITM_1</ObjectNodeSenderTechnicalID>
</Item>
</CustomerInvoiceRequest>
</glob:CustomerInvoiceRequestBundleMaintainRequest_sync>
</soapenv:Body>
</soapenv:Envelope>
Hanumath
Participant
0 Kudos

Hi knut.heusermann,

 

We are having a strange issue with the ODATA API for business objects. We tried all the means that are possible from our end and now commenting here for experts/your help.

We have an ODATA URL below where we wanted to filter the data by the SLTaskStatus with two options but the below service URL is executing and the result set is giving all the data irrespective of the status filter that is added. We are not sure if we are using the URL in the right way or not and filter attribute is the right way to add it here or not.

https://myXXXXX.sapbydesign.com/sap/byd/odata/cust/v1/readpicktasksdatalatst/SiteLogisticsTaskDataCo... eq '1' or SLTaskStatus eq '2')

 

Could you please help us as we are standing in dark with no further direction or clue known?

 

Thank you for your time and suggestions here on this issue.

 

Regards

Hanu K

knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Hanu,

your sample URL appears to be an OData request on a function import of type query. In such requests the filter-parameters have no impact, but you would need to use the parameters of the function (you find these parameters in the OData metadata).

Here is an example using the business partner:

  1. Get business partners using the query function import "QueryByElements":
    GET <hostname>/sap/byd/odata/cust/v1/khbusinesspartner/QueryByElements?NumberOfRows='20'&InternalID='{{BP-CustomerID}}'

  2. Get business partner using filter:
    GET <hostname>/sap/byd/odata/cust/v1/khbusinesspartner/BusinessPartnerCollection?$format=json&$filter=InternalID eq '{{BP-CustomerID}}'&$top=20


Best regards,
Knut

 
Hanumath
Participant
0 Kudos
Thanks, knut.heusermann for the response.

Yes, you are right, I am using the function import of type query and this query is a standard query by elements available with the object. The below URL is using the filter parameters as shown from the metadata. I am giving the metadata of our service please let me know the issue with the below URL I am using to filter the data by the status (field is SLTaskStatus. I have highlighted (made BOLD) the section from the metadata that is related to the function import query

Service URL: https://myXXXXXX.sapbydesign.com/sap/byd/odata/cust/v1/readpicktasksdatalatst/SiteLogisticsTaskDataC... eq '{2}'

The above URL is still not filtering the data and returning all the data records irrespective of the status I want. Not sure what is mistake I am doing here and missing doing it right. Please help here.

Meta Data:

<edmx:Edmx Version="1.0">
<edmx:DataServices m:DataServiceVersion="2.0">
<Schema Namespace="cust">
<EntityType Name="SiteLogisticsTaskDataCollectionRoot">
<Key>
<PropertyRef Name="ObjectID"/>
</Key>
<Property Name="ObjectID" Type="Edm.String" Nullable="false" MaxLength="70" FixedLength="true" sap:creatable="false" sap:updatable="false" sap:filterable="true"/>
<Property Name="ActivityType" Type="Edm.String" Nullable="true" MaxLength="10" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionRootActivityTypeCollection"/>
<Property Name="ChangedBy" Type="Edm.String" Nullable="true" FixedLength="false" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="CreatedBy" Type="Edm.String" Nullable="true" FixedLength="false" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="RefSOFMFName" Type="Edm.String" Nullable="true" FixedLength="false" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="RefSOFMFID" Type="Edm.String" Nullable="true" MaxLength="20" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="RefSOID" Type="Edm.String" Nullable="true" MaxLength="35" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="RefSOStoreName" Type="Edm.String" Nullable="true" FixedLength="false" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="RefSOStoreID" Type="Edm.String" Nullable="true" MaxLength="10" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLRequestProcessingTypeCode" Type="Edm.String" Nullable="true" MaxLength="4" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionRootSLRequestProcessingTypeCodeCollection"/>
<Property Name="SLRequestTypeCode" Type="Edm.String" Nullable="true" MaxLength="15" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionRootSLRequestTypeCodeCollection"/>
<Property Name="SLRequestProcessTypeCode" Type="Edm.String" Nullable="true" MaxLength="2" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionRootSLRequestProcessTypeCodeCollection"/>
<Property Name="SLRequestSiteName" Type="Edm.String" Nullable="true" FixedLength="false" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLRequestID" Type="Edm.String" Nullable="true" MaxLength="35" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLRequestSiteID" Type="Edm.String" Nullable="true" MaxLength="20" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLRequestLifeCycleStatus" Type="Edm.String" Nullable="true" MaxLength="2" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionRootSLRequestLifeCycleStatusCollection"/>
<Property Name="SLRequestReleaseStatus" Type="Edm.String" Nullable="true" MaxLength="2" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionRootSLRequestReleaseStatusCollection"/>
<Property Name="SLRequestUUID" Type="Edm.Guid" Nullable="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskID" Type="Edm.String" Nullable="true" MaxLength="35" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskStatus" Type="Edm.String" Nullable="true" MaxLength="2" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionRootSLTaskStatusCollection"/>
<Property Name="SLTaskLotOpActUUID" Type="Edm.Guid" Nullable="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskUUID" Type="Edm.Guid" Nullable="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="CreationDateTime" Type="Edm.DateTimeOffset" Nullable="true" Precision="7" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="LastChangeDateTime" Type="Edm.DateTimeOffset" Nullable="true" Precision="7" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskPriorityDescription" Type="Edm.String" Nullable="true" FixedLength="false" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskPriority" Type="Edm.String" Nullable="true" MaxLength="1" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionRootSLTaskPriorityCollection"/>
<NavigationProperty Name="SiteLogisticsTaskDataCollectionSLTaskItems" Relationship="cust.SiteLogisticsTaskDataCollectionRoot_SiteLogisticsTaskDataCollectionSLTaskItems" FromRole="SiteLogisticsTaskDataCollectionRoot" ToRole="SiteLogisticsTaskDataCollectionSLTaskItems"/>
</EntityType>
<EntityType Name="SiteLogisticsTaskDataCollectionSLTaskItems">
<Key>
<PropertyRef Name="ObjectID"/>
</Key>
<Property Name="ObjectID" Type="Edm.String" Nullable="false" MaxLength="70" FixedLength="true" sap:creatable="false" sap:updatable="false" sap:filterable="true"/>
<Property Name="ParentObjectID" Type="Edm.String" Nullable="true" MaxLength="70" FixedLength="true" sap:creatable="true" sap:updatable="false" sap:filterable="true"/>
<Property Name="SLTaskItemSourceLogisticsID" Type="Edm.String" Nullable="true" MaxLength="40" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemSourceLogisticsSiteID" Type="Edm.String" Nullable="true" MaxLength="20" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemRefSOItemUUID" Type="Edm.Guid" Nullable="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemPlannedQuantity" Type="Edm.Decimal" Nullable="true" Precision="31" Scale="14" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="unitCode" Type="Edm.String" Nullable="true" MaxLength="3" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionSLTaskItemsunitCodeCollection"/>
<Property Name="SLTaskItemRefSOItemQuantity" Type="Edm.Decimal" Nullable="true" Precision="31" Scale="14" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="unitCode1" Type="Edm.String" Nullable="true" MaxLength="3" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionSLTaskItemsunitCode1Collection"/>
<Property Name="SLTaskItemTotalConfirmedQuantity" Type="Edm.Decimal" Nullable="true" Precision="31" Scale="14" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="unitCode2" Type="Edm.String" Nullable="true" MaxLength="3" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionSLTaskItemsunitCode2Collection"/>
<Property Name="SLTaskItemRefSLRequestItemQuantity" Type="Edm.Decimal" Nullable="true" Precision="31" Scale="14" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="unitCode3" Type="Edm.String" Nullable="true" MaxLength="3" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionSLTaskItemsunitCode3Collection"/>
<Property Name="SLTaskItemOpenQuantity" Type="Edm.Decimal" Nullable="true" Precision="31" Scale="14" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="unitCode4" Type="Edm.String" Nullable="true" MaxLength="3" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true" c4c:value-help="SiteLogisticsTaskDataCollectionSLTaskItemsunitCode4Collection"/>
<Property Name="SLTaskItemProductDescription" Type="Edm.String" Nullable="true" FixedLength="false" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemIDStock" Type="Edm.String" Nullable="true" MaxLength="20" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemRefSOItemID" Type="Edm.String" Nullable="true" MaxLength="10" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskLotMatOutputUUID" Type="Edm.Guid" Nullable="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemMatUUID" Type="Edm.Guid" Nullable="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskLotMatInputUUID" Type="Edm.Guid" Nullable="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemProductID" Type="Edm.String" Nullable="true" MaxLength="40" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemRefItemSOID" Type="Edm.String" Nullable="true" MaxLength="35" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemRefItemSORequestedDeliveryDate" Type="Edm.DateTime" Nullable="true" Precision="0" sap:creatable="true" sap:updatable="true" sap:filterable="true" sap:display-format="Date"/>
<Property Name="SLTaskItemRefItemSOStoreID" Type="Edm.String" Nullable="true" MaxLength="10" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemRefItemSOFMFID" Type="Edm.String" Nullable="true" MaxLength="20" FixedLength="true" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemRefItemSOFMFName" Type="Edm.String" Nullable="true" FixedLength="false" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<Property Name="SLTaskItemRefItemSOStoreName" Type="Edm.String" Nullable="true" FixedLength="false" sap:creatable="true" sap:updatable="true" sap:filterable="true"/>
<NavigationProperty Name="SiteLogisticsTaskDataCollectionRoot" Relationship="cust.SiteLogisticsTaskDataCollectionRoot_SiteLogisticsTaskDataCollectionSLTaskItems" FromRole="SiteLogisticsTaskDataCollectionSLTaskItems" ToRole="SiteLogisticsTaskDataCollectionRoot"/>
</EntityType>
<EntityType Name="CodeList">
<Key>
<PropertyRef Name="Code"/>
</Key>
<Property Name="Code" Type="Edm.String" Nullable="false" FixedLength="false" sap:creatable="false" sap:updatable="false" sap:filterable="true"/>
<Property Name="Description" Type="Edm.String" Nullable="false" FixedLength="false" sap:creatable="false" sap:updatable="false" sap:filterable="true"/>
</EntityType>
<Association Name="SiteLogisticsTaskDataCollectionRoot_SiteLogisticsTaskDataCollectionSLTaskItems">
<End Type="cust.SiteLogisticsTaskDataCollectionRoot" Multiplicity="1" Role="SiteLogisticsTaskDataCollectionRoot"/>
<End Type="cust.SiteLogisticsTaskDataCollectionSLTaskItems" Multiplicity="*" Role="SiteLogisticsTaskDataCollectionSLTaskItems"/>
</Association>
<EntityContainer Name="readpicktasksdatalatst" m:IsDefaultEntityContainer="true">
<EntitySet Name="SiteLogisticsTaskDataCollectionRootActivityTypeCollection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionRootCollection" EntityType="cust.SiteLogisticsTaskDataCollectionRoot" sap:creatable="true" sap:updatable="true" sap:deletable="true"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionRootSLRequestLifeCycleStatusCollection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionRootSLRequestProcessTypeCodeCollection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionRootSLRequestProcessingTypeCodeCollection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionRootSLRequestReleaseStatusCollection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionRootSLRequestTypeCodeCollection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionRootSLTaskPriorityCollection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionRootSLTaskStatusCollection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionSLTaskItemsCollection" EntityType="cust.SiteLogisticsTaskDataCollectionSLTaskItems" sap:creatable="true" sap:updatable="true" sap:deletable="true"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionSLTaskItemsunitCode1Collection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionSLTaskItemsunitCode2Collection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionSLTaskItemsunitCode3Collection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionSLTaskItemsunitCode4Collection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<EntitySet Name="SiteLogisticsTaskDataCollectionSLTaskItemsunitCodeCollection" EntityType="cust.CodeList" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:semantics="fixed-values"/>
<AssociationSet Name="SiteLogisticsTaskDataCollectionRootCollection_SiteLogisticsTaskDataCollectionSLTaskItemsCollection" Association="cust.SiteLogisticsTaskDataCollectionRoot_SiteLogisticsTaskDataCollectionSLTaskItems" sap:creatable="true" sap:updatable="false" sap:deletable="false">
<End EntitySet="SiteLogisticsTaskDataCollectionRootCollection" Role="SiteLogisticsTaskDataCollectionRoot"/>
<End EntitySet="SiteLogisticsTaskDataCollectionSLTaskItemsCollection" Role="SiteLogisticsTaskDataCollectionSLTaskItems"/>
</AssociationSet>
<FunctionImport Name="SiteLogisticsTaskDataCollectionRootQueryByElements" ReturnType="Collection(cust.SiteLogisticsTaskDataCollectionRoot)" EntitySet="SiteLogisticsTaskDataCollectionRootCollection" m:HttpMethod="GET">
<Parameter Name="NumberOfRows" Type="Edm.String" Mode="In"/>
<Parameter Name="StartRow" Type="Edm.String" Mode="In"/>
<Parameter Name="SysAdminData_LastChangeDateTime" Type="Edm.DateTimeOffset" Mode="In" Precision="0"/>
<Parameter Name="ActivityType" Type="Edm.String" Mode="In" Precision="0"/>
<Parameter Name="RefSOID" Type="Edm.String" Mode="In" Precision="0"/>
<Parameter Name="RefSOFMFID" Type="Edm.String" Mode="In" Precision="0"/>
<Parameter Name="SLTaskStatus" Type="Edm.String" Mode="In" Precision="0"/>
<Parameter Name="SLRequestLifeCycleStatus" Type="Edm.String" Mode="In" Precision="0"/>
<Parameter Name="SLRequestReleaseStatus" Type="Edm.String" Mode="In" Precision="0"/>
<Parameter Name="SLRequestProcessingTypeCode" Type="Edm.String" Mode="In" Precision="0"/>
<Parameter Name="SLRequestProcessTypeCode" Type="Edm.String" Mode="In" Precision="0"/>
<Parameter Name="SLRequestTypeCode" Type="Edm.String" Mode="In" Precision="0"/>
</FunctionImport>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>

 

Regards

Hanumath K
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Hanumath,

the following URL should do the job:

https://myXXXXXX.sapbydesign.com/sap/byd/odata/cust/v1/readpicktasksdatalatst/SiteLogisticsTaskDataCollectionRootQueryByElements?SLTaskStatus='2'

You can use the http-header-parameter "Accept=application/json" to get a json response ($format=json does not work for function imports).
Hanumath
Participant
0 Kudos
Thanks, knut.heusermann . This works. As said earlier our need to use a filter is to get two status-related records at a time. i.e.we would like to look at the data records that consist of both status 1 and 2 from the list.

we tried the below URLs to get the records accordingly but had no luck in getting the desired result.

https://myXXXXXX.sapbydesign.com/sap/byd/odata/cust/v1/readpicktasksdatalatst/SiteLogisticsTaskDataCollectionRootQueryByElements?SLTaskStatus='2' or '1'

https://myXXXXXX.sapbydesign.com/sap/byd/odata/cust/v1/readpicktasksdatalatst/SiteLogisticsTaskDataCollectionRootQueryByElements?SLTaskStatus='2'&SLTaskStatus='1'

In both the above formats the data records are only showing in the result set that has the status 2 but not the records that have 1.

This is our main purpose to use the filter and see if the filter can achieve the desired result in one call rather than doing and getting the result in two different calls.

Is there a format or way that we can use the URL to filter the records having both 1 and 2 as statuses?

Please help here.

 

Regards,

Hanumath K
knutheusermann
Product and Topic Expert
Product and Topic Expert
Then using entity SiteLogisticsTaskDataCollectionRootCollection and the filter would be the better fit:

https://myXXXXXX.sapbydesign.com/sap/byd/odata/cust/v1/readpicktasksdatalatst/SiteLogisticsTaskDataC... eq '1' or SLTaskStatus eq '2'
Hanumath
Participant
0 Kudos
Thanks, knut.heusermann . This worked and this helps a lot.

 

A couple more clarifications in this regard, in the above URL we can even add other params along with the SLTaskStatus in the filter right?

I mean we wanted to add the Last Changed DateTime as an additional filter and our format is as below and hope this URL will work without issues.

https://myXXXXXX.sapbydesign.com/sap/byd/odata/cust/v1/readpicktasksdatalatst/SiteLogisticsTaskDataC... eq '1' or SLTaskStatus eq '2' and LastChangeDateTime ge datetime '2022-11-01T00:00:00'


 

Thanks once again for your responses and guidance on this issue Knut.

 

Regards

Hanumath K

 
Hanumath
Participant
0 Kudos
Hi knut.heusermann


It would be helpful if you can help with my last comment?  For your reference, I am posting the same again below here

_____________________________

A couple more clarifications in this regard, in the above URL we can even add other params along with the SLTaskStatus in the filter right?

I mean we wanted to add the Last Changed DateTime as an additional filter and our format is as below I hope this URL will work without issues.

https://myXXXXXX.sapbydesign.com/sap/byd/odata/cust/v1/readpicktasksdatalatst/SiteLogisticsTaskDataC... eq '1' or SLTaskStatus eq '2' and LastChangeDateTime ge datetime '2022-11-01T00:00:00'


 

Thanks once again for your responses and guidance on this issue Knut.

 

Regards

Hanumath K
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Hanumath,

In general the filter format depends on the property attributes "Type" and "sap:filterable" provided in the OData metadata. In Custom OData Services for business objects the LastChangeDateTime has the data type "Edm.DateTimeOffset" in most cases.

For materials you can for example request all products that has been changed since March 17th using the filter LastChangeDateTime ge datetimeoffset'2022-03-17T00:00:00Z'.

GET https://myXXXXXX.sapbydesign.com/sap/byd/odata/cust/v1/vmumaterial/MaterialCollection?$filter=Intern... eq 'P100401' and LastChangeDateTime ge datetimeoffset'2022-03-17T00:00:00Z'&$format=json

If the data type is "Edm.DateTime", then a filter like PARA_CAL_DAY ge datetime'2019-01-01T00:00:00' does the job; for example for report "Invoice Volume":

GET https://myXXXXXX.sapbydesign.com/sap/byd/odata/crm_customerinvoicing_analytics.svc/RPCRMCIVIB_Q0001Q...PARA_CAL_DAY ge datetime'2019-01-01T00:00:00'&$top=600

For your specific example, please check the metadata of your custom OData service and test your request in some API test tool such as Postman.
Hanumath
Participant
0 Kudos
Thanks for all your help and guidance knut.heusermann . So far everything worked as expected and we are able to continue with the work for the client as required.

Appreciate all your support here in the community and helping the people.

 

Regards

Hanumath K
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Update of master data and sales order samples:

Custom OData service changes:

  • khsalesorder --- product recipient party details enhanced by address information
  • khaddresssnapshot --- new custom OData service

Postman collection and Postman environment Master Data changed:

  • Sales Prices: Samples to read sales price lists with filter and paging added.
  • Address Snapshot: Examples to read and write address information and to change the address information in business transactional documents added (example: sales order ship-to party  address).
    => Check the documentation of the Postman collection Master Data for more details about address snapshots and business document specific address information.

Postman collection Sales and Commerce Scenarios changed:

  • Create Follow-up Sales Order: Example scenario to create follow-up sales order added.
melaniebergbold
Explorer
0 Kudos
Hi Knut,

thanks for this great summary!

We are looking for a way to build our organizational structure in another system via ODATA by using the parent-child information. For costcenters this information is available in Data Source: Cost Center Master Data. Is there a way to get such information for the whole org-structure?

We tried to achieve this with khfunctionalunit, khcompany, khbusinessresidence, khcostcentre and khprofitcentre, but couldn't find the superordinate org-unit for all of these.

Thank you & kind regards,

Melanie
former_member509776
Discoverer
0 Kudos
Hello @knut.heusermann ,

 

We are trying to integrate SAP ByDesign with our system. We managed to build a event notification pipeline. Now are receiving UUID of customer invoice but we couldn't find any soap or rest services to fetch invoice. Do you have a API for it?

Also I tried to use one of your APIs but I am getting authorization issues. Where do you set user for these APIs?

Thank you very much in advance.

 

Best Regards
knutheusermann
Product and Topic Expert
Product and Topic Expert

Hi Melanie,

Using custom OData services you can read organizational structures along specific roles such as cost centers, reporting line units, functional units, ... only, because the public solution model is designed to deliver the organization structure that serves specific functional areas of a company. Basically, you can include all kind of superordinate org units and with that information re-assemble the org structures as displayed in work center view "Organizational Management - Org Structures".
Additionally, if you can make specific assumption on the org structure (e.g. the number of levels, ...) and adapt the custom OData service to simplify the response structure.  

However, to overcome these complexities we are planning a standard OData service in release 23.02 to read ByD organizational structures across org unit roles and functions similar to the representation in work center view "Organizational Management - Org Structures".

An API to create or change ByD organizational structures is not planned as of now.

Best regards,
Knut

knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Emrah,

you can retrieve ByD customer invoices using custom OData services (see example service khcustomerinvoice) or the SOAP service QueryCustomerInvoiceIn.

Your question sounds like you want to retrieve the customer invoice triggered by the event notification message, isn't it?
In this case I would recommend to use a communication user (technical user) to call the custom OData service: Configure a communication arrangement for communication scenario “OData Services for Business Objects” and select the Custom OData Service for customer invoices. In result the communication user configured in the communication arrangement gets the authorization for the Custom OData Service.

Best regards,
Knut

 
former_member509776
Discoverer
0 Kudos
Hi Knut,

 

This method worked flawlessly thank you very much for the help and your prompt reply.

 

Best Regards
Mikiichi
Explorer
0 Kudos
Hi Knut,

I am trying to do Post Goods Receipt using khinbounddelivery in SAP Data services.

Postman works fine like this:




 


In SAP Data services, as with Postman, I'm trying to post using a token after taking it, but it doesn't work.


Would you like to give me some advices for creating REST API POST in SAP Data services?

 

Best regards,
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Mikiichi,

maybe you need to fetch additionally the x-csrf-token in the GET-request and add it to the http-header of the POST-request (compare http-headers of the request- and response headers as well as the Test-scripts in my Postman collections).
Do you have some detailed error message in SAP Data services?

 
Mikiichi
Explorer
0 Kudos
Hi Knut,

Thank you for your reply.

I can get the token, but there are two error messages.

One is Malformed URI Literal syntax, and the other is HTTP erro 400.


Could you please give me some advices?


 

Best regards,
knutheusermann
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Mikiichi,

The http-code 400 means that the error is on consumer side. The error message "Malformed URI ..." means that the http-request is not correctly formatted from a syntax point of view. I would suggest that you compare the URI used by Postman with the URI used in your SAP Data service flow. This may guide you to the root cause. In case this does not help as well, then please open an incident for SAP Data services.
Mikiichi
Explorer
0 Kudos
Hi Knut,

 

Thank you very much for your quickly reply. I create a new WADL via SOAPUI following your advice and I set it data services. It works well without some error messages.

Some issues remain yet, but they are caused by data services, so I will open an incident for data services.

Best regards,
Niko
Explorer
0 Kudos
Hi Knut,

Thanks for your blog.

We have a customer ByD project ongoing, where the scope is to connect the advanced planning & scheduling system (APS) with SAP ByD integration. In detail to the production area.

Could you please confirm, is it possible for SAP ByD to perform a resource exchange for an already existing production order using the web service of the integrations?

I have browsed several SOAP services without success. I've tried building Odata but I can't find the record to edit.

The function should be exactly the same as your colleague in the blog below. But the need would be to use either SOAP or Odata service.

https://blogs.sap.com/2022/02/04/change-resources-in-production-orders/

 

Br. Niko
arunathakar
Participant
0 Kudos
Hello Knut,

 

Thank you for this important information. We are using OData APIS for Reports (analytics).

Following is the url.

https://myXXXXXX.sapbydesign.com/sap/byd/odata/CRM_WOC_SALESORDERS_analytics.svc/RPZ2DD19FB7D50D3D7B...

This url worked in 2022 but now we are facing login error when we are trying to access the report through power BI. Following is the error:

"The credentials provided for the OData are invalid."

I tried by resetting the pwd and relogging in but still facing the same issue. Do we need specific access to get the data? (Developer access) User has sales order reports and analytics access.

Thank you.