Email Body: Excel data
Hi,
Excel data is not showing the same in email body,
oMessage.HtmlBodywhere oMessage is the spemailmessage.
Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
you see a reply being an answer to the question of the thread, click "Mark As Answer
Similar Messages
-
How to embedded oracle report data in email body from forms?
Hi,
I am working on oracle forms and report 10g and i am new to this. I want to knw How to embedded oracle report data in email body ?
Regards
ShrutiI have uploaded a sample . This might help
http://www.alexyscorp.com/send_report_email.zip -
IS possible to extract data from email body using ssis?
IS possible to extract data from email body using ssis?
the email come with a display table
CRISTINA& MICROSOFT ForumHi perezco,
As Piotr said, this can be done through .NET programming in a Script Task or a Script Component. For the code snippet, please refer to the following thread:
http://forums.asp.net/t/1629654.aspx
In addition, there are also third party SSIS components that provide such a functionality such as:
http://www.cozyroc.com/ssis/receive-mail-task
Regards,
Mike Yin
If you have any feedback on our support, please click
here
Mike Yin
TechNet Community Support -
Burst child level data in email body
Hi all,
is it possible to burst child level(with respect to the request select level) data in an email body?
To explain;
Say I wanted to burst to email all the invoices a vendor had. This burst would send email separately to each vendor with an attachment of their invoices.
However to achieve that, the select level has to be vendors(no?). So far so good.
The problem then comes in when I want to the invoice numbers of a given vendor within the email body itself.
Data structure looks like this
<XXXX_SPLIT_DATA_TEST>
<P_START_DATE>2011-06-06 00:00:00.0</P_START_DATE>
<LIST_G_OTHERS>
<G_OTHERS>
<P_START_DATE>06-Jun-2011</P_START_DATE>
<MY_START_DATE>2011-09-14T00:00:00.000-04:00</MY_START_DATE>
</G_OTHERS>
</LIST_G_OTHERS>
<LIST_G_V>
<G_V>
<VENDOR>ACMEVENDOR1 INC</VENDOR>
<VEN_NUM>50182</VEN_NUM>
<VEN_SITE_CODE>MISSISSAUGA</VEN_SITE_CODE>
<SITE_EMAIL>[email protected]</SITE_EMAIL>
<CF_VENDOR_ID>36985</CF_VENDOR_ID>
<CF_VENDOR_SITE_ID>44247</CF_VENDOR_SITE_ID>
<LIST_G_INV>
<G_INV>
<INV_NUM>XO178539</INV_NUM>
<AMT>20</AMT>
</G_INV>
<G_INV>
<INV_NUM>XO178539-1</INV_NUM>
<AMT>30</AMT>
</G_INV>
<G_INV>
<INV_NUM>XO178539-5</INV_NUM>
<AMT>100</AMT>
</G_INV>
<G_INV>
<INV_NUM>XO178539-6</INV_NUM>
<AMT>20</AMT>
</G_INV>
</LIST_G_INV>
</G_V>
<G_V>
.....My burst control file looks like this
<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
<xapi:request select="/XXXX_SPLIT_DATA_TEST/LIST_G_V/G_V">
<xapi:delivery>
<xapi:email server="myserver" port="25" from="[email protected]" reply-to ="">
<xapi:message id="${CF_VENDOR_SITE_ID}" to="${SITE_EMAIL}" attachment="true"
subject=" New Invoices created for : ${VEN_SITE_CODE}">
<! - Add invoices belonging to Vendor- >
Please find attached list of new invoices
Regards,
Acme Corporation
</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document output="TEST_${VEN_NUM}_${VEN_SITE_CODE}.pdf" output-type="pdf" delivery="${CF_VENDOR_SITE_ID}">
<xapi:template type="rtf" location="xdo://XXXX.TEST_INV_BURST_EMAIL_XXXX.en.US?getSource=true" filter=""></xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset> Any ideas?
Thanks
KofiI was actually able to get it working myself, using the following:
var mail;
var address = "[email protected]";
var firstname = firstname.rawValue;
var lastname = lastname.rawValue;
var location = location.rawValue;
var date = date.rawValue
var email = email.rawValue;
var phone = phone.rawValue;
var company = company.rawValue;
var heardabout = heardabout.rawValue;
var reasonforcall = reasonforcall.rawValue;
var referredto = referredto.rawValue;
var notes = notes.rawValue
var subject = "New Prospect: "+ firstname + " " + lastname + " in " + location;
body = "Date: " + date + "\n" + "Last Name: " + lastname + "\n" + "First Name: " + firstname + "\n" + "Phone: " + phone
+ "\n" + "Email: " + email + "\n" + "Company: " + company + "\n" + "Location: " + location + "\n" + "Heard about us from: " + heardabout
+ "\n" + "Reason for call: " + reasonforcall + "\n" + "Referred to: " + referredto + "\n" + "\n" + "Notes: " + "\n" + notes;
mail = "mailto:" + address + "?subject=" + subject + "&body=" + body ;
event.target.submitForm({cURL: mail, cMsg: cBody, cSubmitAs: "PDF",cCharset: "utf-8"}); -
Send email including the data field into the html message body
Hi all,
I would like to send an email to each recipient once only, and including a data field into the html body message. I am not sure how to achive that with my current stored procedure.
USE [CallManager]
GO
/****** Object: StoredProcedure [dbo].[PersonalCallsReminder] Script Date: 08/27/2014 10:26:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[PersonalCallsReminder]
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Email Users
declare @email varchar(max)
declare mycursor cursor FAST_FORWARD for
SELECT dbo.HumersStaffExtension.email
FROM dbo.Calls_Mobile_Header INNER JOIN
dbo.HumersStaffExtension ON
dbo.Calls_Mobile_Header.TelNumber = dbo.HumersStaffExtension.telnr_prv COLLATE SQL_Latin1_General_CP1_CI_AS
GROUP BY dbo.Calls_Mobile_Header.RecordStatus, dbo.HumersStaffExtension.usr_id, dbo.HumersStaffExtension.email,
dbo.HumersStaffExtension.res_id
HAVING (dbo.Calls_Mobile_Header.RecordStatus = N'0') AND (NOT (dbo.HumersStaffExtension.email IS NULL))
OPEN mycursor;
FETCH NEXT FROM mycursor
INTO @email
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'CallsManagement',
@recipients = @email ,
@body_format = 'HTML',
@subject = 'Personal Calls Reminder',
@body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Personal Calls Reminder</title>
<style type="text/css">
body {
font-family: "Times New Roman", Times, serif;
font-size: 11pt;
.auto-style1 {
background-color: #FFFF00;
</style>
</head>
<body>
<div>
<table style="width: 800px">
<tr>
<td>Dear,<br />
<br />
Please review your phone bills and submit your personal calls using the following link:<br />
<a href="http://companyxyz/personalcalls/">Personal Calls</a></td>
</tr>
</table>
<br/>
<table style="width: 800px">
<tr>
<td><strong>Kindly be informed that the deadline to process new bills is on the
<span class="auto-style1">15th of each month</span>.</strong></td>
</tr>
</table>
<br/>
<table style="width: 800px">
<tr>
<td>For assistance, please contact <a href="mailto:[email protected]">[email protected]</a></td>
</tr>
</table>
<br/>
<table style="width: 800px">
<tr>
<td><strong>*** This is an automatically generated email, please do not reply ***</strong></td>
</tr>
</table>
</div>
</body>
</html>
FETCH NEXT FROM mycursor
INTO @email
END
CLOSE mycursor;
DEALLOCATE mycursor;
END
Changing the query to the following:
SELECT TOP (100) PERCENT dbo.HumersStaffExtension.email, dbo.Calls_Mobile_Header.ExtractDate
FROM dbo.Calls_Mobile_Header INNER JOIN
dbo.HumersStaffExtension ON
dbo.Calls_Mobile_Header.TelNumber = dbo.HumersStaffExtension.telnr_prv COLLATE SQL_Latin1_General_CP1_CI_AS
GROUP BY dbo.Calls_Mobile_Header.RecordStatus, dbo.HumersStaffExtension.usr_id, dbo.HumersStaffExtension.email, dbo.HumersStaffExtension.res_id,
dbo.Calls_Mobile_Header.ExtractDate
HAVING (dbo.Calls_Mobile_Header.RecordStatus = N'0') AND (NOT (dbo.HumersStaffExtension.email IS NULL))
ORDER BY dbo.HumersStaffExtension.email
Will provide me with the following results:
email ExtractDate
[email protected]
July-2014
[email protected]
August-2014
[email protected]
July-2014
[email protected]
August-2014
Is it possible to send email to [email protected] once only including in the html message body the ExtractDate field results for July-2014 and August-2014?
I appreciate any assist on the issue.
Thank you in advance.Refer the below code highlighted in bold.
USE [CallManager]
GO
/****** Object: StoredProcedure [dbo].[PersonalCallsReminder] Script Date: 08/27/2014 10:26:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[PersonalCallsReminder]
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Email Users
declare @email varchar(max),@date datetime
declare @temp table (email varchar(50), extractDate datetime)
insert into @temp
SELECT TOP (100) PERCENT dbo.HumersStaffExtension.email, dbo.Calls_Mobile_Header.ExtractDate
FROM dbo.Calls_Mobile_Header INNER JOIN
dbo.HumersStaffExtension ON
dbo.Calls_Mobile_Header.TelNumber = dbo.HumersStaffExtension.telnr_prv COLLATE SQL_Latin1_General_CP1_CI_AS
GROUP BY dbo.Calls_Mobile_Header.RecordStatus, dbo.HumersStaffExtension.usr_id, dbo.HumersStaffExtension.email, dbo.HumersStaffExtension.res_id,
dbo.Calls_Mobile_Header.ExtractDate
HAVING (dbo.Calls_Mobile_Header.RecordStatus = N'0') AND (NOT (dbo.HumersStaffExtension.email IS NULL))
ORDER BY dbo.HumersStaffExtension.email
declare mycursor cursor FAST_FORWARD for SELECT DISTINCT email from @temp
OPEN mycursor;
FETCH NEXT FROM mycursor
INTO @email
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @date nvarchar(200)
SELECT @date=Stuff((SELECT ',' + [extractDate]
FROM @temp where email = @email
FOR xml path('')), 1, 1, '')
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'CallsManagement',
@recipients = @email ,
@body_format = 'HTML',
@subject = 'Personal Calls Reminder',
@body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Personal Calls Reminder</title>
<style type="text/css">
body {
font-family: "Times New Roman", Times, serif;
font-size: 11pt;
.auto-style1 {
background-color: #FFFF00;
</style>
</head>
<body>
<div>Extract Date : ' + @date + '</div>
<div>
<table style="width: 800px">
<tr>
<td>Dear,<br />
<br />
Please review your phone bills and submit your personal calls using the following link:<br />
<a href="Personal">http://companyxyz/personalcalls/">Personal Calls</a></td>
</tr>
</table>
<br/>
<table style="width: 800px">
<tr>
<td><strong>Kindly be informed that the deadline to process new bills is on the
<span class="auto-style1">15th of each month</span>.</strong></td>
</tr>
</table>
<br/>
<table style="width: 800px">
<tr>
<td>For assistance, please contact <a href="[email protected]:[email protected]">[email protected]</a></td>
</tr>
</table>
<br/>
<table style="width: 800px">
<tr>
<td><strong>*** This is an automatically generated email, please do not reply ***</strong></td>
</tr>
</table>
</div>
</body>
</html>
FETCH NEXT FROM mycursor
INTO @email
END
CLOSE mycursor;
DEALLOCATE mycursor;
END
Regards, RSingh -
E-Separation - Can we pass dynamic data in email body ?
Hello Experts,
I'm trying to pass dynamic data in the email body which is triggered on the process initiation in E-SEPARATION. Could someone please tell if it is possible in the first place ? If possible, how can I proceed ...
What I tried ?
When I initiate the separation process, I'm able to trigger the emails but with static content. Need something to be passed dynamically in it ....
Thanks
VivekYou can check the Document HRPBSIN_AC_MAIL_PARAMETERS for dynamic parameters which can be used in your mail content.
But it's limited and will not full fill to have more dynamic variables as per business requirement.
So we have the option to enhance and replace the dynamic variable content for mail content in class CL_EAIN_UTILITIES method SEND_MAIL
For this method you can create overwrite exit and pass the dynamic values in dialog texts objects. -
Bug sending email with Excel file (immediate reply would he helpfull)
Hi ,
Below is have pasted a sample code where it will sends a email along with an attachtment (xls) .where the email is working perfectly but the xls file attachtment has a blank space in the first line .
where iam facing the problem ,
ie there should not be any blank lines at the top .
Please run the code one i have pasted below .u can find the bug .
can any one help me on this .
please have ur mail id in ( reclist-receiver ) so that u can check for the output.
This table requires information about how the data in the
tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are
to be distributed to the documents and its attachments.
DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
This table must contain the summarized data dependent on each object type.
SAPscript objects store information here about forms and styles,
for example. Excel list viewer objects store the number of rows and columns
amongst other things and PC objects store their original file name.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
*CREATION OF INTERNAL TABLE
DATA : BEGIN OF itobjbin OCCURS 10 ,
vbeln type vbrp-vbeln,
matnr type vbrp-matnr,
werks type vbrp-werks,
fktyp like vbrk-fktyp,
END OF itobjbin .
This table must contain the summarized content of the objects identified as binary objects.
*DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: objbin TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: wa_itobjbin LIKE itobjbin .
This table must contain the summarized content of the objects identified as ASCII objects.
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
This table must contain the document recipients.
DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
This structure must contain the attributes of the document to be sent.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
DATA : V_FKTYP LIKE VBRK-FKTYP.
Creating the document to be sent
doc_chng-obj_name = 'OFFER'. " input contains the attributes of the document to be sent
doc_chng-obj_descr = 'EMAIL WITH EXCEL DOWNLOAD'. "input contains title/subject of the document
*BODY OF THE MAIL
OBJTXT = 'Hi'.
APPEND OBJTXT .
OBJTXT = 'Test for excel download'.
APPEND OBJTXT.
OBJTXT = 'Below is the attachment with Billing Document Details'.
APPEND OBJTXT.
OBJTXT = 'Regards'.
APPEND OBJTXT.
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
Creating the entry for the compressed document
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
Creating the document attachment
(Assume the data in OBJBIN are given in BMP format)
select vbeln matnr werks
from vbrp into table itobjbin
up to 10 rows
where werks GE '1000'.
loop at itobjbin.
select single fktyp into v_fktyp from vbrk where vbeln = itobjbin-vbeln.
move v_fktyp to itobjbin-fktyp.
modify itobjbin.
endloop.
PERFORM build_xls_data_table .
DESCRIBE TABLE objbin LINES tab_lines.
objhead = 'ABC.XLS'. APPEND objhead.
Creating the entry for the compressed attachment
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'XLS'.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = 'XLS'.
objpack-doc_size = tab_lines * 255.
APPEND objpack..
Entering names in the distribution list
reclist-receiver = ''.
reclist-rec_type = 'U'.
APPEND reclist.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
commit_work = 'X'
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.
CASE sy-subrc.
WHEN 0.
WRITE: / 'Result of the send process:'.
LOOP AT reclist.
WRITE: / reclist-receiver(48), ':'.
IF reclist-retrn_code = 0.
WRITE 'sent successfully'.
ELSE.
WRITE 'not sent'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'no authorization to send to the specified number of', 'recipients!'.
WHEN 2.
WRITE: / 'document could not be sent to any of the recipients!'.
WHEN 4.
WRITE: / 'no authorization to send !'.
WHEN OTHERS.
WRITE: / 'error occurred during sending !'.
ENDCASE.
*& Form build_xls_data_table
text
--> p1 text
<-- p2 text
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
CONCATENATE 'Billing Document' 'Material Number' 'Plant' 'Billing category' ' ' INTO objbin SEPARATED BY con_tab.
CONCATENATE con_cret objbin INTO objbin.
APPEND objbin.
LOOP AT itobjbin .
CONCATENATE itobjbin-vbeln itobjbin-matnr itobjbin-werks itobjbin-fktyp' '
INTO objbin SEPARATED BY con_tab.
CONCATENATE con_cret objbin INTO objbin.
APPEND objbin.
ENDLOOP.
thanks in advance,
vinay .Hi ravi ,
Thanks ,for your help .now xls is working fine .
but now iam facing a problem with the same function module .for txt files .where all the records are formated in asingle line .
can u provide a solution for this ,which would be very helpfull.
below is have attached the sample code .
Thanks,
vinay.
FUNCTION Z_KAILASH_ATTACHMENT1.
""Local Interface:
*" IMPORTING
*" VALUE(EMAILID)
*" VALUE(SUBJECT)
*" VALUE(ATYPE)
*" TABLES
*" ATTACH_FILE STRUCTURE SOLISTI1
*" BODY OPTIONAL
This table requires information about how the data in the
tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are
to be distributed to the documents and its attachments.
DATA OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
This table must contain the summarized data dependent on each object type.
SAPscript objects store information here about forms and styles,
for example. Excel list viewer objects store the number of rows and columns
amongst other things and PC objects store their original file name.
DATA OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
This table must contain the summarized content of the objects identified as binary objects.
DATA OBJBIN TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
This table must contain the summarized content of the objects identified as ASCII objects.
DATA OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
This table must contain the document recipients.
DATA RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE .
This structure must contain the attributes of the document to be sent.
DATA: DOC_CHING LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
Create the internal table for body , subject
DATA: IT_BODY LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
CONSTANTS: con_cret TYPE C VALUE cl_abap_char_utilities=>horizontal_tab,
con_tab TYPE C VALUE cl_abap_char_utilities=>cr_lf.
Move Body to Internal Table (body into it_body)
LOOP AT BODY .
MOVE BODY TO IT_BODY .
APPEND IT_BODY .
ENDLOOP.
DOC_CHING-OBJ_DESCR = SUBJECT. "Subject of the Email
Move the Subject and Body to OBJTXT
OBJTXT[] = IT_BODY[].
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHING-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Convert IT to Excel format
IF ATYPE = 'XLS' .
*CONSTANTS: con_cret TYPE C VALUE cl_abap_char_utilities=>horizontal_tab,
con_tab TYPE C VALUE cl_abap_char_utilities=>cr_lf.
LOOP AT ATTACH_FILE .
REPLACE ALL OCCURRENCES OF '#' IN ATTACH_FILE WITH con_cret. " INTO objbin.
CONCATENATE ATTACH_FILE con_tab INTO objbin.
APPEND objbin.
ENDLOOP.
ELSEIF ATYPE = 'TXT' .
LOOP AT ATTACH_FILE .
REPLACE ALL OCCURRENCES OF '#' IN ATTACH_FILE WITH con_tab. " INTO objbin.
CONCATENATE ATTACH_FILE ' ' INTO OBJBIN .
APPEND OBJBIN .
ENDLOOP.
ENDIF.
****End-Code Excel Format .
DESCRIBE TABLE objbin LINES tab_lines.
objhead = subject. APPEND objhead.
Creating the entry for the compressed attachment
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = TAB_LINES.
objpack-doc_type = ATYPE.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = 'TEST'. "Attachment File Name
objpack-doc_size = TAB_LINES * 255.
APPEND objpack..
reclist-receiver = EMAILID.
reclist-rec_type = 'U'.
APPEND reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHING
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
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 .
ENDFUNCTION. -
Hi,
We are sending Sales or. document as PDF attachement through mail.
The requirement is attached PDF document should show in email body.
Is it possible? Please provide help full information.hi this is a working program for the email with excel bady..
REPORT ZMAIL.
*& Report ZEMAIL_ATTACH *
*& Example of sending external email via SAPCONNECT *
TABLES: ekko.
PARAMETERS: p_email TYPE somlreci1-receiver .
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'
'XLS'
'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.
data: ld_store(50) type c. "Leading zeros
CONSTANTS: con_cret(5) TYPE c VALUE '0D', "OK for non Unicode
con_tab(5) TYPE c 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.
*Modification to retain leading zeros
inserts code for excell REPLACE command into ld_store
=REPLACE("00100",1,5,"00100")
concatenate '=REPLACE("' wa_charekpo-ebelp '",1,5,"'
wa_charekpo-ebelp '")' into ld_store .
concatenate ld_store into .xls file instead of actual value(ebelp)
CONCATENATE wa_charekpo-ebeln ld_store 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. -
Urgent: Sending an Email with Excel sheet attachment
Hi All,
I am preparing a report and has to send mail with excel sheet attachement. In report i am getting everything fine. But in the mail i am not getting the data, data is passing to the FM succesfully. But in the mail, excel is not having full data.
the below mentioned is my code.
i_texts-line = c_stern.
i_texts-line+254(1) = c_newline.
APPEND i_texts.
LOOP AT i_texc.
i_att_line-line = i_texc.
APPEND i_att_line.
ENDLOOP.
DATA: wa_doc_chng LIKE sodocchgi1.
DATA: w_tab_lines LIKE sy-tabix.
STATICS: c_body_start TYPE i VALUE '1'.
CONSTANTS: lc_filename(10) TYPE c VALUE 'Attachment',
lc_atthead(30) TYPE c VALUE 'Manually released invoices'.
DATA: i_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: w_doc_name(30) TYPE c.
DATA: l_text1(15),
l_text2(12),
l_text3(15),
l_text4(15),
l_text5(14),
l_text6(17),
l_text7(10),
l_text8(20),
l_text9(19),
l_text10(19),
l_text11(19),
l_text12(16),
l_text13(20),
l_text14(19),
l_text15(19),
l_text16(30).
DATA: DATE(10),
DT(2),
MON(3),
YR(4),
lc_final(50).
CLEAR: i_texts, i_reci,i_att_line. "i_bname,
REFRESH: i_texts, i_reci,i_att_line. "i_bname,
WRITE sy-datum TO w_datex.
WRITE sy-uzeit TO w_timex.
l_text1 = text-003.
l_text2 = text-004.
l_text3 = text-005.
l_text4 = text-006.
l_text5 = text-007.
l_text6 = text-008.
l_text7 = text-009.
l_text8 = text-010.
l_text9 = text-011.
l_text10 = text-012.
l_text11 = text-013.
l_text12 = text-014.
l_text13 = text-015.
l_text14 = text-016.
l_text15 = text-017.
l_text16 = text-026.
CONCATENATE
l_text1
l_text2
l_text3
l_text4
l_text5
l_text6
l_text7
l_text8
l_text9
l_text10
l_text11
l_text12
l_text13
l_text14
l_text15
l_text16
INTO i_texts SEPARATED BY
c_horz_tab.
i_texts-line+254(1) = c_newline.
APPEND i_texts.
CLEAR i_texts.
LOOP AT i_texc.
i_att_line-line = i_texc.
APPEND i_att_line.
ENDLOOP.
LOOP AT so_rec.
i_reci-receiver = so_rec-low.
i_reci-express = 'X'.
i_reci-rec_type = 'U'.
APPEND i_reci.
ENDLOOP.
DESCRIBE TABLE i_texts LINES w_tab_lines.
READ TABLE i_texts INDEX w_tab_lines.
wa_doc_chng-doc_size = ( w_tab_lines - 1 ) * 255 + STRLEN( i_texts ).
wa_obj_name = 'ZFI_XX_REL_BLOCKED_INVOICE_01'.
DT = SY-DATUM+6(2).
MON = SY-DATUM+4(2).
YR = SY-DATUM+0(4).
CONCATENATE DT MON YR INTO DATE SEPARATED BY '-'.
CONCATENATE lc_atthead date into lc_final separated by ' '.
MOVE lc_final
TO wa_obj_descr .
wa_doc_chng-obj_name = wa_obj_name.
wa_doc_chng-obj_descr = wa_obj_descr.
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 0.
i_objpack-body_num = w_tab_lines.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
APPEND LINES OF i_att_line TO i_texts.
LOOP AT i_arseg INTO wa_arseg.
i_xmplt_d-belnr = wa_arseg-belnr.
i_xmplt_d-budat = wa_arseg-budat.
i_xmplt_d-bukrs = wa_arseg-bukrs.
i_xmplt_d-lifnr = wa_arseg-lifnr.
i_xmplt_d-name1_lifnr = wa_arseg-name1_lifnr.
i_xmplt_d-wrbtr = wa_arseg-wrbtr.
i_xmplt_d-waers = wa_arseg-waers.
i_xmplt_d-ebeln = wa_arseg-ebeln.
i_xmplt_d-ebelp = wa_arseg-ebelp.
i_xmplt_d-reason = wa_arseg-reason.
i_xmplt_d-dmeng = wa_arseg-dmeng.
i_xmplt_d-dwert = wa_arseg-dwert.
i_xmplt_d-bname = wa_arseg-bname.
i_xmplt_d-name_text = wa_arseg-name_text.
i_xmplt_d-udate = wa_arseg-udate.
i_xmplt_d-comment = wa_arseg-comment.
APPEND i_xmplt_d.
ENDLOOP.
LOOP AT i_xmplt_d.
CONCATENATE i_xmplt_d-belnr
i_xmplt_d-budat
i_xmplt_d-bukrs
i_xmplt_d-lifnr
i_xmplt_d-name1_lifnr
i_xmplt_d-wrbtr
i_xmplt_d-waers
i_xmplt_d-ebeln
i_xmplt_d-ebelp
i_xmplt_d-reason
i_xmplt_d-dmeng
i_xmplt_d-dwert
i_xmplt_d-bname
i_xmplt_d-name_text
i_xmplt_d-udate
i_xmplt_d-comment
INTO i_texts SEPARATED
BY c_horz_tab.
i_texts-line+254(1) = c_newline.
APPEND i_texts.
CLEAR i_texts.
ENDLOOP.
DESCRIBE TABLE i_texts LINES w_tab_lines.
READ TABLE i_texts INDEX w_tab_lines.
wa_doc_chng-doc_size = ( w_tab_lines - 1 ) * 255 + STRLEN( i_texts ).
DESCRIBE TABLE i_texts LINES w_tab_lines.
i_objpack-transf_bin = ' '.
i_objpack-head_start = 0.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = w_tab_lines.
i_objpack-doc_type = 'XLS'.
i_objpack-obj_name = 'Attachment'.
i_objpack-obj_descr = w_doc_name.
i_objpack-obj_descr = lc_filename.
i_objpack-doc_size = w_tab_lines * 255.
APPEND i_objpack.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
TABLES
packing_list = i_objpack
contents_txt = i_texts
receivers = i_reci
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
WRITE: / 'Error in send E-Mail' .
ENDIF.
please revert me asap. It is very urgent to me. thanks in advance.
ByehI
Have you build your Excel Data table to get attachement in Mail? If no then please find the Eg. code for your reference to send Excel attachment..
* End of Selection Event : Displaying the selected data *
END-OF-SELECTION.
PERFORM EMAIL_EXCEL_ATTACHMENT.
******///form
FORM EMAIL_EXCEL_ATTACHMENT .
* Populate table with detaisl to be entered into .xls file
PERFORM BUILD_XLS_DATA_TABLE.
* 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 S_EMAIL
TEXT-042
C_XLS
'filename'
CHANGING GD_ERROR
GD_RECIEVER.
* Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
ENDFORM. " EMAIL_EXCEL_ATTACHMENT
********///form BUILD_XLS_DATA_TABLE
FORM BUILD_XLS_DATA_TABLE .
DATA : LV_NETWR(20) TYPE C,
LV_BOL_DATE(20) TYPE C,
LV_KAWRT(20) TYPE C,
LV_FKDAT(20) TYPE C,
LV_WAERK(20) TYPE C,
LV_KURRF(20) TYPE C,
LV_SHIPDATE(20) TYPE C,
LV_DEPTDATE(20) TYPE C.
CONSTANTS:
CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF. "#EC *
DATA STR TYPE STRING.
**********/ this parameter concatenate to get headers
CONCATENATE STR
'SLNO'
'OWNER'
'SERIAL NO'
'FROM'
'DESTINATION'
'INVOICE VALUE'
'DESCRIPTION'
'CUSTOMER NAME'
'BL NUMBER'
'BL DATE'
'VESSEL NAME/AIRLINE DETAILS'
'MODE OF TRANSIT'
'SHIPPING MARKS'
'DUTY SUM INSURED'
'FLAG'
'OPEN COVERNO'
'INVOICE DATE'
'INVOICE NO'
'LC WORDING'
'QUANTITY'
'PACKAGING DETAILS'
'BASIS OF VALUATION'
'EXCLUDE WAR SRCC'
'CURRENCY'
'EXCHANGE RATE'
'ADDRESS'
'VESSEL BUILT YEAR'
'VESSEL FLAG'
'VOYAGE NO'
'SHIPMENT DATE'
'DEPARTURE DATE'
'SURVEYOR COUNTRY'
'SURVEYOR CITY'
'SURVEYOR AGENT'
'SURVEYOR ADDRESS'
'EXPORT CONSIGNMENT'
'CONTAINER DETAILS'
CL_ABAP_CHAR_UTILITIES=>CR_LF INTO STR SEPARATED BY CON_TAB.
LOOP AT IT_FINAL.
*******/ this is to pass body / row data
WRITE : IT_FINAL-NETWR TO LV_NETWR, "#EC UOM_IN_MES
IT_FINAL-BOL_DATE TO LV_BOL_DATE,
IT_FINAL-KAWRT TO LV_KAWRT, "#EC UOM_IN_MES
IT_FINAL-FKDAT TO LV_FKDAT,
IT_FINAL-WAERK TO LV_WAERK,
IT_FINAL-KURRF TO LV_KURRF,
IT_FINAL-SHIPDATE TO LV_SHIPDATE,
IT_FINAL-DEPTDATE TO LV_DEPTDATE.
CONCATENATE
STR
IT_FINAL-SLNO
IT_FINAL-OWNER
IT_FINAL-SRNO
IT_FINAL-PORT_LOAD
IT_FINAL-PORT_DSCHR
LV_NETWR
IT_FINAL-DESCRIP
IT_FINAL-CUSTNAME
IT_FINAL-BOL_NUM
LV_BOL_DATE
IT_FINAL-VESSELNAME
IT_FINAL-SHP_TYPE
IT_FINAL-SHP_MARK
LV_KAWRT
IT_FINAL-FLAG
IT_FINAL-OPEN_CONO
LV_FKDAT
IT_FINAL-VBELN
IT_FINAL-LC_WORD
IT_FINAL-QUANT
IT_FINAL-PACKDETL
IT_FINAL-INCO1
IT_FINAL-EXCWSR
LV_WAERK
LV_KURRF
IT_FINAL-ADDPAY
IT_FINAL-VESSBYR
IT_FINAL-VESSFLG
IT_FINAL-VOY_FLY_NO
LV_SHIPDATE
LV_DEPTDATE
IT_FINAL-SURCOUNT
IT_FINAL-INCO2
IT_FINAL-EXPORT_CON
IT_FINAL-SURAGT
IT_FINAL-SURADD
IT_FINAL-CONTRNO
CL_ABAP_CHAR_UTILITIES=>CR_LF INTO STR SEPARATED BY CON_TAB.
ENDLOOP.
CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
EXPORTING
TEXT = STR
TABLES
FTEXT_TAB = IT_ATTACH.
ENDFORM. " BUILD_XLS_DATA_TABLE
******// form POPULATE_EMAIL_MESSAGE_BODY
FORM POPULATE_EMAIL_MESSAGE_BODY .
REFRESH IT_MESSAGE.
IT_MESSAGE = TEXT-043. " Please find attached Insurance Certificate details
APPEND IT_MESSAGE.
ENDFORM. " POPULATE_EMAIL_MESSAGE_BODY
*******'/ form SEND_FILE_AS_EMAIL_ATTACHMENT
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
* text
* -->PIT_MESSAGE text
* -->PIT_ATTACH text
* -->P_EMAIL text
* -->P_MTITLE text
* -->P_FORMAT text
* -->P_FILENAME text
* -->P_ATTDESCRIPTION text
* -->P_SENDER_ADDRESS text
* -->P_SENDER_ADDRES_TYPE text
* -->P_ERROR text
* -->P_RECIEVER text
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. "#EC *
DATA: LD_ERROR TYPE SY-SUBRC, "#EC *
* 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. "#EC *
* 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.
DESCRIBE TABLE IT_ATTACH LINES W_CNT.
READ TABLE IT_ATTACH INDEX W_CNT.
W_DOC_DATA-DOC_SIZE =
W_CNT * 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.
LOOP AT S_EMAIL.
T_RECEIVERS-RECEIVER = S_EMAIL-LOW.
T_RECEIVERS-REC_TYPE = 'U'.
T_RECEIVERS-COM_TYPE = 'INT'.
T_RECEIVERS-NOTIF_DEL = 'X'.
T_RECEIVERS-NOTIF_NDEL = 'X'.
APPEND T_RECEIVERS.
ENDLOOP.
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. " SEND_FILE_AS_EMAIL_ATTACHMENT
*******/form
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
* text
* --> p1 text
* <-- p2 text
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
*********end of code to trigger mail in excel format....
If any other help please let me know......
I am sure this example code will help you to resolve your problem...
please analyse above code for your requirement...
In my scenario the message you said is not displaying.....
Reward Points -
Upload Excel data to Sharepoint list VIA infopath form
Hi,
I'll try to explain the process of what I want to do first.
1. In Excel
I have an exceldocument (XLS, XLSX or XLSM) with 4 named columns and a named worksheet saved locally on my computer.
I want to upload this data into preferably a custom list in sharepoint but it needs to run via a infopath template first.
2. In Infopath
The Infopath template will prompt the user to specify values in 2 additional fields.
After giving input to these fields user may browse for the locally stored excel document and upload the document.
In the same infopath template a dynamic array should be visible containing 6 columns (4 from excel + 2 from headerlevel of template) and the amount of rows based on the number of rows from excelsheet.
At the end of template a submit button is found for uploading the entire array into sharepoint custom list.
Is this possible to do at all?
NOTE! End user should not have to save the excelsheet as XML file nor do a XML mapping.
Infopath should, perhaps with help of VBA read excelsheet and transfer data to correct destination in sharepoint on it self.
Looking forward to your replyHi Jonas,
You can attach your Excel doucment into InfoPath form and send InfoPath form to a custom web service. Then you can parse the Excel data and combine the Excel data and additional fields into SharePoint list in the customized web service.
For more information, you can have a look at the thread:
http://dandeng.blogspot.com/2012/03/submit-infopath-form-data-to-web.html
http://www.codeproject.com/Articles/88547/Submit-entire-InfoPath-form-to-web-service
https://social.msdn.microsoft.com/Forums/office/en-US/590f1e78-5c08-47bd-8af4-9709102b568d/webservice-to-send-attachments-in-infopath-form-to-different-location?forum=sharepointcustomization
https://msdn.microsoft.com/en-us/library/office/gg575571.aspx?f=255&MSPPError=-2147217396
Best Regards,
Eric
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
How can I attach an image without the image is in the email body? (using the new mail the Lion)
I want in attachment, not in the body mail.I think your only solution is to zip the image files first and then attach them.
Read this from a site I found:
Sending Graphical Attachments -- When you attach a graphical image to your message, the recipient of your message sees the image inline (that is, in the body of the message) if her email client supports inline display. ("Take Control of Email with Apple Mail" contains a table listing the capabilities of popular Mac and PC email clients.) If a client does not support inline display (or the recipient has turned off the inline display option), the file appears as an attachment that must be opened in a separate program.
On the one hand, an inline image is easier for the recipient to see - all she has to do is look at it. On the other hand, inline images can be frustrating to scroll through. If you do not wish to send a graphical image inline, you must compress the file before attaching it - Mail, sadly, lacks a built-in compression option, though fortunately for Panther users, the Finder offers Zip compression without requiring a separate application.
Note that when you compose a new message, Mail always shows attachments in the body of your message. You can manually drag them somewhere else, but many email clients display all attachments in a separate list, regardless of where you place them in the message body.
If you paste an image into a message or drag & drop an image from another window (say, a Web browser), Mail converts the raw image data to an attachment in TIFF format. On the other hand, if you drag & drop the icon of an image file (or use the Attach button to locate the file using the file browser), Mail leaves the attached image in its original format. This difference is significant, because although most email clients can display JPEG images just fine, support for TIFF - especially in non-Mac email clients - is less common. If possible, I suggest attaching image files as opposed to pasting or dragging in raw image data. -
BI Publisher 11g - not able to get TEXT output in the email body
I am trying to send TEXT report output generated by ETEXT templates in the email body by setting up the Bursting defintion in the Data Model using the following query. It is always sending it as an attachment though PARAMETER6 is set as false. Please advise on how to make it work?
It seems PARAMETER6 does not have any effect on how it works.
select
customer_id KEY,
'Etext_Template' TEMPLATE
'ETEXT' TEMPLATE_FORMAT,
'en-US' LOCALE,
'TEXT' OUTPUT_FORMAT,
'EMAIL' DEL_CHANNEL,
null TIMEZONE,
null CLAENDAR,
customer_name || '_status' OUTPUT_NAME,
'true' SAVE_OUTPUT,
'[email protected]' PARAMETER1,
null PARAMETER2,
'[email protected]' PARAMETER3,
'Status Report for ' || customer_name PARAMETER4,
null PARAMETER5,
'false' PARAMETER6,
null PARAMETER7,
null PARAMETER8
from dpmi_customers_v
The Oracle BI Publisher version is 11.1.1.5.0.
Thanks,
SujaControl click or Right Click on the attachment in the body of the email and select 'View as icon'.
There is a (paid for) mail plugin called Attachment Tamer which helps Mail do a much better of handling attachments - giving much more control over how they are viewed/arranged/received. It's available from http://lokiware.info/Attachment-Tamer
(Usual caveat, I've no connection with Lokiware, just happy with their product). -
Import excel data from OWB10.2
I wanted to import excel data into OWB 10gr2. So i have followed the steps in the attached link. But i cannot perform the operations from step 6 in OWB 10rR2.
In OWB10.2 how could i create a new database link. Inorder to create a new module below ODBC i have to give the location. I cannot create the location.
Step 6: Create an ODBC Source Module and a Database Link
Use the following steps to create an ODBC source module and database link:
1. From the Warehouse Builder console, create an ODBC source module. On the
navigation tree, ODBC modules are listed under the Others node of the Databases
node.
2. On the Connection Information page, click New Database Link to create a new
database link that reads data using the data source created. Figure 3–3 shows the
entries used on the New Database Link dialog.
Note: Ensure that the initialization parameter GLOBAL_NAMES is set
to FALSE in the database's initialization parameter file. FALSE is the
default setting for this parameter.
Step 6: Create an ODBC Source Module and a Database Link
3-4 Oracle Warehouse Builder Case Book
Figure 3–3 New Database Link Dialog
Notice that the Oracle Service Name field uses the Oracle system identifier
specified for the agent.
3. Ensure that the Use for Heterogeneous Services option is selected.
Because you are not accessing an Oracle database, you can enter any value for
username and password.
4. Create and test this database link. Close the New Database Link dialog.
5. Leave the Schema name <unspecified>. Click the Change Schema button and
select <unspecified>. The Connection Information page now looks as shown in
Figure 3–4.
Step 8: Create a Mapping to Load Data Into the Target Table
How Do I Load Data Stored in a Microsoft Excel File? 3-5
Figure 3–4 Connection Information Page
6. Create a new deployment location for the module or specify an existing location.
http://www.oracle.com/technology/products/warehouse/pdf/Cases/case3.pdf
But i cannot create in OWB10.2.
Can any body suggest me the process.Gillies,
I am not able to create a new location for ODBC in connection explorer.
Which option should i consider. Should i consider database link or host:port:service or sql*net connection. suppose If i take database link option what is the description i have to enter in database link box. Should i create a database link manually from sql*plus. -
Purchase Order External Send with email body text
hi guru,
i saw lot of threads but i didn't get coreect answer
i did below process
Goto NACE .
u2022 Select EF and click on OUTPUT TYPES.
u2022 Then select Output Type NEU and click on processing routines .
u2022 In that you have to add a new entry - medium 5 .
u2022 Then you need to assign a program, form routine and form.
u2022 You can use the standard program i.e. SAPFM06P, FORM routine is always ENTRY_NEU and standard MEDRUCK.
u2022 Then in PARTNER FUNCTION you need to add a new entry : medium - 5 and function - VN .
u2022 For subject of the mail goto Mail Title and Texts. In title give PO No. &EKKO-EBELN& .
u2022 Under General data -> Replacement of text symbols give programm as SAPMM06E and Form Routine as TEXT_SYMBOL_REPLACE .
u2022 Now the subject will be PO No. 1800004202.
u2022 You need to maintain your email id in tcode SU01 and also the vendor's email id.
u2022 Now while creating a new purchase order , change the medium to External Send .
u2022 Then goto Communication Method and select CS01 . ALSO make sure that the Cover Page Text has value PO No. &EKKO-EBELN& .
u2022 Goto tcode ME9F .
u2022 Execute.
u2022 Select the checkbox and click on Output Message.
u2022 You will get a message MAII 00000000000001 generated .
u2022 Use note no 191470
mail subject is going ,but mail text is not coming.
some people suggest this sap note
Note 786847 - E-mail purchase order w/ e-mail text and several attachments
i did not get this note.
give the solution for email body text ,i read some thread,it will solve through abap development .
please give solution
regards
vijayHi
1. GO to tcode SCOT.
2. Double click on SMTP
3. Click on the set button next to internet
4. In this screen for SAP Script/ Forms select TXT.
Regards
Girish
Edited by: Girish Bettaiah on Aug 8, 2011 3:11 PM -
Output in Email Body Formatting Warped
Hi All
I am completly new to powershell & am googling about for code.
I have been able to so far to send the results of a powershell query by email and am mightly impressed it worked.
When the query is done on the command line it works great, by email the output is spread wide and the fields dont align with each other.
I have pasted my commands below. I am querying the Exchange Mailbox sizes and wish to sort by the biggest down. This works great and I out put it to a text file.
I then read the text file and substitute it for the body of the email.
On the outlook email recepient end It looks to me like the window size of outlook causes the text to wrap around and it is no longer displayed lengthways.
Is there anything I can do?
Thanks
Below gets data
Get-WMIObject -Class Exchange_Mailbox -Namespace ROOT\MicrosoftExchangev2 -ComputerName
MyExchangeServer | Where-Object {$_.LastWriteTime -le (Get-Date).AddYears(1)} | Select-Object MailboxDisplayName,Size
| sort-object size -descending
Below tells which exchnage server to use
$psEmailServer = "MyExchangeServer"
Below is the text file containing the data I need assigned to $body
$body= (Get-Content mailboxsize.txt)
Below sends the email using the contents of the email as the email body, BUT it dosent come out right and its out of alignment in outlook.
send-mailmessage -from "[email protected]" -to "[email protected]" -subject "test powershell email" -body "$body"
confuseisThe PowerShell console uses a fixed-width font, by default, but most email clients don't. The best solution is to use the ConvertTo-Html command on the results of your pipeline, instead of saving the text to a file. This renders the objects in
an HTML table instead of relying on a fixed-width font, and then you use the -BodyAsHtml switch when calling Send-MailMessage:
$data = Get-WMIObject -Class Exchange_Mailbox -Namespace ROOT\MicrosoftExchangev2 -ComputerName MyExchangeServer |
Where-Object {$_.LastWriteTime -le (Get-Date).AddYears(1)} |
Select-Object MailboxDisplayName,Size |
sort-object size -descending
$psEmailServer = "MyExchangeServer"
$body = $data | ConvertTo-Html | Out-String
Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "test powershell email" -Body $body -BodyAsHtml
Edit: If you absolutely must send the contents of the file as-is, you can still try sending the body as HTML, wrapping the body text in a <pre> tag, which should be displayed in a fixed-width font:
$body = Get-Content mailboxsize.txt -Raw
$body = '<pre>{0}</pre>' -f [System.Net.WebUtility]::HtmlEncode($body)
$psEmailServer = "MyExchangeServer"
Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "test powershell email" -Body $body -BodyAsHtml
Maybe you are looking for
-
Today i downloaded the newest version of iTunes 6.0.2.23....and i ran the installation and just as it looks to end, the InstallShield window says this message exactly as it follows... The iTunes for Windows installer has completed. The installation w
-
Photoshop tools dont respond after Windows 7 pro 64 bit installed
I have the Abobe creative suite CS4 web premium student edition and I have recently upgraded to the Windows 7 professional 64 bit OS. Some of my tools in each program do not respond to clicks. In the Photoshop program my cursor in each tool is b
-
How do i transfer files from Iphone4 to iphone5
how do i merge files from iphone4 to iphone5?
-
How do i know if i am on 3g or edge?
att coverage area says i have 3G coverage where I am but i see the icon of "E" on my Iphone does that mean i am on Edge or 3G does not have an icon on its own?
-
"Bring to Front" hidden clips & deleting files after it's closed in Adobe Audition.
Hi everyone. I need some help with Adobe Audition CS5.5 usage. I have two concerns: 1) Back in Audition 3.0, there is this feature called "bring to front." I use this feature mainly for recording over and over and over until I find a the perfect