thespot4sap.com independent sap information
 

New - get SAP Access - pay monthly

SAP Tutorials    Online SAP Training    SAP CBT's    Forums    SAP Articles    SAP Jobs    Resumes
  SAP Access    SAP Blogs    SAP Books     Links     Vendor Directory     Submit Content    Search

New Page 1

Previous Page

Next Page

Sending Emails and SAP Mail
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 sender@a.com receiver@b.com Trial /home/test.doc testmail.

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

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.
 

Next Page

Previous Page

 

New Page 1

 

 


About Us   Contact Us   Privacy   Disclaimer   Feedback   Email Discussion   Newsletter  

Copyright © - Independent SAP Information
Partners: Learn XML, SAPdox, Worldwide Guesthouses and B&B's