Definition:
An interface to query Purchase Orders from a source system.
Business Use Case:
The web service Interface ‘Query PurchaseOrderQuery In’ enables you to connect external applications to your SAP Business By Design system and to query Purchase Orders in your system. The web service interface ‘Query PurchaseOrderQuery In’ is relevant if your company wants to access Purchase Orders data from external applications.
Selection Parameters:
Query selection parameters are mainly exposed as select options or ranges, with an inclusion/exclusion code, interval boundary type code, lower boundary value, and upper boundary value.
The interval boundary type code (element name IntervalBoundaryTypeCode) is used to describe intervals by their boundaries. Depending on the operator, the lower boundary value or both boundary values are relevant.
Transmission Request Code in RequestedElements specifies which elements shall be returned
Prerequisites:
Before a query is executed on Purchase Orders , instance of Purchase Orders has to be created and maintained first.
The lifecycle status of Purchase Order:
Approval related status of Purchase Order:
The Status of processing the invoicing on Purchase Order:
The Status of invoicing on Purchase Order:
The Status of delivery on Purchase Order:
You can query POs on the below parameters:
- <SelectionByID>
- <SelectionBySystemAdministrativeDataCreationDateTime>
- <SelectionByOrderedDateTime>
- <SelectionByTotalNetAmount>
- <SelectionByPartyBuyerPartyKeyPartyID>
- <SelectionByPartyEmployeeResponsiblePartyKeyPartyTypeCode>
- <SelectionByPartyEmployeeResponsiblePartyKeyPartyID>
- <SelectionByPartyResponsiblePurchasingUnitPartyKeyPartyID>
- <SelectionByPartySellerPartyKeyPartyTypeCode>
- <SelectionByPartySellerPartyKeyPartyID>
- <SelectionByApprovalStatus>
- <SelectionByDeliveryProcessingStatus>
- <SelectionByInvoiceProcessingStatus>
- <SelectionByPurchaseOrderLifeCycleStatusCode>
- <SelectionByItemDescription>
- <SelectionByItemFollowUpDecisionStatus>
- <SelectionByBusinessTransactionDocumentReferenceGoodsAndServiceAcknowledgementID>
For more details refer to Help document available in Service Explorer view.
Scenarios:
Possible scenarios include the following: Find Purchase Orders based on certain set of information like purchase order ID, Supplier ID, approval status etc.
Find the below samples executed in SOAP UI:
- Query purchase order by selection ID
Payload Request:
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="
http://sap.com/xi/SAPGlobal20/Global">
<soapenv:Header/>
<soapenv:Body>
<glob:PurchaseOrderSimpleByElementsQuery_sync>
<PurchaseOrderSimpleSelectionByElements>
<SelectionByID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryID>11</LowerBoundaryID>
<UpperBoundaryID>24</UpperBoundaryID>
</SelectionByID>
</PurchaseOrderSimpleSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>100</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
</glob:PurchaseOrderSimpleByElementsQuery_sync>
</soapenv:Body>
</soapenv:Envelope>
2.
Query Purchase Orders based on Supplier ID:
Payload Request:
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="
http://sap.com/xi/SAPGlobal20/Global">
<soapenv:Header/>
<soapenv:Body>
<glob:PurchaseOrderSimpleByElementsQuery_sync>
<PurchaseOrderSimpleSelectionByElements>
<SelectionByPartySellerPartyKeyPartyID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundarySellerPartyID>Supplier ID</LowerBoundarySellerPartyID>
</SelectionByPartySellerPartyKeyPartyID>
</PurchaseOrderSimpleSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>500</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
</glob:PurchaseOrderSimpleByElementsQuery_sync>
</soapenv:Body>
</soapenv:Envelope>
3.
Query purchase order based on Approval status
Payload Request:
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="
http://sap.com/xi/SAPGlobal20/Global">
<soapenv:Header/>
<soapenv:Body>
<glob:PurchaseOrderSimpleByElementsQuery_sync>
<PurchaseOrderSimpleSelectionByElements>
<SelectionByApprovalStatus>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryApprovalStatusCode>3</LowerBoundaryApprovalStatusCode>
</SelectionByApprovalStatus>
</PurchaseOrderSimpleSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>500</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
</glob:PurchaseOrderSimpleByElementsQuery_sync>
</soapenv:Body>
</soapenv:Envelope>