Sending Emails and SAP Mails Using ABAP
Content
Introduction
Understanding the Function Module SO_OBJECT_Send
Sending Emails to a non-SAP system using UNIX
Understanding the UNIX shell script
SAP Mail example ABAPcode
Example Email UNIX ABAP Code
  Sending Emails and SAP Mails Using ABAP
-Understanding the UNIX shell script-
 
Page 4 Of 6
Import Parameters Name and Description Field name Field function
Commandname

Name of unix shell script or command to be executed by SAP

  Name of unix shell script to be invoked
Parameters   The parameters to be sent to unix shell script ($1, $2 etc). Send parameters as a concatenated string separated by space and length not exceeding 128 characters

For eg in UNIX environment the above shell script would be executed as

Sndmail

We will be simulating this command using the FM from SAP system

sender@a.com receiver@b.com Trial /home/test.doc testmail.
Table Parameters Name and Description Field Name Field function
Exec_protocol (structure)

Table to get messages from unix server after shell script is executed

Length Length of the message from external program i.e unix
  Message Log message from external program i.e unix
Export Parameters Name and Description Field name Field function
Status

Contains the status of execution of external program

  Scheduling status of external program i.e unix

Once the above FM is invoked with the necessary parameters the unix program sendmail will send a mail to the inbox of the recipient in Microsoft.

The restriction on the parameter string length of 128 characters can be removed to make way for very long email addresses and subjects. Build the parameters into an internal table and download it as a file on the unix server. Instead of passing each parameter individually, pass the unix server path of this file as the parameter to the unix shell script (sndmail mentioned above). Modify the shell script to read every line of this parameter file as variables to be used in the shell script.

In the next article we will see an example of the ABAP code you can use to send SAP Mails.

 
Stats Box
Vendor Listings (9)
Jobs (3)
Resumes (3)
Tutorials (18)
Articles (22)
Code Snippets (1)
CBTs (17)
Books (4)
Online Training (15)
Latest 5 Tutorial
SAPscript
SAP Mobile Engine
Integrating XML into SAP Business Connector
Lotus Notes Integration
SAP Data Archiving
 
Copyright © 2007 SapDox.com. All rights Reserved.