How to send the email
Hi Experts,
I want to send the email from the order_status badi, I have the email address handy.What is the FM to use to send the email.
Is there any other way to send the emails form CRM 2007, please let me know.
Thanks in Advance for your help,
Prave
Prave,
This really isn't a CRM 2007 question, because sending e-mails from CRM works generally the same through the background between the releases.
You should look at scheduled action configuration and you might find a solution based on your problem. I would recommend looking at the standard help or searching the CRM General and Framework forum on this issue.
Take care,
Stephen
Similar Messages
-
How to send the email to different email addresses from Workflow
Hello,
i an not getting that how to send the email from Workflow in SAP.
plz give the steps to do that.
i have done lots of time but system is not sending the email to different email address.Hi,
lot of configuration is invloved in sending
mail to external email id. check BASIS to
configure for external mails ans also check
debug FM and see which conditions exceptions
(Document not sendis raised)
also check below code
CLEAR: DOC_CHNG, OBJTXT, OBJBIN, OBJPACK, OBJHEAD, RECLIST,
RECIPIENT_INT, DOC_SIZE,TAB_LINES.
REFRESH: OBJTXT, OBJBIN, OBJPACK, OBJHEAD, RECLIST.
OBJBIN[] = CONTENT_OUT[].
Populate e-mail title
DOC_CHNG-OBJ_NAME = 'MAIL'.
CONCATENATE 'EETS for Contract #'(245)
OIA01_TAB-EXGNUM
INTO DOC_CHNG-OBJ_DESCR SEPARATED BY SPACE.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
It is a text document
CLEAR OBJPACK-TRANSF_BIN.
The document needs no header (head_num = 0)
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
but it has a body
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
of type RAW
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Create the attachment (the list itself)
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
It is binary document
OBJPACK-TRANSF_BIN = 'X'.
we need no header
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
but a body
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
of type PDF
OBJPACK-DOC_TYPE = 'PDF'.
OBJPACK-OBJ_NAME = 'Attachment'(239).
CONCATENATE 'EETS_' OIA01_TAB-EXGNUM '_'
IT_ZMMTACCUID-ACCTUSRID
'_' SY-DATUM '_' SY-UZEIT '.PDF'
INTO OBJPACK-OBJ_DESCR.
READ TABLE OBJBIN INDEX TAB_LINES.
DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJBIN ).
OBJPACK-DOC_SIZE = DOC_SIZE.
APPEND OBJPACK.
Get e-mail address
CLEAR IT_ADDRESS.
READ TABLE IT_ADDRESS WITH KEY ACCTID = IT_ZMMTACCUID-ACCTUSRID
BINARY SEARCH.
IF SY-SUBRC = 0.
RECIPIENT_INT-ADDRESS = IT_ADDRESS-SMTP_ADR.
ENDIF.
*Send email to external mail address
RECLIST-RECEIVER = RECIPIENT_INT.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
CLEAR RECLIST.
*Send email to SAP Office mail address
RECLIST-RECEIVER = IT_ZMMTACCUID-ACCTUSRID.
RECLIST-REC_TYPE = 'B'.
APPEND RECLIST.
CLEAR RECLIST.
SEND THE DOCUMENT BY CALLING THE SAPOFFICE API1 MODULE
FOR SENDING DOCUMENTS WITH ATTACHMENTS
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = doc_chng
put_in_outbox = 'X'
importing
sent_to_all = sent_to_all
tables
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
also check
https:/Re: mail sending problem
Regards
amole -
Hi,
Native alert on a document library can setup to email to the predefined user when any changes on the document.
However, I would like to setup a document library and alert me when
[email protected] [email protected]
[email protected] hasn't yet put a document to the library by 2014-07-01 (e.g today is 2014-06-26). The reminder email will send to
[email protected] [email protected] on 2 days before the dead line (ie. 2014-06-29) because
[email protected] and [email protected] hasn't put their file to the library on or after 2014-06-29..
ThanksHi,
http://stackoverflow.com/questions/17571562/creating-email-alert-workflow-for-sharepoint-file-libraries
http://stackoverflow.com/questions/18868479/how-to-send-automatic-email-notification-to-user-two-days-before-expiry-date
http://social.msdn.microsoft.com/Forums/en-US/acb12dd2-d6a5-4b7e-b233-037558bfa2e5/start-workflow-x-days-before-expiry-date?forum=sharepointcustomizationlegacy
Please remember to click 'Mark as Answer' on the answer if it helps you -
How to send the email without using server side (Php, java)
How to send the (Run time image or file) Email & Attachment in Flex web application. without using php, java.
Well, at some point your email needs to be handed over to an SMTP server. It's a fair amount of work, but if you want to just send an email you could open a socket to a mail server's SMTP port and follow the SMTP protocols to send your email.
ActionScript sockets: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7cf7.html
SMTP protocol: http://tools.ietf.org/html/rfc821
-- Tom -
hi, im suffering on how to send an email to reset the security question
this is because i have been already log in to the page and in the password & security there but there have no any link such as "send an rescue email to xxx mail" for me to click. so what i need to do?urgentYou need to ask Apple to reset your security questions; ways of contacting them include phoning AppleCare and asking for the Account Security team, clicking here and picking a method for your country, and filling out and submitting this form.
They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
(105183) -
How to send the email without using SOST
Hiiiiii Every1,
What i m usiing is SO_NEW_DOCUMENT_SEND_API1 FM to send the email to internet add. as well as SAP User.
The Problem is that i have to go to SOST to send the Pending mails. and send the jobs manually.
Then it works all right.
What i want that i don't wnat to send this jobs/ emails mannually by going to SOST..
Is it possible to do it without using SOST.hi
i am not sure but give this code a try
REPORT YEMAIL.
TABLES: USR02.
DATA: C(15).
DATA: SENT LIKE SONV-FLAG.
DATA: EMAIL_ID LIKE SOFOLENTI1-OBJECT_ID.
DATA: BEGIN OF EMAIL_DATA.
INCLUDE STRUCTURE SODOCCHGI1.
DATA: END OF EMAIL_DATA.
DATA: BEGIN OF EMAIL_SEND OCCURS 10.
INCLUDE STRUCTURE SOMLRECI1.
DATA: END OF EMAIL_SEND.
DATA: BEGIN OF EMAIL_TEXT OCCURS 10.
INCLUDE STRUCTURE SOLISTI1.
DATA: END OF EMAIL_TEXT.
PARAMETERS: ALL__CLI RADIOBUTTON GROUP RADI.
PARAMETERS: THIS_CLI RADIOBUTTON GROUP RADI.
PARAMETERS: SELECT__ RADIOBUTTON GROUP RADI.
SELECT-OPTIONS SEND_TO FOR C NO INTERVALS.
SELECTION-SCREEN SKIP.
PARAMETERS: SUBJECT(30).
SELECTION-SCREEN SKIP.
SELECTION-SCREEN COMMENT /1(20) TEXT-999.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L1(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L2(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L3(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L4(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L5(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L6(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L7(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L8(84).
SELECTION-SCREEN END OF LINE.SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: L9(84).
SELECTION-SCREEN END OF LINE.
EMAIL_TEXT-LINE = L1.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L2.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L3.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L4.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L5.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L6.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L7.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L8.
APPEND EMAIL_TEXT.
EMAIL_TEXT-LINE = L9.
APPEND EMAIL_TEXT.
EMAIL_DATA-OBJ_NAME = 'MESSAGE'.
EMAIL_DATA-OBJ_DESCR = SUBJECT.
EMAIL_DATA-OBJ_LANGU = 'E'.
EMAIL_DATA-SENSITIVTY = 'P'.
EMAIL_DATA-OBJ_PRIO = '1'.
EMAIL_DATA-NO_CHANGE = 'X'.
EMAIL_DATA-PRIORITY = '1'.
BREAK-POINT.
IF SELECT__ = 'X'.
LOOP AT SEND_TO.
EMAIL_SEND-RECEIVER = SEND_TO-LOW.
EMAIL_SEND-REC_TYPE = 'U'.
EMAIL_SEND-EXPRESS = 'X'.
APPEND EMAIL_SEND.
ENDLOOP.
ELSEIF THIS_CLI = 'X'.
SELECT * FROM USR02.
IF USR02-USTYP = 'A' AND USR02-BNAME NE 'SAP*'
AND USR02-BNAME NE 'DDIC'.
EMAIL_SEND-RECEIVER = USR02-BNAME.
EMAIL_SEND-REC_TYPE = 'U'.
EMAIL_SEND-EXPRESS = 'X'.
APPEND EMAIL_SEND.
ENDIF.
ENDSELECT.
ELSEIF ALL__CLI = 'X'.
SELECT * FROM USR02 CLIENT SPECIFIED.
IF USR02-USTYP = 'A' AND USR02-BNAME NE 'SAP*'
AND USR02-BNAME NE 'DDIC'.
EMAIL_SEND-RECEIVER = USR02-BNAME.
EMAIL_SEND-REC_TYPE = 'U'.
EMAIL_SEND-EXPRESS = 'X'.
APPEND EMAIL_SEND.
ENDIF.
ENDSELECT.
ENDIF.
BREAK-POINT.
EXIT.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = EMAIL_DATA
DOCUMENT_TYPE = 'RAW'
PUT_IN_OUTBOX = 'X'
IMPORTING
SENT_TO_ALL = SENT
NEW_OBJECT_ID = EMAIL_ID
TABLES
OBJECT_CONTENT = EMAIL_TEXT
RECEIVERS = EMAIL_SEND
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
regs
Arun -
Urgent Help. How to send the email in HTML format in Version 4.6c
Hi,
Please help me how to send a mail in HTML format with logo and specified format. Is it possible to send the SAPscript or Smartform in HTML format to external mail address. The logo and the format is very important in this e-mail.
quick response will help me better.
Regards,
NaiduHere is a sample program which emails HTML in the body. Of course you can put an HTML tag in there that would point to the logo on some server(internet). Notice we are just putting the HTML code in the MAILTXT table, This is how we do it at my company.
report zrich_0002.
data: maildata like sodocchgi1.
data: mailtxt like solisti1 occurs 10 with header line.
data: mailrec like somlrec90 occurs 0 with header line.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.
perform build_text_message.
perform build_receivers.
perform send_mail_nodialog..
* Form BUILD_TEXT_MESSAGE
form build_text_message.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test Subject'.
mailtxt = '<html>'.
append mailtxt.
mailtxt = '<head>'.
append mailtxt.
mailtxt = '<title>Untitled Document</title>'.
append mailtxt.
mailtxt = '<meta http-equiv="Content-Type" content="text/html;'.
append mailtxt.
mailtxt = 'charset=iso-8859-1">'.
append mailtxt.
mailtxt = '</head>'.
append mailtxt.
mailtxt = '<body>'.
append mailtxt.
mailtxt = '<div align="center"><em><font' .
append mailtxt.
mailtxt = 'color="#0000FF" size="+7" face="Arial,'.
append mailtxt.
mailtxt = 'Helvetica, sans-serif">THIS'.
append mailtxt.
mailtxt = ' IS A TEST </font></em><font' .
append mailtxt.
mailtxt = 'color="#0000FF" size="+7" face="Arial,'.
append mailtxt.
mailtxt = 'Helvetica, sans-serif"></font>'.
append mailtxt.
mailtxt = '</div>'.
append mailtxt.
mailtxt = '</body>'.
append mailtxt.
mailtxt = '</html>'.
append mailtxt.
endform.
* Form BUILD_RECEIVERS
form build_receivers.
* mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
append mailrec.
endform.
* Form SEND_MAIL_NODIALOG
form send_mail_nodialog.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'HTM'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform.
Regards,
Rich Heilman -
How to send a email with a link
Hi All,
I have a scenario where I have to send an email to a person informing him about the workitem
Now this user is not a SAP user so i have to send a link to him of a web page where he will execute
the work item.Please advice about how to send the email with a link.
Thanks in Advance,
Saket.Hi,
If you are using a Workflow, in the send mail step type, simply write the e-mail link and press enter.
when the user sees the same in the outlook, he will get them as a link but this does not happens when the mail is seen in the SAp INBOX.
if you are using the FM, give the document type as 'HTM', to send mail.
This will work for you.
Let me know if u face any issues
Regards,
Kanika -
Hi all,
I have a custom table which has the employee number and the address details. I have to send an email to all of the employees in the custom table(by retrieving the email id from IT0105). I want to know, how to send the emails.
Basically i want to know the entire coding part of it.
Thanks in Advance,
BalajiThis function should help you
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
document_type = 'RAW'
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_content = it_solisti1
receivers = it_somlreci1
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8. -
Sending the email from the sap gateway
hi,
Any body please help me how to send the email from the sap end. what is the funcion module used for that one what the parameters need to pass for that function module.Hi, check if below code is helpful
Variables for EMAIL functionality
DATA: maildata LIKE sodocchgi1.
DATA: mailpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: mailbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailrec LIKE somlrec90 OCCURS 0 WITH HEADER LINE.
DATA: solisti1 LIKE solisti1 OCCURS 0 WITH HEADER LINE.
PERFORM send_form_via_email.
FORM SEND_FORM_VIA_EMAIL *
FORM send_form_via_email.
CLEAR: maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
REFRESH: mailtxt, mailbin, mailpack, mailhead, mailrec.
Creation of the document to be sent File Name
maildata-obj_name = 'TEST'.
Mail Subject
maildata-obj_descr = 'Subject'.
Mail Contents
mailtxt-line = 'Here is your file'.
APPEND mailtxt.
Prepare Packing List
PERFORM prepare_packing_list.
Set recipient - email address here!!!
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
APPEND mailrec.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = maildata
put_in_outbox = 'X'
TABLES
packing_list = mailpack
object_header = mailhead
contents_bin = mailbin
contents_txt = mailtxt
receivers = mailrec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
ENDFORM. "send_form_via_email
Form PREPARE_PACKING_LIST
FORM prepare_packing_list.
CLEAR: mailpack, mailbin, mailhead.
REFRESH: mailpack, mailbin, mailhead.
DESCRIBE TABLE mailtxt LINES tab_lines.
READ TABLE mailtxt INDEX tab_lines.
maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
Creation of the entry for the compressed document
CLEAR mailpack-transf_bin.
mailpack-head_start = 1.
mailpack-head_num = 0.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'RAW'.
APPEND mailpack.
mailhead = 'TEST.TXT'.
APPEND mailhead.
File 1
mailbin = 'This is file 1'.
APPEND mailbin.
DESCRIBE TABLE mailbin LINES tab_lines.
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'TXT'.
mailpack-obj_name = 'TEST1'.
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
APPEND mailpack.
*File 2
mailbin = 'This is file 2'.
APPEND mailbin.
DATA: start TYPE i.
DATA: end TYPE i.
start = tab_lines + 1.
DESCRIBE TABLE mailbin LINES end.
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = start.
mailpack-body_num = end.
mailpack-doc_type = 'TXT'.
mailpack-obj_name = 'TEST2'.
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
APPEND mailpack.
ENDFORM. "prepare_packing_list -
HOW TO SEND PERSONALIZED EMAILS WITH THE SAME MESSAGE, BUT WITH THE INDIVIDUAL RECIPIENT'S NAME... (OR NAME AND THE EMAIL ADDRESS) TO ALL ADDRESSES IN THE ADDRESS BOOK - WITH RECIPIENTS SEEING ONLY THEIR OWN NAME WITHIN THE BODY OF THE MESSAGE TO THEM ?
ALSO, HOW TO ELIMINATE ALL THE OTHER NAMES FROM THE LIST - SO THEY CAN NOT SEE WHO ELSE IS ON THE MAILING LIST, AND WHO ELSE IS GETTING THE SAME MESSAGE?In the csv file, the column headers must match the the special references in curly brackets.
So you either change the column header in .csv file or the bit in the curly brackets in the Template email.
To change the column header:
In the example shown below, I wanted to use the first two columns
'First Name', 'Last Name' note the exact spelling.
I also wanted the email address which was in a column called 'Primary Email'.
To make it easier for me, I copied the Primary Email column and inserted it into the third column position and then changed the column header name from 'Primary Email' to 'Email'. (This meant I still had the original column header just in case). see image below.
But you could just change the column header name from 'Primary Email' to 'Email' without moving column about - up to you.
At this point check that all the contacts do have a valid email address.
then save the file.
If you do not want to edit the .csv file, then you need to edit the template email.
eg: {{First Name}} {{Last Name}} <{{Email}}>
change to : {{First Name}} {{Last Name}} <{{Primary Email}}>
If still having an issue, please post two images.
One image needs to show the row of column headers used in .csv file.
The other image needs to show the Template email, so I can see how you have used the curly brackets. -
How to send formatted email text which is maintained in the SE61 by CL_BCS
Helllo Colleague:
I maintained some email text template in the SE61, there are some format in these text template. E.g. bold / italics.
Then I will send these text by the function CL_BCS .
So how could I send the email with the format which is defined in the SE61? I can get the text information from SE61 by FC:DOCU_GET in 'ITF' format .
Could you please show some code sample ?
Thank you
Best regards
Wendengso you don't have permission to send email through their mailservers, what a surprise.
Ever heard of spam? Ever wondered how people manage to send millions of emails through other peoples' servers?
That's why most companies don't allow you to send email through their servers unless you're located inside their network (and even then require username and password). -
How to send an email with an attachment to the customers email address.
Hi friends,
How to send an email with an attachment to the customers email address.
the attachment will be in doc format.
Having an Header
the data which i am sending must be in a TABLE format
with 5 columns.
and each column must have a column heading
Please guide me.
Thanks in Advance,
Ganesh.*& Report ZEMAIL_ATTACH *
*& Example of sending external email via SAPCONNECT *
REPORT ZEMAIL_ATTACH .
TABLES: ekko.
PARAMETERS: p_email TYPE somlreci1-receiver .
*Here get the values of mail from the table adn6 for the customer address.
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
wa_ekpo TYPE t_ekpo.
TYPES: BEGIN OF t_charekpo,
ebeln(10) TYPE c,
ebelp(5) TYPE c,
aedat(8) TYPE c,
matnr(18) TYPE c,
END OF t_charekpo.
DATA: wa_charekpo TYPE t_charekpo.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
*START_OF_SELECTION
START-OF-SELECTION.
Retrieve sample data from table ekpo
PERFORM data_retrieval.
Populate table with detaisl to be entered into .xls file
PERFORM build_xls_data_table.
*END-OF-SELECTION
END-OF-SELECTION.
Populate message body text
perform populate_email_message_body.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Example .xls documnet attachment'
'DOC'
'filename'
changing gd_error
gd_reciever.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp aedat matnr
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekpo.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM build_xls_data_table.
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
LOOP AT it_ekpo INTO wa_charekpo.
CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
wa_charekpo-aedat wa_charekpo-matnr
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'Please find attached a list test ekpo records'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODY
regards,
venkat. -
I have finally set up a group in my contacts. Can anyone please tell me how to send an email to the entire group? running Mavericks on iMac
Drag the entire group into the To: field of a new message. The group is in your Address Book. You've used a name for it, like My Group. You can simply start typing "My Group" in that To: field and it should appear in a context menu.
-
How to send the Layout as an email..?
Hi,
I have a layout. How to send the output of the layout as an email..? Is it something that needs to be done in the layout(SE71) or do we need to write any coding in the print program..? I mean, calling any function module kind of things.
Or do we need to maintain some settings in SE71 itself..?
Please provide your inputs. Thanks in advance.
Thanks & Regards,
Paddu.hi,
if u want to send the layout, n the other person also need to open it in se71 only, then simply download ur layout, send that file in email. then the other person can upload it n can open in se71.
to download the layout, just execute the program RSTXSCRP, there give ur script name, then it downloads.
hope this may slove ur problem.
reward if helpful.
Maybe you are looking for
-
Cannot delete music from my new iPod nano
I have just bought an iPod nano 4GB and when I first got it I copied over almost a full 4GB of music to it. I have now ripped a lot of my cds in itunes and have about 20GB of music so I cannot copy the entire library, therefore I would like to copy e
-
Activity variance and production variance seperate in COPA
Dear experts, My client wanted to break production variance(ko88 in two parts in COPA reports Total material variance Total Activity variance What i am thinking- In PA transfer structure of Production order.I will create four assignements 1)Material
-
Not working my payment method my account is axis bank master card declined
My bank is Axis bank my card is debit card master not payment declined anothor payment option pls help
-
Internal mic not working after updating to 10.10.1
After updating to 10.10.1 (from 10.10) on my MacBook pro 2010 (15" screen) the internal mic is not working when using FaceTime (or Skype) and so the person on the other end of the video/audio call is unable to hear me. On my end there is a static/cra
-
Crash bp-0e7b391a-aa4b-4dbf-b189-91fa52130919
This one of several Crash Reports\submitted I have which all have common last seven digits except the final 2. For example: <pre> bp-0e7b391a-aa4b-4dbf-b189-91fa52130919 ''(included this one as well - c)'' bp-1c89e9c6-f5eb-466f-ac32-02afe2130918 bp-4