Tuesday, March 17, 2009

Sending emails out of SAP in ABAP

This is a very common task for ABAP programmer to send some report output to user’s email address. There is a lot of stuff for sending emails all around the web, not all of them are really useful, and some of them are just fragments out of other functionality that was carved out. Especially while you need to send email with attachments there are several possibilities how to program it – e.g. with different functions modules etc. Let see what SAP is advising to programmers officially. Within SAP note 190669 - Sending lists using SAPconnect. Most important finding out of this note is: Only FM shall be used: SO_DOCUMENT_SEND_API1 (not SO_NEW_DOCUMENT_ATT_SEND_API1) even for sending email with attachments. For example email sending program which is very easily adjustable to implement your needs see note 609696. A report ZSSO_DOCUMENT_SEND_API1 is available there in 2 versions. For version SAP Basis 4.6 and WAS 6.10.

No comments: