Previous Topic: Define Recipients for the Job's OutputNext Topic: Using Success and Failure Messages within an SAP Job


Email the Spool File on Step Completion or Failure

You can email the SAP spool file for a single step in an SAP R/3 job to recipients. A copy of the spool file is emailed on step completion or failure.

To email the SAP spool file on step completion or failure

  1. Specify the ABAPNAME statement to start the step definition within the job definition.
  2. Specify the EMAILADDR statement after the ABAPNAME statement.

    To specify multiple email addresses, separate each address with a comma and enclose the entire list of addresses in single quotation marks.

  3. (Optional) Specify the following optional statements to determine whether the step is a success or failure based on a text string in the job's output:

Example: Email the Spool File to Two Addresses on Step Completion or Failure

This example emails the spool output to the user1@example.com and user2@example.com addresses when the BTCTEST ABAP completes or fails:

SAPJOBNAME SAPTEST
AGENT SAPHTAGENT
SAPUSER J01PROD
ABAPNAME BTCTEST
   VARIANT TEST
   EMAILADDR 'user1@example.com,user2@example.com'