| Description | Query Sales Leads |
| Name | QueryLeadIn |
| Namespace | http://sap.com/xi/A1S/Global |
| Process Component Description | Lead Processing |
| Process Component Name | LeadProcessing |
| Process Component Namespace | http://sap.com/xi/AP/CRM/Global |
| Deploymnent Unit Description | Customer Relationship Management |
| Endpoint Activation | By Scoping of Process Component | Operations |
| Release Status | Deprecated |
An interface to query sales leads.
The web service interface Query Sales Lead enables you to connect external applications to your SAP system and to query and read sales leads in your system. The web service interface is relevant if your company wants to access and manage sales lead data from external applications.
The web service interface Query Sales Lead offers the operation FindByElements.
Here is an example of a simple web service request to get sales leads with a certain subject name:
<n0:LeadByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
<LeadSelectionByElements>
<SelectionByDescription>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryName>A2X*</LowerBoundaryName>
<UpperBoundaryName></UpperBoundaryName>
</SelectionByDescription>
</LeadSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>25</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
</n0:LeadByElementsQuery_sync>
Example:
<ProcessingConditions> <QueryHitsMaximumNumberValue>500</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </ProcessingConditions>
Example for requesting all data (code snippet):
<RequestedElements leadTransmissionRequestCode="1"/>
or (default is '1')
<RequestedElements />
or do not specify with element.
Example for requesting the root and the marketing responsible data (code snippet):
<RequestedElements leadTransmissionRequestCode="2"> <Lead marketingResponsibleEmployeePartyTransmissionRequestCode="2"/> </RequestedElements>
Example for requesting all except the attachment folder (code snippet):
<RequestedElements leadTransmissionRequestCode="1"> <Lead attachmentFolderTransmissionRequestCode="4"/> </RequestedElements>
You can find general information about Web services, their structure and consumption in the Web Services documentation.
Possible scenarios include the following:
Find Lead
With a certain description
With a certain prospect
Etc.
Example to find sales leads with a certain prospect party:
<n0:LeadByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
<LeadSelectionByElements>
<SelectionByProspectPartyBusinessPartnerInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>MC9785</LowerBoundaryInternalID>
<UpperBoundaryInternalID></UpperBoundaryInternalID>
</SelectionByProspectPartyBusinessPartnerInternalID>
</LeadSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>25</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
</n0:LeadByElementsQuery_sync>
| Description | Find leads |
| Name | FindByElements |
| Synchronous | yes |
| Release Status | Deprecated |
To find leads.
The request message of the operation FindByElements contains the QueryByElements that groups all possible selection parameters.
| Selection Parameter | Remark |
|---|---|
| SelectionByID | Selection by identifier |
| SelectionByDescription | Selection by description |
| SelectionByProspectPartyBusinessPartnerInternalID | Selection by internal business partner ID of the prospect party |
| SelectionByProspectContactPartyBusinessPartnerInternalID | Selection by internal business partner ID of the contact of the prospect party |
| SelectionByMarketingResponsibleEmployeePartyBusinessPartnerInternalID | Selection by internal business partner ID of the marketing responsible employee party |
| SelectionBySalesResponsibleEmployeePartyBusinessPartnerInternalID | Selection by internal business partner ID of the sales responsible employee party |
| SelectionByGroupCode | Selection by group code |
| SelectionByOriginTypeCode | Selection by origin type code |
| SelectionByResultReasonCode | Selection by result reason code |
| SelectionByQualificationLevelCode | Selection by qualification level code |
| SelectionByLifeCycleStatusCode | Selection by life cycle status code |
| SelectionByCreatedDateTime | Selection by creation date and time. It is an accurate-to-the-second time-point of a calendar day in time zone UTC. |
| SelectionByLastChangeDateTime | Selection by last change date and time. It is an accurate-to-the-second time-point of a calendar day in time zone UTC. |
| SelectionByCreatedByBusinessPartnerGivenName | Selection by given name of business parter who created the lead |
| SelectionByCreatedByBusinessPartnerFamilyName | Selection by family name of business parter who created lead |
| SelectionByChangedByBusinessPartnerGivenName | Selection by given name of business parter who last changed lead |
| SelectionByChangedByBusinessPartnerFamilyName | Selection by family name of business parter who last changed lead |
| SelectionBySearchText | Selection by a search text |
The supported Interval Boundary Type Code values depend on the type of the selection element:
| Selection Parameter Type | Supported Interval Boundary Type Code values |
|---|---|
| ID | All values are allowed. |
| Date Time | All values are allowed. |
| Description | All values are allowed; if you enter value '1' (= Equal to) it means that you are searching for an entry that is exactly equal to the search term; if you enter a search term with '*' (wildcard) in the value it means that you are searching for entries that contain the search term; for example, if you enter 'ABC*' then the system searches for all entries that are beginning with 'ABC'. |
| Name | All values are allowed; if you enter value '1' (= Equal to) it means that you are searching for an entry that is exactly equal to the search term; if you enter a search term with '*' (wildcard) in the value it means that you are searching for entries that contain the search term; for example, if you enter 'ABC*' then the system searches for all entries that are beginning with 'ABC'. |
| Code | Only value '1' (= Equal to) without wildcards is allowed. |
This is an example for a simple wildcard query and to return 25 sales leads:
<n0:LeadByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
<LeadSelectionByElements>
<SelectionByDescription>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryName>A2X*</LowerBoundaryName>
<UpperBoundaryName></UpperBoundaryName>
</SelectionByDescription>
</LeadSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>25</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
</n0:LeadByElementsQuery_sync>
The response contains the list of found sales leads, log items, and processing conditions.
For parties like the ProspectParty, ProspectContactParty, MarketingResponsibleEmployeeParty and SalesResponsibleEmployeeParty the business partner internal ID as well as the business partner UUID is returned.
Show full documentation