| Description | Query Target Groups |
| Name | QueryTargetGroupIn |
| Namespace | http://sap.com/xi/A1S/Global |
| Process Component Description | Campaign Management |
| Process Component Name | CampaignManagement |
| 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 target group data.
The web service interface Query Target Group enables you to connect external applications to your SAP system and to query and read target group data in your system. The service interface is relevant if your company wants to access and manage target group data from external applications.
It has the FindByElements operation which is used to query for one or more target group instances based on the query filter parameters passed.
This example structure shows the possible elements and attributes:
<n0:TargetGroupByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <TargetGroupSelectionByElements> <SelectionByUUID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryUUID>12345678-90AB-CDEF-0123-456789ABCDEF</LowerBoundaryUUID> </SelectionByUUID> <SelectionByIdentifier> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode> <LowerBoundaryIdentifier>121</LowerBoundaryIdentifier> <UpperBoundaryIdentifier>221</UpperBoundaryIdentifier> </SelectionByIdentifier> <SelectionByDescription> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode> <LowerBoundaryName>description_121</LowerBoundaryName> <UpperBoundaryName>description_221</UpperBoundaryName> </SelectionByDescription> <SelectionByMemberNumberValue> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode> <LowerBoundaryValue>10</LowerBoundaryValue> <UpperBoundaryValue>100</UpperBoundaryValue> </SelectionByMemberNumberValue> <SelectionByLifeCycleStatusCode> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryCode>1</LowerBoundaryCode> </SelectionByLifeCycleStatusCode> <SelectionByLifeCycleStatusCode> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryCode>2</LowerBoundaryCode> </SelectionByLifeCycleStatusCode> <SelectionByLifeCycleStatusCode> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryCode>3</LowerBoundaryCode> </SelectionByLifeCycleStatusCode> <SelectionBySystemAdministrativeDataCreationDateTime> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode> </SelectionBySystemAdministrativeDataCreationDateTime> <SelectionBySystemAdministrativeDataCreationIdentityUUID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryUUID>12345678-90AB-CDEF-0123-456789ABCDEF</LowerBoundaryUUID> </SelectionBySystemAdministrativeDataCreationIdentityUUID> <SelectionBySystemAdministrativeDataLastChangeDateTime> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode> </SelectionBySystemAdministrativeDataLastChangeDateTime> <SelectionBySystemAdministrativeDataLastChangeIdentityUUID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryUUID>12345678-90AB-CDEF-0123-456789ABCDEF</LowerBoundaryUUID> </SelectionBySystemAdministrativeDataLastChangeIdentityUUID> <SelectionBySearchText>searchtext</SelectionBySearchText> </TargetGroupSelectionByElements> <ProcessingConditions> <QueryHitsMaximumNumberValue>1000</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> <LastReturnedObjectID>112</LastReturnedObjectID> </ProcessingConditions> <RequestedElements targetGroupTransmissionRequestCode="2"> <TargetGroup noteTransmissionRequestCode="2" memberTransmissionRequestCode="2"></TargetGroup> </RequestedElements> </n0:TargetGroupByElementsQuery_sync>
Target groups should exist in the system in order to get a positive result.
Example:
<ProcessingConditions> <QueryHitsMaximumNumberValue>500</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </ProcessingConditions>
Example for requesting all data (code snippet):
<RequestedElements targetGroupTransmissionRequestCode="1"/>
or (default is '1')
<RequestedElements />
or do not specify with element.
Example for requesting the root and the member data (code snippet):
<RequestedElements targetGroupTransmissionRequestCode="2"> <TargetGroup memberTransmissionRequestCode="2"/> </RequestedElements>
Example for requesting all except the note data (code snippet):
<RequestedElements targetGroupTransmissionRequestCode="1"> <TargetGroup noteTransmissionRequestCode="4"/> </RequestedElements>
You can find general information about Web services, their structure and consumption in the Web Services documentation.
In this example the consumer wants to delete a specific member from a target group. First the target group needs to be queried using the service QueryTargetGroupIn to obtain the UUIDs of the members to be deleted. Then the service MaintainBundle is used to delete a member.
Step1: Query target group by ID
Request:
<n0:TargetGroupByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <TargetGroupSelectionByElements> <SelectionByIdentifier> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryIdentifier>431</LowerBoundaryIdentifier> </SelectionByIdentifier> </TargetGroupSelectionByElements> <ProcessingConditions> <QueryHitsUnlimitedIndicator>true</QueryHitsUnlimitedIndicator> <LastReturnedObjectID></LastReturnedObjectID> </ProcessingConditions> <RequestedElements targetGroupTransmissionRequestCode="1"> </RequestedElements> </n0:TargetGroupByElementsQuery_sync>
Response:
<nm:TargetGroupByElementsResponse_sync xmlns:nm="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:ALP:/1SAI/TASD25A1740297408DDF880:804"> <TargetGroup> <ID>431</ID> <UUID>00163e02-8b12-1ee1-afec-8190d71d3edf</UUID> <Description languageCode="EN">Target Group created by A2X</Description> <LifeCycleStatusCode>2</LifeCycleStatusCode> <MemberNumberValue>2</MemberNumberValue> <SystemAdministrativeData> <CreationDateTime>2012-06-26T07:53:42.899938Z</CreationDateTime> <CreationIdentityUUID>00163e02-33d8-1ee1-8392-db684742ba39</CreationIdentityUUID> <LastChangeDateTime>2012-06-27T08:20:01.892648Z</LastChangeDateTime> <LastChangeIdentityUUID>00163e02-33d8-1ee1-8392-db684742ba39</LastChangeIdentityUUID> </SystemAdministrativeData> <Member> <UUID>00163e02-8b2e-1ee1-b086-1c7b541f91d3</UUID> <CustomerUUID>00300571-ce9b-1ded-89de-4402ab375ec4</CustomerUUID> <CustomerInternalID>MC9785</CustomerInternalID> <CustomerFormattedName>Silverstar Wholesale Corp</CustomerFormattedName> <ContactPersonUUID>00300571-ce9b-1ddd-89de-27b3631d4927</ContactPersonUUID> <ContactPersonInternalID>MCP9785</ContactPersonInternalID> <ContactPersonFormattedName>Frank Sent</ContactPersonFormattedName> </Member> <Member> <UUID>00163e02-8b2e-1ee1-b086-1c7b541fb1d3</UUID> <CustomerUUID>00300571-ce9b-1ded-89de-4b7ca3968564</CustomerUUID> <CustomerInternalID>MC9786</CustomerInternalID> <CustomerFormattedName>Silverstar Logistics</CustomerFormattedName> <ContactPersonUUID>00300571-ce9b-1ddd-89de-2dbb185f5bdf</ContactPersonUUID> <ContactPersonInternalID>MCP9786</ContactPersonInternalID> <ContactPersonFormattedName>Frederic Winston</ContactPersonFormattedName> </Member> </TargetGroup> <ProcessingConditions> <ReturnedQueryHitsNumberValue>1</ReturnedQueryHitsNumberValue> <MoreHitsAvailableIndicator>false</MoreHitsAvailableIndicator> <LastReturnedObjectID>00163E028B121EE1AFEC8190D71D3EDF</LastReturnedObjectID> </ProcessingConditions> </nm:TargetGroupByElementsResponse_sync>
Step2: Delete a member from the target group
Request:
<n0:TargetGroupBundleMaintainRequest_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <BasicMessageHeader> <ID>00300571D06B1DED9EE4723F124207BC</ID> </BasicMessageHeader> <TargetGroup actionCode="06"> <ID>431</ID> <Member actionCode="03"> <UUID>00163e02-8b2e-1ee1-b086-1c7b541f91d3</UUID> </Member> </TargetGroup> </n0:TargetGroupBundleMaintainRequest_sync>
Response:
<nm:TargetGroupBundleMaintainConfirmation_sync xmlns:nm="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:ALP:/1SAI/TAS220EB8A27B8B07382875:804"> <TargetGroup> <ReferenceObjectNodeSenderTechnicalID /> <ChangeStateID>20120627093408.8662430</ChangeStateID> <UUID>00163e02-8b12-1ee1-afec-8190d71d3edf</UUID> <ID>431</ID> </TargetGroup> <Log /> </nm:TargetGroupBundleMaintainConfirmation_sync>
| Description | Find target groups |
| Name | FindByElements |
| Synchronous | yes |
| Release Status | Deprecated |
To query target group data by elements.
FindByElements is an operation to query target group data by the selections elements passed in the request.
The following selection elements are supported:
| SelectionByElements | Comment |
|---|---|
| SelectionByUUID | UUID |
| SelectionByIdentifier | ID |
| SelectionByDescription | Description |
| SelectionByMemberNumberValue | Number of members |
| SelectionByLifeCycleStatusCode | Status |
| SelectionBySystemAdministrativeDataCreationDateTime | The time-point when the target group is created on. It is an accurate-to-the-second time-point of a calendar day in time zone UTC. |
| SelectionBySystemAdministrativeDataCreationIdentityUUID | CreationIdentityUUID |
| SelectionBySystemAdministrativeDataLastChangeDateTime | The time-point when the target group is changed last. It is an accurate-to-the-second time-point of a calendar day in time zone UTC. |
| SelectionBySystemAdministrativeDataLastChangeIdentityUUID | LastChangeIdentityUUID |
| SelectionBySearchText | Search Text |
| <Root Extension Fields> | If configured by the key user, root extension fields can be requested too. |
The supported Interval Boundary Type Code values depend on the type of the selection element:
| Selection Parameter Type | Supported Interval Boundary Type Code values |
|---|---|
| UUID | Only value '1' (= Equal to) without wildcards is allowed. |
| ID | All values are allowed. |
| Date | 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'. |
| Code | Only value '1' (= Equal to) without wildcards is allowed. |
| Value | All values are allowed; but value '1' (= Equal to) is allowed only without wildcards. |
Code vales for LifeCycleStatusCode:
| Code value | Description |
|---|---|
| 1 | active |
| 2 | blocked |
| 3 | obsolete |
Example (1): Query target groups by ID
Request:
<n0:TargetGroupByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <TargetGroupSelectionByElements> <SelectionByIdentifier> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryIdentifier>431</LowerBoundaryIdentifier> </SelectionByIdentifier> </TargetGroupSelectionByElements> <ProcessingConditions> <QueryHitsUnlimitedIndicator>true</QueryHitsUnlimitedIndicator> <LastReturnedObjectID></LastReturnedObjectID> </ProcessingConditions> <RequestedElements targetGroupTransmissionRequestCode="1"> </RequestedElements> </n0:TargetGroupByElementsQuery_sync>
Example (2): Query target groups having more than 1000 members
Request:
<n0:TargetGroupByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <TargetGroupSelectionByElements> <SelectionByMemberNumberValue> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>8</IntervalBoundaryTypeCode> <LowerBoundaryValue>1000</LowerBoundaryValue> </SelectionByMemberNumberValue> </TargetGroupSelectionByElements> <ProcessingConditions> <QueryHitsUnlimitedIndicator>true</QueryHitsUnlimitedIndicator> <LastReturnedObjectID></LastReturnedObjectID> </ProcessingConditions> <RequestedElements targetGroupTransmissionRequestCode="2"> </RequestedElements> </n0:TargetGroupByElementsQuery_sync>
The response contains the list of found target groups together with their notes and members. The service consumer can specify which node elements are delivered (see section "Requested Elements"). If configured by the key user, root and member extension fields can be returned too.
Example: Query target groups by ID
Response:
<nm:TargetGroupByElementsResponse_sync xmlns:nm="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:ALP:/1SAI/TASD25A1740297408DDF880:804"> <TargetGroup> <ID>431</ID> <UUID>00163e02-8b12-1ee1-afec-8190d71d3edf</UUID> <Description languageCode="EN">Target Group created by A2X</Description> <LifeCycleStatusCode>2</LifeCycleStatusCode> <MemberNumberValue>1</MemberNumberValue> <SystemAdministrativeData> <CreationDateTime>2012-06-26T07:53:42.899938Z</CreationDateTime> <CreationIdentityUUID>00163e02-33d8-1ee1-8392-db684742ba39</CreationIdentityUUID> <LastChangeDateTime>2012-06-27T14:35:40.112111Z</LastChangeDateTime> <LastChangeIdentityUUID>00163e02-33d8-1ee1-8392-db684742ba39</LastChangeIdentityUUID> </SystemAdministrativeData> <Note> <ContentText>This is a Note for a Target Group</ContentText> </Note> <Member> <UUID>00163e02-8b2e-1ee1-b086-1c7b541fb1d3</UUID> <CustomerUUID>00300571-ce9b-1ded-89de-4b7ca3968564</CustomerUUID> <CustomerInternalID>MC9786</CustomerInternalID> <CustomerFormattedName>Silverstar Logistics</CustomerFormattedName> <ContactPersonUUID>00300571-ce9b-1ddd-89de-2dbb185f5bdf</ContactPersonUUID> <ContactPersonInternalID>MCP9786</ContactPersonInternalID> <ContactPersonFormattedName>Frederic Winston</ContactPersonFormattedName> </Member> </TargetGroup> <ProcessingConditions> <ReturnedQueryHitsNumberValue>1</ReturnedQueryHitsNumberValue> <MoreHitsAvailableIndicator>false</MoreHitsAvailableIndicator> <LastReturnedObjectID>00163E028B121EE1AFEC8190D71D3EDF</LastReturnedObjectID> </ProcessingConditions> </nm:TargetGroupByElementsResponse_sync>
Show full documentation