Description | Query E-mail Activities |
Name | QueryEmailActivityIn |
Namespace | http://sap.com/xi/A1S/Global |
Process Component Description | Activity Management |
Process Component Name | ActivityManagement |
Process Component Namespace | http://sap.com/xi/AP/FO/Activity/Global |
Deployment Unit Description | Foundation |
Endpoint Activation | By Scoping of Process Component | Operations |
Release Status | Released |
An interface to query email activity data.
The web service interface Query Email Activity enables you to connect external applications to your SAP system and to query and read email activities within your system. The web service interface is relevant if your company wants to access and manage email activity data from external applications.
The web service interface Query Email Activity offers the operation FindByElements.
Here is an example of a simple web service request to get all email activities with a certain subject name:
<n0:EmailActivityByElementsQuery_Sync_V1 xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <EmailActivitySelectionByElements> <SelectionByIdentifier> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryIdentifier>*</LowerBoundaryIdentifier> <UpperBoundaryInternalID></UpperBoundaryInternalID> </SelectionByIdentifier> <SelectionByName> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryName>A2X Example*</LowerBoundaryName> <UpperBoundaryName></UpperBoundaryName> </SelectionByName> </EmailActivitySelectionByElements> <ProcessingConditions> <QueryHitsMaximumNumberValue>25</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </ProcessingConditions> </n0:EmailActivityByElementsQuery_Sync_V1>
Query operations are mass-enabled stateless synchronous web service operations. Transferring or requesting amounts of data that are too large causes communication timeouts. The web service consumer (external application) is responsible for ensuring reasonable sizes for mass operations.
The query processing conditions specify how to process a query with respect to the maximum number of hits to be returned.
Query request messages provide the following processing parameters:
Query hits maximum number value (element name QueryHitsMaximumNumberValue): Maximum number of hits to be returned by an inquiry.
Query hits unlimited indicator (element name QueryHitsUnlimitedIndicator): Indicates whether the maximum number of hits to be returned by an inquiry is unlimited or not.
Last returned object ID (element name LastReturnedObjectID): Identifies the last object returned by a previous inquiry.
Note: If QueryHitsUnlimitedIndicator = true, QueryHitsMaximumNumberValue must not be filled.
Query response messages provide the following elements:
Returned query hits number value (element name ReturnedQueryHitsNumberValue): The number of hits returned by an inquiry.
More hits available indicator (element name MoreHitsAvailableIndicator): Indicates whether there are more than ReturnedQueryHitsNumberValue hits matching the selection criteria or not.
Last returned object ID (element name LastReturnedObjectID): Identifies the last object returned by this inquiry.
Note: Processing conditions can be used for the paging of query results. However, it is crucial not to change the query selection parameters from request to request. Otherwise, the query result might change.
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 into 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 | |
---|---|---|---|
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 |
Requested elements (element name RequestedElements) enable web service consumer to reduce the size of query response messages. Therefore, transmission and response times are reduced, thus avoiding timeouts.
Requested elements contain transmission request codes for controlling the transmission of corresponding query response node elements.
The transmission request codes are modeled as xml attributes following the syntax: <element name>TransmissionRequestCode.
The prefix <element name> is equivalent to the name of the node element in the response message to which the transmission request code applies.
Transmission Request Code | Name | Description |
---|---|---|
1 | Complete Structure | The node element and all its elements, its child node elements and all their elements will be returned. |
2 | Complete Node | The node element and all its elements will be returned. |
3 | Node with Key Elements | The node element and its key elements will be returned (not supported by all web service interfaces). |
4 | Excluded Node | The node element and its child node elements will not be returned. |
The transmission request code is optional. If no transmission request code is modeled or provided by the service consumer, then the following rules apply:
If no transmission request code is provided at all, then the response message contains all data.
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.
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.
If the transmission request code of the parent node element is 4, then its sub-node elements are not returned anyway.
The structure of the query response message consists of three parts:
A business document-specific part containing the returned business documents
Processing conditions
Log items containing system messages including errors, warnings, and information messages raised by the system during processing of the web service request.
You can find general information about Web services, their structure and consumption in the Web Services documentation.
Possible scenarios include the following:
Find Email Activity
With a certain party
With a certain name
Etc.
Example to find email activites with a certain activity party:
<n0:EmailActivityByElementsQuery_Sync_V1 xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <EmailActivitySelectionByElements> <SelectionByActivityPartyBusinessPartnerInternalID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryInternalID>MDEC9785</LowerBoundaryInternalID> <UpperBoundaryInternalID></UpperBoundaryInternalID> </SelectionByActivityPartyBusinessPartnerInternalID> </EmailActivitySelectionByElements> <ProcessingConditions> <QueryHitsMaximumNumberValue>25</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </ProcessingConditions> <RequestedElements emailActivityTransmissionRequestCode="1"> </RequestedElements> </n0:EmailActivityByElementsQuery_Sync_V1>
Description | Find e-mail activities |
Name | FindByElements |
Synchronous | yes |
Release Status | Released |
To query email activity by elements.
This is the sole operation of the web service and is used to query email activities.
You can query using following parameters:
Parameters | Description | Data Type |
---|---|---|
SelectionByIdentifier | For Email Activity ID | Identifier |
SelectionByActivityPartyBusinessPartnerInternalID | For Account ID | Identifier |
SelectionByName | For Description | Text |
SelectionByCreatedDateTime | For Creation Date Time | DateTime |
SelectionByLastChangeDateTime | For Last change Date Time | DateTime |
SelectionByReportedDateTime | For Reported Date Time | DateTime |
SelectionByBusinessPartnerInternalID | For Party ID | Identifier |
SelectionByInitiatorCode | For Direction | Code |
SelectionByIdentifier
With this query parameter you can query Email activities with specific Email Activity ID.
SelectionByActivityPartyBusinessPartnerInternalID
With this query parameter you can query Email activities for a specific customer by ID.
SelectionByName
With this query parameter you can query Email activities for a specific Email Activity name.
SelectionByCreatedDateTime
With this query parameter you can query Email activities for a specific Email Activity with the creation Date time.
SelectionByLastChangeDateTime
With this query parameter you can query Email activities for a specific Email Activity with the last change Date time.
SelectionByReportedDateTime
With this query parameter you can query Email activities for a specific Email Activity with the reported Date time.
SelectionByBusinessPartnerInternalID
With this query parameter you can query Email activities for a specific Email Activity with involved Business Partner ID.
SelectionByInitiatorCode
With this query parameter you can query Email activities for a specific Email Activity with the direction of the Email(Inbound/Outbound).
Code | Description |
---|---|
2 | Inbound |
3 | Outbound |
DateTime Format
The format of the field is YYYY-MM-DDTHH:MM:SSZ
Where YYYY is the year (for example 2011)
MM is the month (for example 12)
DD is the day(for example 31)
HH is the hours
MM is the minutes
SS is the seconds
ID- The Email activity ID
UUID- The Unique identifier for Email activity
SystemAdministrativeData- Structure node
CreationDateTime- Document creation date time
CreationIdentityUUID- Unique identifier of the user who created the Email activity
LastChangeDateTime- Document last change date time
LastChangeIdentityUUID- Unique identifier of the user who recently changed the Email activity.
Name- Name of the Email activity
PriorityCode- Priority of the Email
Code | Description |
---|---|
1 | Immediate |
2 | Urgent |
3 | Normal |
7 | Low |
InitiatorCode- Direction of the email
Code | Description |
---|---|
2 | Inbound |
3 | Outbound |
InformationSensitivityCode- Sensitivity level of the Email
Code | Description |
---|---|
1 | Normal |
2 | Personal |
3 | Private |
4 | Confidential |
GroupCode- Classification of the email activity
Code | Description |
---|---|
0004 | Business e-mail |
0009 | Marketing |
0013 | Customer complaint |
0014 | Customer request |
0015 | Business document |
DataOriginTypeCode- Orgin of the Document
Code | Description |
---|---|
1 | Manual Data Entry |
2 | Groupware |
3 | Direct Mailing |
4 | Telephony |
LifeCycleStatusCode- Email activity life cycle status code
Code | Description |
---|---|
1 | Open |
2 | In Process |
3 | Completed |
4 | Cancelled |
CorrespondenceTransmissionStatusCode
Code | Description |
---|---|
1 | Not transmitted |
2 | Sent |
3 | Received |
TransmittedDateTime- Email activity reported date time
MessageFromParty– Message from Party details
MessageToParty- Message to Party details
CopyMessageToParty- Message to CC
BlindCopyMessageToParty- Message to BCC
EmployeeResponsibleParty- Employee responsible party ID
MainActivityParty- Customer ID
ReferenceParty- Reference Party ID
ActivityUnitParty- Org Unit party ID
BusinessTransactionDocumentReference – Structure node
ID- Reference document ID
Type Code- Document type code
Role Code- Role of the reference document
Text- Details of any text stored
AttachmentFolder- Attachment to the Email
Here is an example of a simple web service request to get all email activities with a certain subject name:
Request
<n0:EmailActivityByElementsQuery_Sync_V1 xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <EmailActivitySelectionByElements> <SelectionByName> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryName>A2X Example*</LowerBoundaryName> <UpperBoundaryName></UpperBoundaryName> </SelectionByName> </EmailActivitySelectionByElements> <ProcessingConditions> <QueryHitsMaximumNumberValue>25</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </ProcessingConditions> </n0:EmailActivityByElementsQuery_Sync_V1>
Example to query Email Activity with customer ID
Request
<n0:EmailActivityByElementsQuery_Sync_V1 xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <EmailActivitySelectionByElements> <SelectionByActivityPartyBusinessPartnerInternalID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryInternalID>MC9785</LowerBoundaryInternalID> <UpperBoundaryInternalID/> </SelectionByActivityPartyBusinessPartnerInternalID> </EmailActivitySelectionByElements> <ProcessingConditions> <QueryHitsMaximumNumberValue>25</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </ProcessingConditions> <RequestedElements emailActivityTransmissionRequestCode="1"/> </n0:EmailActivityByElementsQuery_Sync_V1>