Intercepting and Logging Email\ | Table of Contents | |||||||
---|---|---|---|---|---|---|---|---|
| 1. Abstract
| . Introduction |||||||
3. How Interception and Logging Works | ||||||||
4. Email Handling Categories | ||||||||
5. The Tables | ||||||||
Intercepting and Logging Email | Table of Contents | |||||||
|
|
1. Abstract
To view an abstract of this document, click here.
...
- To whom will the E-Mail be addressed? (This is usually answered with the person's role, not their name. Some example answers are "Card holders", "SAP users entering work orders", "Training & Events administrators", "Requisition approver", "HR Service Center", "Employee timesheet user", "Payroll distribution support", and "User who created the journal voucher")
- The subject of the E-Mail? (Some example answers are "Staff out of balance report", "Problem with Lincoln HR feed to campus", "Purchase order is approved", "Duplicate MIT-IDs", "Leave balance status", and "Mass. Health Insurance report".)
- What is the name of the ABAP source object containing the call to Z_SENDMAIL?
- What is the value of SY-CPROG when Z_SENDMAIL gets control?
Special Handling Categories
Two particular email handling categories are assigned to address the special circumstance where there is no correlation between a handling category and an entry in table ZEHCAT. This may occur either because no handling category is specified, or because no entry exists in table ZEHCAT for a specified handling category.
...
A separate utility program is currently under development that will enable programmers to selectively display or delete entries in the ZEMLOG table. Until that utility is available, transaction SE16 may be used to view email log entries in table ZEMLOG.
Table ZEMCTRL
For a program that does not pass an explicit P_HNCAT parameter in its call to Z_SENDMAIL, custom table ZEMCTRL is used to map the calling program to its assigned email handling category. (If the P_HNCAT parameter is passed, ZEMCTRL is not referenced.) Eventually, all calls to Z_SENDMAIL will pass the P_HNCAT parameter and, at that time, table ZEMCTRL will no longer be needed.
...
Table ZEMCTRL contains the following fields:ZEMCTRLField NameData ElementData TypeLengthDescriptionMANDTMANDTCLNT3ClientPROGPROGRAMMCHAR40Calling program name
(SY-CPROG)HNCATZHNCATCHAR2Associated email handling category
Table ZEHCAT
For a program that passes an explicit P_HNCAT parameter in its call to Z_SENDMAIL, custom table ZEHCAT is referenced to determine how the call should be processed. This determination is made by reading the control field settings that correspond to the email handling category specified in the P_HNCAT parameter.
...
Table ZEHCAT contains the following fields:ZEHCATField NameData ElementData TypeLengthDescriptionMANDTMANDTCLNT3ClientHNCATZHNCATCHAR2Email handling categoryCMODEZCMODECHAR1Email processing mode
(<space> = Send normally, X = Intercept)ACTIONZACTIONCHAR1Email interception action
(X = Discard, R = Redirect, F = UNIX file, S = Print Spool file)MAILTOZMAILTOCHAR241"To:" Email address for redirect, or
UNIX file path & name suffixed to "/usr/bridges/<system>/saptmp/"CCTOZMAILCCCHAR241"Cc:" Email address for redirectPDESTSYPDESTCHAR4Printer name for print spool filePRIMMSYPRIMMCHAR1Print immediately flag for spool filePRRELSYPRRELCHAR1Delete after printing flag for spool filePRNEWSYPRNEWCHAR1New spool request flag for spool fileLOGZLOGCHAR1Log flag
(<space> = Don't log, X = Log)DESCRIPTIONZEHCATCOMMENTCHAR50Comment field describing HNCAT use and purpose
Table ZEMLOG
Email logging uses the same email handling categories as interception and, while logging is controlled by table ZEHCAT, the email data to be logged is written to custom table ZEMLOG.
...