SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.

CRM Companies List
Web Based CRM Software

SAP Email Send using ABAP efg_gen_send_email Function Call

Sending email from an ABAP report using efg_gen_send_email function call can be easily managed.
If your business requirement does not require to send attachment with email, ABAP developers can use efg_gen_send_email to send SAP email.

Here is the part of the email send by SAP system used by efg_gen_send_email function call.

sap email efg_gen_send_email

You can find the ABAP source codes of the sample ABAP report zemailexample below.

Here is the ABAP code of example SAP email send report.

REPORT zemailexample .

  gs_t005t TYPE t005t,
  gt_t005t TYPE TABLE OF t005t.

SELECT * FROM t005t INTO TABLE gt_t005t WHERE spras = 'E'.

  gv_sender TYPE string, " Sender Email Address
  gv_recipient TYPE string, " Recipients Email Address
  gv_title TYPE string, " Email Subject
  gv_soli_tab TYPE soli_tab, " Email Body
  gv_soli_tab_line TYPE LINE OF soli_tab.

gv_title = 'T005 SAP Country Table'.
gv_sender = 'sender@email.com'.
gv_recipient = 'recipient@email.com'.

LOOP AT gt_t005t INTO gs_t005t.
  CONCATENATE gs_t005t-land1 ' - ' gs_t005t-landx INTO gv_soli_tab_line.
  APPEND gv_soli_tab_line TO gv_soli_tab.

    i_title = gv_title
    i_sender = gv_sender
    i_recipient = gv_recipient
    i_flg_send_immediately = 'X'
    i_tab_lines = gv_soli_tab
    "i_flg_commit = 'X'
    not_qualified = 1
    failed = 2
    OTHERS = 3.

SAP Resources

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table

Related Articles and Tutorials(http://www.kodyaz.com/articles/sap-email-send-efg_gen_send_email-abap-function.aspx)
Switch ABAP Variable Value with Translate using Mask
Switch ABAP Variable Value with Translate using Mask

Copyright © 2004 - 2018 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems