| Description | Query Materials |
| Name | QueryMaterialIn |
| Namespace | http://sap.com/xi/A1S/Global |
| Process Component Description | Product Data Maintenance |
| Process Component Name | ProductDataMaintenance |
| Process Component Namespace | http://sap.com/xi/AP/FO/Product/Global |
| Deploymnent Unit Description | Foundation |
| Endpoint Activation | By Scoping of Process Component | Operations |
| Release Status | Deprecated |
An interface to query material master data.
The web service interface Query Material In enables you to connect external applications to your solution and to query and read materials in your system. The web service interface Query Material In is relevant if your company wants to access and manage product data from external applications.
The web service interface Query Material In offers the operation Find By Elements.
Here is an example of a simple web service request, which seeks for the first 100 materials with an InternalID matching "MAT*":
<n0:MaterialByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
<MaterialSelectionByElements>
<SelectionByInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>MAT*</LowerBoundaryInternalID>
<UpperBoundaryInternalID/>
</SelectionByInternalID>
</MaterialSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>100</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
</n0:MaterialByElementsQuery_sync>
Here is an excerpt of the response of the request above including one of 10 customer records returned by the query:
<nm:CustomerByCommunicationDataResponse_sync xmlns:nm="http://sap.com/xi/SAPGlobal20/Global">
<Customer>
<ChangeStateID>20120403130323.5873030</ChangeStateID>
<UUID>00163e01-2ba1-1ee0-a8d9-91398c1a5514</UUID>
<InternalID>1000580</InternalID>
<SystemAdministrativeData>
<CreationDateTime>2011-06-30T03:59:13.191284Z</CreationDateTime>
...
</SystemAdministrativeData>
<CategoryCode>2</CategoryCode>
<CustomerIndicator>true</CustomerIndicator>
<LifeCycleStatusCode>2</LifeCycleStatusCode>
<Organisation>
<FirstLineName>Akron Heating France Inc.-1</FirstLineName>
</Organisation>
<LegalCompetenceIndicator>true</LegalCompetenceIndicator>
<AddressInformation>
<UUID>00163e01-2ba1-1ee0-a8d9-a9e15a2ff548</UUID>
<CurrentAddressSnapshotUUID>00163e01-2ba1-1ee0-a8d9-aa1d2d4e7548</CurrentAddressSnapshotUUID>
<AddressUsage>
<AddressUsageCode>XXDEFAULT</AddressUsageCode>
</AddressUsage>
<Address>
<EmailURI>info1@akron.com</EmailURI>
<PostalAddress>
<CountryCode>FR</CountryCode>
...
</PostalAddress>
<Telephone>
<FormattedNumberDescription>+33 2 41830103</FormattedNumberDescription>
</Telephone>
<FormattedAddress>
...
</FormattedAddress>
</Address>
</AddressInformation>
...
</Customer>
<ProcessingConditions>
<ReturnedQueryHitsNumberValue>10</ReturnedQueryHitsNumberValue>
<MoreHitsAvailableIndicator>false</MoreHitsAvailableIndicator>
<LastReturnedObjectID>00300571CC0F02DBB8C79C6E3F1E8020</LastReturnedObjectID>
</ProcessingConditions>
</nm:CustomerByCommunicationDataResponse_sync>
There are no prerequisites.
You can find general information about Web services, their structure and consumption in the Web Services documentation.
The following example scenarios can be carried out using the material query service.
The following example request returns all materials with IDs beginning with MAT, including general data, description, quantity conversion, and sales data.
<n0:MaterialByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
<MaterialSelectionByElements>
<SelectionByInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>MAT*</LowerBoundaryInternalID>
</SelectionByInternalID>
</MaterialSelectionByElements>
<ProcessingConditions>
<QueryHitsUnlimitedIndicator>true</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
<RequestedElements materialTransmissionRequestCode="2">
<Material descriptionTransmissionRequestCode="2" quantityConversionTransmissionRequestCode="2" salesTransmissionRequestCode="1"/>
</RequestedElements>
</n0:MaterialByElementsQuery_sync>
The following example request returns all materials, including general data, description, and quantity conversion.
<n0:MaterialByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
<MaterialSelectionByElements>
<SelectionByInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>*</LowerBoundaryInternalID>
</SelectionByInternalID>
</MaterialSelectionByElements>
<ProcessingConditions>
<QueryHitsUnlimitedIndicator>true</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
<RequestedElements materialTransmissionRequestCode="2">
<Material descriptionTransmissionRequestCode="2" quantityConversionTransmissionRequestCode="2"/>
</RequestedElements>
</n0:MaterialByElementsQuery_sync>
| Description | Find materials |
| Name | FindByElements |
| Synchronous | yes |
| Release Status | Deprecated |
To query material data by elements.
The request message of the operation FindByElements contains the MaterialSelectionByElements node that groups all possible selection parameters.
This node groups all selection parameters. The selection parameters are:
| Selection Parameter | Remark |
|---|---|
| SelectionByDescription | Selection by description LanguageCode attribute can be omitted to search in all languages or have to be specified explicitly, for example, EN for English. |
| SelectionByInternalID | Selection by internal ID |
| SelectionByIdentifiedStockTypeCode | Selection by identified stock type code:01 Batch 02 Lot 03 Optional Specified Stock 04 Mandatory Specified Stock |
| SelectionBySearchText | Selection by search text (Basic Search) |
| SelectionByCreatedSinceDateTime | Selection by “created since” date and time Select all materials which were created since the specific date and time. |
| SelectionByLastChangeSinceDateTime | Selection by last changed since date and time Select all materials which were last changed since the specific date and time. |
The response contains the list of found materials, log items, and processing conditions.
In this node, all found materials are contained including their material data according to the RequestedElements provided in the query request. This includes the ChangeStateID that may be needed for subsequent change requests using web services as well.
Show full documentation