Description | Return To Supplier Query |
Name | ManageReturnToSupplierInQuery |
Namespace | http://sap.com/xi/A1S/Global |
Process Component Description | Return to supplier processing |
Process Component Name | ReturnToSupplier |
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 return to supplier from a source system.
The web service Interface ‘Query Return To Supplier In’ enables you to connect external applications to your SAP Business By Design system and to query Return To Supplier in your system. The web service interface ‘Query Return To Supplier In’ is relevant if your company wants to access return to supplier data from external applications.
The buyer is able to display or update an existing return to supplier in the Returns to Suppliers view in the Purchase Requests and Orders work center.
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 |
TransmissionRequestCode specifies which elements shall be returned. The valid code values for the TransmissionRequestCode are:
Code | Description | "Short form" |
---|---|---|
1 | The node element, all its elements and its child node elements and all their elements shall be returned. | All |
2 | The node element and all its elements shall be returned. | Current node |
3 | The node element and its key elements shall be returned. | Current node keys only |
4 | The node element and its child node elements shall not be returned. | Ignore |
Each TransmissionRequestCode is assigned to a specific message node.
The transmission request code is optional. If no transmission request code is modeled or provided by the service consumer, then the following rules apply:
1.If no transmission request code is provided at all, then the response message contains all data.
2.If the transmission request code of the parent node element is '1', then its sub-node elements for which no transmission request code is specified are defaulted by '1'.
3.If the transmission request code of the parent node element is '2' or '3', then its sub-node elements for which no transmission request code is specified are defaulted by '4'.
4.If the transmission request code of the parent node element is '4', then its sub-node elements are not returned anyway.
Before a query is executed on Return To Supplier , both instance of Purchase Orders and Inbound Delivery have 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. So 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 Return To Supplier based on certain set of information like ID, SearchText etc.
This finds the Return To Supplier ID is XXX
<n0:ReturnToSupplierRequestQuery xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <ReturnToSupplierSelectByElements> <SelectionByReturnToSupplierID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryIdentifier>XXX</LowerBoundaryIdentifier> </SelectionByReturnToSupplierID> </ReturnToSupplierSelectByElements> <ProcessingConditions> <QueryHitsMaximumNumberValue>10</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </ProcessingConditions> <RequestedElements RTSTransmissionRequestCode="2"> <ReturnToSupplier itemTransmissionRequestCode="4"/> </RequestedElements> </n0:ReturnToSupplierRequestQuery>
Description | Find returns to supplier |
Name | FindSimpleByElements |
Synchronous | yes |
Release Status | Released |
QueryReturnToSupplier In interface allows to query on existing return to supplier in the system.
The request message of the QueryByElements contains two parts: Body and Processing Conditions. Body comprises of the various parameters on which Return To Supplier can be queried. Details on these parameters are discussed in the following sub-sections. Processing conditions controls 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 contain the header level relevant attributes of Return To Supplier along with the Processing conditions. The processing condition here indicates that how many records are returned and are there any more records existing 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 ‘Query Return To Supplier In’ offers the operation QUERY_BY_ELEMENTS.
Structure of the request message has the following parameters based on which return to supplier can be searched:
Element | Remark |
---|---|
SearchText | You can specify anything in this text and if this text exists for any Return To Supplier it will show up in result |
ID | ID of the Return To Supplier |
StatusReturnToSupplierLifeCycleStatusCode | Life Cycle Status Code of Return To Supplier |
StatusApprovalStatusCode | Approval Status Code of Return To Supplier |
StatusBlockingStatusCode | Blocking Status Code of Return To Supplier |
StatusCancellationStatusCode | Cancellation Status Code of Return To Supplier |
StatusRejectionStatusCode | Rejection Status Code of Return To Supplier |
StatusReleasePostingStatusCode | Release Status Code of Return To Supplier |
StatusDeliveryProcessingStatusStatusCode | Delivery Processing Status Code of Return To Supplier |
The response consists of root level element of Return To Supplier. Following are the major attributes in result
Element | Remark |
---|---|
ID | Return to supplier ID |
CreationDateTime | The date when created the return to supplier |
LastChangeDateTime | The date when last changed the return to supplier |
ReturnToSupplierLifeCycleStatusCode | The life cycle status code of return To supplier |
SiteID | The Site ID |
SupplierID | The supplier ID of return To supplier |
BuyerResponsible | The buyer ID of return To supplier |
ReceipientParty | The Recipient ID of return To supplier |
FreightForwarder | The freight forwarder of return To supplier |
Incoterms | |
DeliveryPriorityCode | Delivery Priority Code |
TextCollection | Maintain notes on RTS header |
AttachmentFolder | Maintain Attachment on RTS header |
Item
Element | Remark |
---|---|
ItemID | Return to supplier item ID |
CancellationInitiatorCode | Cancellation Initiator of return to supplier item |
AcceptanceStatusCode | Acceptance Status of return to supplier item |
ReplacementDate | Replacement Date of return to supplier item |
Quantity | Item Quantity of return to supplier |
QuantityTypeCode | Quantity Type Code |
ProductID | Product ID in the return to supplier item |
ProductDescription | Product description at the return to supplier item |
SupplierPartNumber | Supplier ID at the return to supplier item |
InboundDeliveryID | Inbound Delivery ID created during return to supplier |
IdentifiedStockKey | Identified Stock Key |
CustomerReturnReasonCode | Customer return reason input at the return to supplier item |
SRMFollowUpDecisionTypeCode | Follow up decision Type at the return to supplier item |
ReplacementQuantity | Replacement Quantity |
CreditMemoQuantity | Credit Memo Quantity |
DeliveryNotificationID | Delivery Notification ID |
PurchaseOrderID | Which purchase order does the return to supplier comes from |
ShipFromLocation | Ship From Location |
ShipmentDateTime | Shipment Date Time |
ProductRequirementSpecificationKey | Product Requirement SpecificationKey |
ItemTextCollection | Maintain notes on RTS item |
ItemAttachmentFolder | Maintain Attachment on RTS item |
Element | Remark |
---|---|
1 | In Preparation |
2 | Released |
3 | In Process |
4 | Finished |
5 | Canceled |
6 | Rejected |
Element | Remark |
---|---|
1 | Immediate |
2 | Urgent |
3 | Normal |
7 | Low |
Element | Remark |
---|---|
1 | Requester |
2 | Purchaser |
3 | Planner |
4 | Seller |
Element | Remark |
---|---|
AJ | Pending |
AP | Accepted |
RE | Rejected |
Element | Remark |
---|---|
4 | Poor quality |
5 | Transport damages |
6 | Spoilt products |
7 | Defective packaging |
8 | Late delivery |
9 | Double delivery |
10 | Defective parts |
11 | Missing parts |
12 | Too expensive |
13 | Incompatible |
14 | Changed mind |
15 | Delivered incorrectly |
16 | Ordered incorrectly |
17 | Delivered for selection |
18 | Other reason |
19 | No reason |
Element | Remark |
---|---|
1 | Replacement |
2 | Credit Memo |
3 | Partial Credit Memo & Replacement |
Example 1: Retrieves return to suppliers by ID range:
Web service request
<n0:ReturnToSupplierRequestQuery xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <ReturnToSupplierSelectByElements> <SelectionByReturnToSupplierID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode> <LowerBoundaryIdentifier>10</LowerBoundaryIdentifier> <UpperBoundaryIdentifier>100</UpperBoundaryIdentifier> </SelectionByReturnToSupplierID> </ReturnToSupplierSelectByElements> <ProcessingConditions> <QueryHitsMaximumNumberValue>2</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </ProcessingConditions> </n0:ReturnToSupplierRequestQuery>
Web service response
<n0:ReturnToSupplierResponseQuery xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:ACL:/1SAI/TAS4B2A70836BED005E7B73:804"> <ReturnToSupplierQryRsp> <ID>51</ID> <UUID>00163e07-3d62-1ed7-b7fe-0ac05d6bb973</UUID> <SystemAdministrativeData> <CreationDateTime>2017-12-13T10:28:28Z</CreationDateTime> <LastChangeDateTime>2018-02-19T10:55:02Z</LastChangeDateTime> </SystemAdministrativeData> <ReturnToSupplierLifeCycleStatusCode>3</ReturnToSupplierLifeCycleStatusCode> <SiteID>MC64000</SiteID> <SupplierID>MC2000</SupplierID> <BuyerResponsible>MC10000</BuyerResponsible> <ReceipientParty>MC2000</ReceipientParty> <Incoterms> <ClassificationCode>EXW</ClassificationCode> <TransferLocationName>AMS, AKRON</TransferLocationName> </Incoterms> <Item> <ItemID>1</ItemID> <ItemUUID>00163e07-3d62-1ed7-b7fe-0ac05d6f3973</ItemUUID> <Quantity unitCode="EA">1.0</Quantity> <QuantityTypeCode>EA</QuantityTypeCode> <ProductID>MCF-0001</ProductID> <ProductDescription languageCode="EN">AHT COMBI 75 - change</ProductDescription> <InboundDeliveryID>40</InboundDeliveryID> <IdentifiedStockKey> <ID> </ID> <MaterialKey> <ProductTypeCode>1</ProductTypeCode> <ProductIdentifierTypeCode>1</ProductIdentifierTypeCode> <ProductID>MCF-0001</ProductID> </MaterialKey> </IdentifiedStockKey> <ReplacementQuantity unitCode="EA">0.0</ReplacementQuantity> <CreditMemoQuantity unitCode="EA">0.0</CreditMemoQuantity> <DeliveryNotificationID>D-210-1</DeliveryNotificationID> <PurchaseOrderID>210</PurchaseOrderID> <ShipFromLocation>MC64000</ShipFromLocation> </Item> </ReturnToSupplierQryRsp> <ReturnToSupplierQryRsp> <ID>52</ID> <UUID>00163e07-3d62-1ed7-bda6-2c80bf2ae9a6</UUID> <SystemAdministrativeData> <CreationDateTime>2018-01-09T11:37:18Z</CreationDateTime> <LastChangeDateTime>2018-01-09T11:37:18Z</LastChangeDateTime> </SystemAdministrativeData> <ReturnToSupplierLifeCycleStatusCode>3</ReturnToSupplierLifeCycleStatusCode> <SiteID>MC64000</SiteID> <SupplierID>MC8000</SupplierID> <BuyerResponsible>MC10000</BuyerResponsible> <ReceipientParty>MC8000</ReceipientParty> <Item> <ItemID>1</ItemID> <ItemUUID>00163e07-3d62-1ed7-bda6-2c80bf2e69a6</ItemUUID> <Quantity unitCode="LBR">10000.0</Quantity> <QuantityTypeCode>MASS</QuantityTypeCode> <ProductID>MCR-0004</ProductID> <ProductDescription languageCode="EN">T-IRON</ProductDescription> <InboundDeliveryID>578</InboundDeliveryID> <IdentifiedStockKey> <ID> </ID> <MaterialKey> <ProductTypeCode>1</ProductTypeCode> <ProductIdentifierTypeCode>1</ProductIdentifierTypeCode> <ProductID>MCR-0004</ProductID> </MaterialKey> </IdentifiedStockKey> <ReplacementQuantity unitCode="LBR">0.0</ReplacementQuantity> <CreditMemoQuantity unitCode="LBR">0.0</CreditMemoQuantity> <DeliveryNotificationID>DN_567</DeliveryNotificationID> <PurchaseOrderID>567</PurchaseOrderID> <ShipFromLocation>MC64000</ShipFromLocation> </Item> </ReturnToSupplierQryRsp> <ProcessingConditions> <ReturnedQueryHitsNumberValue>2</ReturnedQueryHitsNumberValue> <MoreHitsAvailableIndicator>true</MoreHitsAvailableIndicator> <LastReturnedObjectID>00163E073D621ED7BDA62C80BF2AE9A6</LastReturnedObjectID> </ProcessingConditions> <Log/> </n0:ReturnToSupplierResponseQuery>
Release | Change Description | Details |
1805 | Documentation change | Service Interfaces and Operation , Structure of request message and response message, Example of payload updates |