SAP Netweaver, ABAP, Email, standard text
This tutorial will take you step by step process to develop ABAP program which will send E mail in HTML format. The email body content is maintained separately in Std. text object; so that it can be maintained independent of Program.
With this; email is generated in HTM format which is more asthetic than a RAW format. Email body can be formatted with all rich text properties like bold, italic fonts, text sizes, tables, etc.
Additionally email body content can be changed without changing the ABAP program; since it is maintained separately in standard text. Program modularization & ease of maintenance can be achieved.
Author: Amit Talekar
Company: Capgemini India
Created on: 23rd July 2012
Create Standard text object
Create standard text object from /SO10
Maintain text with HTML tags
In this example HTML tags for table structure are maintained.
For dynamic contents; program global variables are used
Read std. text in ABAP Program
Call FM READ_TEXT
Using Standard Function module READ_TEXT read Std. text in the program.
READ_TEXT FM returns LS_HEAD & LT_LINES.
LS_HEAD contains Header data and LT_LINES contains text maintained in the object.
Call FM TEXT_SYMBOL_REPLACE
Call FM to replace variables in std. text with actual values.
FM TEXT_SYMBOL_REPLACE returns LT_LINES with values (passed as program global variables).
Prepare E-mail subject & E-mail body
Call Std. FM to send E-mail in HTML format
Check the output in MS-Outlook