Description | Query Purchasing Contract |
Name | QueryPurchasingContractQueryIn |
Namespace | http://sap.com/xi/A1S/Global |
Process Component Description | Purchasing Contract Processing |
Process Component Name | PurchasingContractProcessing |
Process Component Namespace | http://sap.com/xi/AP/Purchasing/Global |
Deployment Unit Description | Purchasing |
Endpoint Activation | By Scoping of Process Component | Operations |
Release Status | Released |
An interface to query purchasing contract from a source system.
The web service interface Query PurchasingContractQuery In enables you to connect external applications to your SAP Business ByDesign system and to query purchasing contract in your system. The web service interface Query PurchasingContractQuery In is relevant if your company wants to access purchasing contract data from external applications.
In the Sourcing and Contracting work center, in the Contracts view, click New and choose Contract.
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 inclusion/exclusion code (element name InclusionExclusionCode) specifies the inclusion or exclusion of a set in a result set.
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. |
Before a query is executed on Purchasing Contract , instance of Purchasing Contract has to be created and maintained first.
Action codes represent an instruction to the recipient of the web service request to process transmitted message node elements.
The action code to be used is QUERY_BY_ELEMENTS.
Optional leaf elements in request messages that are not transmitted within a web service request are not considered while querying. Therefore, any value of missing parameters would meet the comparison.
Query operation is stateless synchronous web service operation. Transferring or requesting amounts of data that are too large causes communication timeouts. The web service consumer is responsible for ensuring reasonable sizes of data for mass operations.
The structure of the request message type consists of two parts:
• Selection parameters for the query.
• Processing conditions. This specifies the limit on the output i.e number of records returned. You can also specify if you want unlimited number of records.
Many external applications consuming web services have special requirements and restrictions regarding the format of WSDLs. Some external applications require service definition WSDLs describing the web service signature. This is normally sufficient for the creation of static client-side proxies. Other external applications, normally those that do not create static client-side proxies, require binding WSDLs including the endpoint definition and authentication policy information.
In both cases, it may be the case that the external application imposes special restrictions on the structure or the size of WSDLs.
Microsoft InfoPath requires binding WSDLs and considers elements with the attribute "minOccurs=0" as "mandatory". However "minOccurs=0" means "optional" in SAP web services. In order to circumvent this problem, the WSDL must be saved locally and an additional attribute "nillable=true" must be added to make a query parameter optional for Microsoft InfoPath.
For very small clients such as mobile devices, the size of the WSDL itself may become a problem. In most cases the client only requires a very small part of the signature, but due to the complexity of the WSDL they may end up with long runtime during serialization of the request or deserialization of the response. In order to circumvent this problem, the WSDL must be saved locally and the optional parts of the signature have to be removed before the WSDL is imported or static client-side proxies are generated.
External applications have to take into account that web service request and response message types can be enhanced with additional elements and attributes. Enhancements can be created by SAP, SAP partners, and key users. Enhancements of request message types are always optional elements or attributes. The SAP system does not require the external application to provide values in the request. Enhancements of response message types can contain mandatory elements or attributes. The external application must be able to process the extended response successfully.
XML element and attribute names are always stable. Technical definitions of data types can be enhanced in a compatible way. This may result in changed data type names. External applications can rely on XML element names and attribute names, but should not rely on data type names.
Note: You can download the WSDL file for any web service here:
• Application and User Management work center -> Input Output Management -> Communication Arrangement.
• User Management work center -> Service Explorer view.
You can find the documentation of the global data types in the SAP Community Network: Go to http://scn.sap.com/docs/DOC-17516 and click View Document.
You can find general information about Web services, their structure and consumption in the Web Services documentation.
Possible scenarios include the following:
• Find Purchasing Contract based on certain set of information like parties etc.
Description | Find purchasing contract |
Name | FindSimpleByElements |
Synchronous | yes |
Release Status | Released |
QueryPurchasingContractIn interface allows to query on existing purchasing contract in the system.
The request message of the QueryByElements contain two parts: Body and Processing Conditions. Body comprises of the various parameters on which Purchasing Contract can be queried. Details on these parameters is discussed in the following sub-sections. Processing conditions control the execution of query. For example, you can specify if you want a certain number of records as output or unlimited records should be shown.
The response message contains the header level relevant attributes of purchasing contract along with the processing conditions. The processing condition here indicates that how many records are returned and if there are any more existing records, which meet the criteria but not fetched.
The search can contain complex criteria instead of having simple equation. You can get results based on equal to or a range or less than or greater than logical operations. These type codes should be specified in the request message.
The web service QueryPurchasingContractQueryIn offers the operation QUERY_BY_ELEMENTS.
Structure of the request message has the following parameters based on which purchasing contract can be searched:
Element | Remark |
---|---|
SelectionBySearchText | You can specify anything in this text and if this text exists for any Purchasing Contract it will show up in result |
SelectionByID | ID of the Purchasing Contract |
SelectionByStrategicSourcingProjectReferenceProjectID | Strategic Sourcing Project Reference Project ID |
SelectionByStrategicSourcingProjectReferenceProjectName | Strategic Sourcing Project Reference Project Name |
SelectionByStrategicSourcingProjectReferenceProjectElementID | Strategic Sourcing Project Reference Project Element ID |
SelectionByStrategicSourcingProjectReferenceProjectElementName | Strategic Sourcing Project Reference Project Element Name |
SelectionByStrategicSourcingProjectReferenceProjectElementTypeCode | Strategic Sourcing Project Reference Project Element Type Code |
SelectionBySystemAdministrativeDataCreationDateTime | Creation date of Purchasing Contract |
SelectionBySystemAdministrativeDataLastChangeDateTime | Last changed date of Purchasing Contract |
SelectionByCreationBusinessPartnerCommonPersonNameFamilyName | Family Name of the employee who created the Purchasing Contract |
SelectionByCreationBusinessPartnerCommonPersonNameGivenName | Given Name of the employee who created the Purchasing Contract |
SelectionByLastChangeBusinessPartnerCommonPersonNameFamilyName | Family Name the employee who updated the Purchasing Contract |
SelectionByLastChangeBusinessPartnerCommonPersonNameGivenName | Given Name the employee who updated the Purchasing Contract |
SelectionByTypeCode | Type Code of Purchasing Contract |
SelectionByProcessingTypeCode | Processing Type Code |
SelectionByTemplateIndicator | Template indicator date of purchasing contract |
SelectionByName | Name |
SelectionByCurrencyCode | Currency Code |
SelectionByValidityPeriodStartDateTime | Validity Period Start Date Time |
SelectionByValidityPeriodEndDateTime | Validity Period End Date Time |
SelectionByBusinessTransactionDocumentReferencePurchasingContractID | Business Transaction Document Reference Purchasing Contract ID |
SelectionByBusinessTransactionDocumentReferenceRequestForQuoteID | Business Transaction Document Reference Request For Quote ID |
SelectionByBusinessTransactionDocumentReferenceRFQRequestID | Business Transaction Document Reference R F Q Request ID |
SelectionByBusinessTransactionDocumentReferenceSupplierQuoteID | Business Transaction Document Reference Supplier Quote ID |
SelectionByItemDescription | Item Description |
SelectionByPayablesPropertyMovementDirectionCode | Payables Property Movement Direction Code |
SelectionByItemStatusGoodsReturnStatusCode | Item Status Goods Return Status Code |
SelectionByItemStatusOrderDeliveryStatusCode | Item Status Order Delivery Status Code |
SelectionByStatusPurchasingContractLifeCycleStatusCode | Status Purchasing Contract Life Cycle Status Code |
SelectionByStatusApprovalStatusCode | Status Approval Status Code |
SelectionByStatusClosureStatusCode | Status Closure Status Code |
SelectionByStatusConsistencyStatusCode | Status Consistency Status Code |
SelectionByStatusExpiryStatusCode | Status Expiry Status Code |
SelectionByStatusGoodsReturnStatusCode | Status Goods Return Status Code |
SelectionByStatusNegotiationStatusCode | Status Negotiation Status Code |
SelectionByStatusReleaseStatusCode | Status Release Status Code |
SelectionByStatusSourcingAvailabilityStatusCode | Status Sourcing Availability Status Code |
SelectionByStatusOrderDeliveryStatusCode | Status Order Delivery Status Code |
SelectionByStatusInvoicingClearingStatusCode | Status Invoicing Clearing Status Code |
SelectionByStatusDueItemClearingStatusCode | Status Due Item Clearing Status Code |
SelectionBySupplier_CommonBusinessPartnerFormattedName | Supplier_ Common Business Partner Formatted Name |
SelectionByItemProductProductCategoryIDKeyProductCategoryInternalID | Item Product Product Category ID Key Product Category Internal ID |
SelectionByItemProductProductKeyProductTypeCode | Item Product Product Key Product Type Code |
SelectionByItemProductProductKeyProductIdentifierTypeCode | Item Product Product Key Product Identifier Type Code |
SelectionByItemProductProductKeyProductID | Item Product Product Key Product ID |
SelectionByPartyEmployeeResponsiblePartyKeyPartyTypeCode | Party Employee Responsible Party Key Party Type Code |
SelectionByPartyEmployeeResponsiblePartyKeyPartyID | Party Employee Responsible Party Key Party ID |
SelectionByPartyProposedSellerPartyKeyPartyTypeCode | Party Proposed Seller Party Key Party Type Code |
SelectionByPartyProposedSellerPartyKeyPartyID | Party Proposed Seller Party Key Party ID |
SelectionByPartyResponsiblePurchasingUnitPartyKeyPartyTypeCode | Party Responsible Purchasing Unit Party Key Party Type Code |
SelectionByPartyResponsiblePurchasingUnitPartyKeyPartyID | Party Responsible Purchasing Unit Party Key Party ID |
SelectionByPartySellerPartyKeyPartyTypeCode | Party Seller Party Key Party Type Code |
SelectionByPartySellerPartyKeyPartyID | Party Seller Party Key Party ID |
Code Value | Description |
---|---|
1 | In Preparation |
4 | In Approval |
5 | In Revision |
6 | Rejected |
7 | Released |
8 | Closed |
Code Value | Description |
---|---|
1 | Not Started |
2 | Approval not Necessary |
3 | In Approval |
4 | Approved |
5 | Rejected |
6 | In Revision |
7 | Withdrawn |
Code Value | Description |
---|---|
1 | Not Closed |
2 | Closed |
Code Value | Description |
---|---|
1 | Check Pending |
2 | Inconsistent |
3 | Consistent |
Code Value | Description |
---|---|
1 | Not Expired |
2 | About to Expire |
3 | Expired |
Code Value | Description |
---|---|
1 | Not Returned |
2 | Partially Returned |
3 | Returned |
Code Value | Description |
---|---|
1 | Not in Negotiation |
2 | In Negotiation |
3 | Negotiation Canceled |
4 | Negotiation Completed |
Code Value | Description |
---|---|
1 | Not Released |
2 | Partially Released |
3 | Released |
4 | Release Discarded |
5 | Release Canceled |
6 | Not Relevant |
7 | Release Cancellation Requested |
8 | Release Requested |
Code Value | Description |
---|---|
1 | Active for Sourcing |
2 | Inactive for Sourcing |
3 | Active for Manual Sourcing |
4 | Partially Active for Sourcing |
Code Value | Description |
---|---|
1 | Not Delivered |
2 | Partially Delivered |
3 | Delivered |
4 | Not Relevant |
Code Value | Description |
---|---|
1 | Open |
2 | Cleared |
3 | Partially Cleared |
4 | Not Relevant |
5 | To Be Declared |
Code Value | Description |
---|---|
1 | Open |
2 | Cleared |
3 | Partially Cleared |
4 | Not Relevant |
5 | To Be Declared |
Code Value | Description |
---|---|
1 | Material |
2 | Service |
3 | Individual Product |
4 | Warranty |
6 | Entitlement |
Code Value | Description |
---|---|
1 | Internal ID |
2 | Inventory ID |
3 | Serial ID |
The response consists of root level element of Purchasing Contract. Following are the major attributes in result:
Element | Remark |
---|---|
ID | Purchasing Contract ID |
StrategicSourcingProjectReference | Strategic Sourcing Project Reference |
StrategicSourcingProjectReferenceProjectElementTypeName | Strategic Sourcing Project Reference Project Element Type Name |
SystemAdministrativeData | System Administrative Data |
NegotiationTypeCode | Negotiation Type Code |
NegotiationTypeName | Negotiation Type Name |
MigratedDataAdaptationTypeCode | Migrated Data Adaptation Type Code |
MigratedDataAdaptationTypeName | Migrated Data Adaptation Type Name |
ProcessingTypeCode | Processing Type Code |
ProcessingTypeName | Processing Type Name |
TypeCode | Type Code |
TypeName | Type Name |
CurrencyCode | Currency Code |
CurrencyName | Currency Name |
TemplateIndicator | Template Indicator |
Name | Name |
TargetAmount | Target Amount |
TotalReleaseAmount | Total Release Amount |
ValidityPeriod | Validity Period |
FollowUpInvoice | Purchasing Contract Follow Up Invoice |
Status | Purchasing Contract Status |
Here is an example of a simple web service request:
Web service request
<n0:PCTSimpleByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <PCTSimpleSelectionByElements> <SelectionByStatusPurchasingContractLifeCycleStatusCode> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryPurchasingContractLifeCycleStatusCode>1</LowerBoundaryPurchasingContractLifeCycleStatusCode> </SelectionByStatusPurchasingContractLifeCycleStatusCode> </PCTSimpleSelectionByElements> <ProcessingConditions> <QueryHitsMaximumNumberValue>2</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </ProcessingConditions> </n0:PCTSimpleByElementsQuery_sync>
Web service response
<n0:PCTSimpleByElementsResponse_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:ACL:/1SAI/TAS2438B5E2B0806BE317F6:804"> <PurchasingContract> <ID>1904</ID> <UUID>00163e07-3d62-1ed8-8fc4-1b13b3c9ac67</UUID> <SystemAdministrativeData> <CreationDateTime>2018-04-12T07:12:24Z</CreationDateTime> <CreationIdentityUUID>00163e07-3d68-1ed7-abc8-e415f02e7d6b</CreationIdentityUUID> <LastChangeDateTime>2018-04-12T07:12:24Z</LastChangeDateTime> <LastChangeIdentityUUID>00163e07-3d68-1ed7-abc8-e415f02e7d6b</LastChangeIdentityUUID> </SystemAdministrativeData> <ProcessingTypeCode>PCTR</ProcessingTypeCode> <TypeCode>110</TypeCode> <CurrencyCode>USD</CurrencyCode> <Name languageCode="EN">A2X TEST 01</Name> <TargetAmount currencyCode="USD">20.0</TargetAmount> <TotalReleaseAmount currencyCode="USD">0.0</TotalReleaseAmount> <ValidityPeriod> <StartDateTime>2018-04-01T12:00:00Z</StartDateTime> <EndDateTime>2018-04-30T12:00:00Z</EndDateTime> </ValidityPeriod> <Status> <PurchasingContractLifeCycleStatusCode>1</PurchasingContractLifeCycleStatusCode> <ApprovalStatusCode>1</ApprovalStatusCode> <ClosureStatusCode>1</ClosureStatusCode> <ConsistencyStatusCode>2</ConsistencyStatusCode> <ExpiryStatusCode>1</ExpiryStatusCode> <NegotiationStatusCode>1</NegotiationStatusCode> <ReleaseStatusCode>1</ReleaseStatusCode> <SourcingAvailabilityStatusCode>2</SourcingAvailabilityStatusCode> </Status> </PurchasingContract> <PurchasingContract> <ID>1905</ID> <UUID>00163e07-3d62-1ed8-8fc4-228091bcec8e</UUID> <SystemAdministrativeData> <CreationDateTime>2018-04-12T07:14:03Z</CreationDateTime> <CreationIdentityUUID>00163e07-3d68-1ed7-abc8-e415f02e7d6b</CreationIdentityUUID> <LastChangeDateTime>2018-04-12T07:38:22Z</LastChangeDateTime> <LastChangeIdentityUUID>00163e07-3d68-1ed7-abc8-e415f02e7d6b</LastChangeIdentityUUID> </SystemAdministrativeData> <ProcessingTypeCode>PCTR</ProcessingTypeCode> <TypeCode>110</TypeCode> <CurrencyCode>USD</CurrencyCode> <Name languageCode="EN">A2X TEST 01</Name> <TargetAmount currencyCode="USD">10.0</TargetAmount> <TotalReleaseAmount currencyCode="USD">0.0</TotalReleaseAmount> <ValidityPeriod> <StartDateTime>2018-04-01T12:00:00Z</StartDateTime> <EndDateTime>2018-04-30T12:00:00Z</EndDateTime> </ValidityPeriod> <Status> <PurchasingContractLifeCycleStatusCode>1</PurchasingContractLifeCycleStatusCode> <ApprovalStatusCode>1</ApprovalStatusCode> <ClosureStatusCode>1</ClosureStatusCode> <ConsistencyStatusCode>3</ConsistencyStatusCode> <ExpiryStatusCode>1</ExpiryStatusCode> <NegotiationStatusCode>1</NegotiationStatusCode> <ReleaseStatusCode>1</ReleaseStatusCode> <SourcingAvailabilityStatusCode>2</SourcingAvailabilityStatusCode> </Status> </PurchasingContract> <ResponseProcessingConditions> <ReturnedQueryHitsNumberValue>2</ReturnedQueryHitsNumberValue> <MoreHitsAvailableIndicator>true</MoreHitsAvailableIndicator> <LastReturnedObjectID>00163E073D621ED88FC4228091BCEC8E</LastReturnedObjectID> </ResponseProcessingConditions> <Log/> </n0:PCTSimpleByElementsResponse_sync>
Release | Change Description | Details |
1805 | Documentation change | Service Interfaces and Operation, Structure of request message and response message, Example of payload updates |