Académique Documents
Professionnel Documents
Culture Documents
*"---------------------------------------------------------------------""Local Interface:
*" IMPORTING
*" REFERENCE(LV_EMP_USERID) TYPE FITP_USER-UNAME
*" REFERENCE(LV_EMP_EMAILID) TYPE PA0105-USRID_LONG
*"---------------------------------------------------------------------********************************************************************************
***
* Created by: P.Surjith Kumar, Enteg InfoTech, Bangalore, India.
* Created on: 03-11-2008
* Purpose : Sending Mail for the Respective Person's SAP Inbox and External Emai
l id.
********************************************************************************
***
* *&Get the Email id and User id Whom you want to Send ******
DATA:it_receivers TYPE STANDARD TABLE OF somlreci1,
wa_it_receivers LIKE LINE OF it_receivers,
it_packing_list TYPE STANDARD TABLE OF sopcklsti1,
gd_doc_data TYPE sodocchgi1,
wa_it_packing_list LIKE LINE OF it_packing_list,
psubject(90) TYPE c,
it_message TYPE STANDARD TABLE OF solisti1,
wa_it_message LIKE LINE OF it_message,
c1(99) TYPE c,
c2(15) TYPE c,
num_lines TYPE i.
&-- Assign the Email id and User id to Whom you want to Send -------------&
FREE wa_it_receivers.
wa_it_receivers-receiver = lv_emp_emailid. "&---- Assign Email id
wa_it_receivers-rec_type = 'U'. "&---- Send to External Email id
wa_it_receivers-com_type = 'INT'.
wa_it_receivers-notif_del = 'X'.
wa_it_receivers-notif_ndel = 'X'.
APPEND wa_it_receivers TO it_receivers .
FREE wa_it_receivers.
wa_it_receivers-receiver = lv_emp_userid. "&----- Assign SAP User Id
wa_it_receivers-rec_type = 'B'. "&-- Send to SAP Inbox
wa_it_receivers-com_type = 'INT'.
wa_it_receivers-notif_del = 'X'.
28/03/2015 Send Message to External email id and SAP User id via ABAP - ABAP Dev
elopment - SCN Wiki
http://wiki.scn.sap.com/wiki/display/ABAP/Send+Message+to+External+email+id+and+
SAP+User+id+via+ABAP 7/15
wa_it_receivers-notif_ndel = 'X'.
APPEND wa_it_receivers TO it_receivers .
*& - END of Assign the Email id and User id to Whom you want to Send --&
"&--- Read the Number of lines in the Internal Table
DESCRIBE TABLE it_receivers LINES num_lines.
"&--- Check the Sender Email id or SAP User id is got or not.
IF num_lines IS NOT INITIAL.
*&--------------------------------------------------------------------* Add thetext to mail text table
*&---------------------------------------------------------------------*&-- Subject of the mail -------------&*
psubject = 'Send Mail from ABAP Program.'(001).
&-- Body of the mail ----------------&*
CLEAR wa_it_message.
c1 = 'Dear'(005).
c2 = lv_emp_userid.
enqueue_error = 7
OTHERS = 8 .
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
28/03/2015 Send Message to External email id and SAP User id via ABAP - ABAP Dev
elopment - SCN Wiki
http://wiki.scn.sap.com/wiki/display/ABAP/Send+Message+to+External+email+id+and+
SAP+User+id+via+ABAP 9/15
5. Save and Active it.
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF. "&---- END of Check the Sender Email id or SAP User id is got or not.
ENDFUNCTION