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: 
arunml
Advisor
Advisor

Definition: 


An interface to query Purchase Orders from a source system.

 
















Description Query Purchase Orders
Name QueryPurchaseOrderQueryIn










Operations Find purchase orders


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.
















Inclusion Exclusion Code Description
E Excluding
I Including

 




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.


































































Interval Boundary Type Code Name Description Logical Operator
1 Equal to Single Value =X
2 Between(Excluding upper boundary) Interval with closed lower and open upper boundary [X, Y)
3 Between Interval with open lower and open upper boundary (X, Y)
4 Between (excluding both boundaries) Interval with open lower and open upper boundary (X, Y)
5 Between (excluding lower boundary) Interval with open lower and closed upper boundary (X, Y]
6 Less than Interval with unlimited lower and open upper boundary < X
7 Less than or Equal to Interval with unlimited lower and closed upper boundary <= X
8 Greater than Interval with open lower and unlimited upper boundary > X
9 Greater than or Equal to Interval with closed lower and unlimited upper boundary = X




 

Transmission Request Code in RequestedElements specifies which elements shall be returned
























Code Description
1 The node element, all its elements and its child node elements and all their elements shall be returned.
2 The node element and all its elements shall be returned.
3 The node element and its key elements shall be returned.
4 The node element and its child node elements shall not 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:
















































Code Remark
1 In Preparation
2 In Approval
3 In Revision
4 Rejected
5 Not Yet Acknowledged
6 Sent
7 Acknowledgment Received
8 Canceled
9 Follow-Up Document Created
10 Finished



Approval related status of Purchase Order:






































Code Remark
1 Not Started
2 Approval not Necessary
3 In Approval
4 Approved
5 Rejected
6 In Revision
7 Withdrawn



The Status of processing the invoicing on Purchase Order:






























Code Remark
1 Not Started
2 In Process
3 Finished
4 Not Relevant
5 Interrupted



The Status of invoicing on Purchase Order:


























Code Remark
1 Not Invoiced
2 Partially Invoiced
3 Invoiced
4 Not Relevant



The Status of delivery on Purchase Order:


























Code Remark
1 Not Delivered
2 Partially Delivered
3 Delivered
4 Not Relevant


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:

  1. 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>