Sending report as an attachment to an email
Hi,
I need to send a report as an attachment via email using xml publisher. I created data definition, templates and could run a report. I do not know where to add the coding for sending the email? I found the following coding in developer guide:
<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
<xapi:request select="/DATA/DEPTS/DEPT/EMPLOYEES/EMPLOYEE"> <! - Burst
on employee element - >
<xapi:delivery>
<xapi:email server="my.smtp.server" port="25"
from=" email@removed " reply-to ="">
<xapi:message id="123" to="${EMAIL}"
<! - Set the id for the delivery method - ><! - Use the employees
EMAIL element to email the document to
the employee - >cc="${ADMIN_EMAIL}"
<! - Use the ADMIN_EMAIL parameter to CC the document
to the administrator - > attachment="true" subject="Employee
Details for ${ENAME}">
Mr. ${ENAME}, Please review the attached document</xapi:message><! -
Embed the employees name into the email message - >
</xapi:email>
</xapi:delivery>
<xapi:document output-type="pdf" delivery="123"><!Specify the
delivery method id to be used - >
<xapi:template type="rtf"
location="\usr\empDet.rtf"></xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
Should this needs to be added to the data template file (xml file which will attached in the data definition screen) or in the template .rtf file?
Any help on this appreciated.
Thanks
Valli
Hi,
I need to send a report as an attachment via email using xml publisher. I created data definition, templates and could run a report. I do not know where to add the coding for sending the email? I found the following coding in developer guide:
<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
<xapi:request select="/DATA/DEPTS/DEPT/EMPLOYEES/EMPLOYEE"> <! - Burst
on employee element - >
<xapi:delivery>
<xapi:email server="my.smtp.server" port="25"
from=" email@removed " reply-to ="">
<xapi:message id="123" to="${EMAIL}"
<! - Set the id for the delivery method - ><! - Use the employees
EMAIL element to email the document to
the employee - >cc="${ADMIN_EMAIL}"
<! - Use the ADMIN_EMAIL parameter to CC the document
to the administrator - > attachment="true" subject="Employee
Details for ${ENAME}">
Mr. ${ENAME}, Please review the attached document</xapi:message><! -
Embed the employees name into the email message - >
</xapi:email>
</xapi:delivery>
<xapi:document output-type="pdf" delivery="123"><!Specify the
delivery method id to be used - >
<xapi:template type="rtf"
location="\usr\empDet.rtf"></xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
Should this needs to be added to the data template file (xml file which will attached in the data definition screen) or in the template .rtf file?
Any help on this appreciated.
Thanks
Valli
Similar Messages
-
Send Report output as attachment in excel
Hi All,
I am scheduling background Job for Auto mail of standard SAP report. I am able to send the details in html format, please guide me how to send report details in excel format.
I have already check SCN but unable to find exact solution for same.
Regards
RashidRashid,
When u Go SM37 Follow This Step Then U Get The Data In Excel Format.
Follow step
Select Spool Option
Then U got the screen
Select the type option then u got screen.
In This Screen U Find the option save in Local File then get the option.
When U Select the Spreadsheet Option You can Able to save your data in excel format.
Hope its help full for you -
Re: Sending report output in the body of Email (Not as an attachment)
Hi,
My requirement is to send the report output in body part of the mail itself. I am able to send the mail with the output as an attachment but requirement is it shoud be in the body part not as an attachment..
Thanks,
Anshuman.Hi Anshu,
Can you please let me know is the ERMS configured in your system or you are sending
the mail to the customer using Action Profiles. If you are sending the mail using a smartform
assigned to an Action profile then you can display that report internal table data or etc.. in
the smartform itself so that the output data will be available in the e-mail body itself.
Please let me know the way you are sending the e-mail if the above ones are incorrect.
Thanks
Arun -
Want to Send smartform as pdf attachment with a Email to some mail id
Hi ,
I want to send a smartform as a PDF attachment with a mail to a mail id. And I can send a mail with the PDF attachment.
But I am not able to open the PDF. It is throwing some error (Adobe reader could not open u2018fileu2019 because it is either not a supported file type or because the file has been damaged (for example , it was sent as an email attachment and was not correctly decoded)).
By debugging I come to know that the file which is generating is in some encoding format.
Please help me regard this. This is very urgent.
here is the code,
Main Program :
REPORT Ztest_report.
*--Top Include for Global Data Declarations.
INCLUDE ztest_report_top.
*--Form Include for Form Routines.
INCLUDE ztest_report_form.
START-OF-SELECTION.
START-OF-SELECTION.
*--Display data
Perform display_data.
END-OF-SELECTION.
Top declaration :
Internal table
DATA : i_otfdata TYPE tsfotf, " Smart Forms: Table OTF
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
w_mailaddr TYPE ppfdmailad,
w_mailtype TYPE so_escape,
w_mailrecipient TYPE swotobjid,
w_control TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string, "To convert from 132 to 255
wa_objhead TYPE soli_tab,
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-009.
PARAMETER: p_bukrs TYPE bukrs OBLIGATORY, "Company Code
p_belnr TYPE belnr_d OBLIGATORY, "Document No
p_gjahr TYPE gjahr OBLIGATORY, "document type
p_mailid(50) TYPE c OBLIGATORY.
"Mail Id
SELECTION-SCREEN END OF BLOCK blk1.
Form Logic :
FORM display_data.
*Local Variable declaration
DATA: lc_fm TYPE rs38l_fnam, "local variable to store the
l_i_document_output_info TYPE ssfcrespd,
l_i_struc_job_output_info TYPE ssfcrescl,
l_i_struc_job_output_options TYPE ssfcrescl,
i_lines TYPE TABLE OF tline WITH HEADER LINE,
lv_job_output_info TYPE ssfcrescl,
lv_document_output_info TYPE ssfcrespd,
lv_job_output_options TYPE ssfcresop,
lv_bin_filesize LIKE sood-objlen.
Determine the smartform name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTEST_SMARTFORM'
IMPORTING
fm_name = lc_fm
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_control-getotf = 'X'.
w_control-no_dialog = 'X'.
w_control-preview = space.
w_control-device = 'MAIL'.
Call the smartform and pass the selection screen parameter
CALL FUNCTION lc_fm
EXPORTING
control_parameters = w_control
output_options = w_compop
user_settings = 'X'
t_bukrs = p_bukrs
t_belnr = p_belnr
t_gjahr = p_gjahr
IMPORTING
job_output_info = l_i_struc_job_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Moving the Smart Forms: Table OTF into an internal table
i_otfdata[] = l_i_struc_job_output_info-otfdata[].
CONVERT TO OTF TO PDF.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = lv_bin_filesize
TABLES
otf = i_otfdata
lines = i_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-batch EQ l_c_no.
To directly view the print-preview in PDF format
CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
EXPORTING
i_otf = i_otfdata
EXCEPTIONS
convert_otf_to_pdf_error = 1
cntl_error = 2
OTHERS = 3.
For Sending the PDF file to a Mail ID.
LOOP AT i_lines.
TRANSLATE i_lines USING '~'.
CONCATENATE wa_buffer i_lines INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
i_record = wa_buffer.
APPEND i_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
DATA: BEGIN OF zlines OCCURS 0,
tline TYPE char255,
END OF zlines.
*Change the PDF format from 132 to 255.
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
transfer_bin = 'X'
TABLES
content_in = i_lines
content_out = zlines
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Attachment
REFRESH: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
i_objbin[] = zlines[].
Create Message Body Title and Description
i_objtxt = 'test with pdf-Attachment!'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 2.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Attachment (pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 2.
I_OBJPACK-DOC_TYPE = 'RAW'.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = p_mailid.
i_reclist-rec_type = 'U'.
APPEND i_reclist.
Send new document with attachments via RFC
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
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.
WRITE:/ 'Error When Sending the File', sy-subrc.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
ENDFORM. " display_datahi,
i wrote a programm.for me it is working.i think it will help for u.
DATA: t_otfdata TYPE ssfcrescl,
t_lines LIKE tline OCCURS 0 WITH HEADER LINE,
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
t_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
Objects to send mail.
DATA:T_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
T_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.
DATA: w_filesize TYPE i,
w_bin_filesize TYPE i,
wa_ctrlop TYPE ssfctrlop,
wa_outopt TYPE ssfcompop,
WA_BUFFER TYPE STRING, "To convert from 132 to 255
WA_OBJHEAD TYPE SOLI_TAB,
WA_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1.
DATA: form_name TYPE rs38l_fnam,
V_LINES_TXT TYPE I,
V_LINES_BIN TYPE I,
nast-spras type sy-langu value 'DE'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSR_DEMO1'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = form_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
wa_ctrlop-LANGU = nast-spras.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_outopt-tdnoprev = 'X'.
CALL FUNCTION form_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = wa_ctrlop
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = wa_outopt
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = t_otfdata
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
t_otf[] = t_otfdata-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = w_bin_filesize
BIN_FILE =
TABLES
OTF = t_otf
LINES = t_lines
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at t_lines.
TRANSLATE t_lines USING '~'.
CONCATENATE WA_BUFFER T_LINES INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING '~'.
DO.
t_RECORD = WA_BUFFER.
APPEND t_RECORD.
SHIFT WA_BUFFER LEFT BY 255 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH: T_RECLIST,
T_OBJTXT,
T_OBJBIN,
T_OBJPACK.
CLEAR WA_OBJHEAD.
T_OBJBIN[] = T_RECORD[].
Create Message Body Title and Description
T_OBJTXT = 'test with pdf-Attachment!'.
APPEND T_OBJTXT.
DESCRIBE TABLE T_OBJTXT LINES V_LINES_TXT.
READ TABLE T_OBJTXT INDEX V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = 'smartform'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
Main Text
CLEAR T_OBJPACK-TRANSF_BIN.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 0.
T_OBJPACK-BODY_START = 1.
T_OBJPACK-BODY_NUM = V_LINES_TXT.
T_OBJPACK-DOC_TYPE = 'RAW'.
APPEND T_OBJPACK.
Attachment (pdf-Attachment)
T_OBJPACK-TRANSF_BIN = 'X'.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 0.
T_OBJPACK-BODY_START = 1.
DESCRIBE TABLE T_OBJBIN LINES V_LINES_BIN.
READ TABLE T_OBJBIN INDEX V_LINES_BIN.
T_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
T_OBJPACK-BODY_NUM = V_LINES_BIN.
T_OBJPACK-DOC_TYPE = 'PDF'.
T_OBJPACK-OBJ_NAME = 'smart'.
T_OBJPACK-OBJ_DESCR = 'test'.
APPEND T_OBJPACK.
CLEAR T_RECLIST.
T_RECLIST-RECEIVER = 'mail id'.
T_RECLIST-REC_TYPE = 'U'.
APPEND T_RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = T_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = T_OBJBIN
CONTENTS_TXT = T_OBJTXT
RECEIVERS = T_RECLIST
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.
WRITE:/ 'Error When Sending the File', SY-SUBRC.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
please reward me if helpful. -
Need to send a an Outlook attachment with an Email
Hello everyone ,
I have a requirement in which I need to send an attachment in a mail as an Outlook attachment. I have used the following code and i am wondering what I would need to change so that the Outlook attachment works fine -
public static void sendMessageWithAttachments(EmailPoller emailPoller,String body,String toAddresses,String ccAddresses,String subject, BlobDomain associatedEmail)
throws MessagingException,Exception {
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
MimeMessage message = new MimeMessage(session);
// Fill in header of the email
message.setSubject(subject);
message.setContent(message, "text/plain");
if ((toAddresses != null) && (toAddresses.trim().length() > 0)) {
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(toAddresses));
if ((ccAddresses != null) && (ccAddresses.trim().length() > 0)) {
message.addRecipient(Message.RecipientType.CC,
new InternetAddress(ccAddresses));
// Create a multi-part to combine the Mime Body parts
Multipart multipart = new MimeMultipart();
// Create your new message part to set text inside email & add it to teh multipart
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setText(body);
multipart.addBodyPart(messageBodyPart);
// Create and fill MimeBodyPart for the attached content& add to multi part
messageBodyPart = new MimeBodyPart();
DataSource source = new ByteArrayDataSource(associatedEmail.toByteArray(),"text/plain");
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName("associatedEmail.txt");
multipart.addBodyPart(messageBodyPart);
// Associate the multi-part with message content
message.setContent(multipart,"text/html");
emailPoller.forwardMessage(message);//send email with attachments
}What I tried was to set the MIME-type for the datasource @
DataSource source = new ByteArrayDataSource(associatedEmail.toByteArray(),"text/plain");to application/vnd.ms-outlook but it does create an Outlook message as an atatchment but refuses to open it and shows an Error.
Anyone who know how to make it work please ?Thanks a lot ... worked perfectly fine.
DataSource source = new ByteArrayDataSource(<BlobHavingEmailDetails>.toByteArray(),"message/rfc822");
messageBodyPart.setDataHandler(new DataHandler(source));
//etc ... attach MimeBodyPart to MimeMultiPart to send the message with Body & attachment.Yes I wanted to attach another complete message to another one. -
How to send word file as attachment in an email
Hi All,
I have a scenario where the a word document is sent using a file adapter and mail adapter puts it as an attachment and sends it to designated email group.
Now the issue is the attachment that I am getting is text file, but i want it to be a word format file.
Pls advice..
XierHi,
Just give this a shot.
In the file adapter.
Set Additional File(s) .
and follow this document how to send additional file, rules and naming conventions and parameters.
http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
Itz simple.
<b>Cheers,
*RAJ*</b>
I -
Unable to send Word document as attachment to an email
I have recently installed Microsoft Office Standard on my new laptap which runs Windows 7 Professional. When i am in Word and trying to send the document as an email attachment, I received an error dialogue box with the message "Word couldn't send
email because of MAPI failure: "Unspecified error"." I clicked on the help button and have tried all the steps but no avail.
The work around is to open Outlook and create an email with an attachment. This works BUT I would like to be able to use Word as it was designed. Anyone have a similar issue and suggested correction?
Thanks!Here is a simple solution sure to work.
1. Start
2. Search for Winword
3. Right Click Winword and choose properties ( I instead would choose open file location just to know where the rest of windows programs can be found. Once there, right click Winword again and choose properties.
4. Click compatabilty tab
5. Check run as administrator at the bottom
6. Apply
7. Do the same for all Office programs If so desired (on the same file location where you found winword just look for Excel, Powerpoint, etc. and make sure the file you choose is an application type file)
Jic, it is not obligatory to apply the above solution for to all Office programs. You can do it just to the ones you want to send email from. If you only need Word to have this functionality just do it for Winword and thats it. -
Email bursting send report as HTML in email body
Hello,
I have Oracle BI Publisher 10.1.3.4.1 (build# 1101) version installed as part of Oracle Business Inteligence.
I have question about email bursting. I created simple report and I am bursting it via email. But I would like to send report in HTML as part of email body and not as attachment. I read that it is possible in other versions of BIP (as part of EBS) with using of bursting configuration file. But I can not use this file with my version of BIP, I can configure bursting only vie SQL query.
Is there any solution?
Thank youMy bursting SQL query:
SELECT DISTINCT
ip.APPL_ID KEY,
'11F_Search_Prospect_Email' TEMPLATE,
'RTF' template_format,
'en-US' locale,
'HTML' output_format,
'EMAIL' DEL_CHANNEL,
ip.email PARAMETER1,
'[email protected]' PARAMETER3,
'Welcome' PARAMETER4,
'true' PARAMETER6
FROM ugrad.inquiry_prospect ip,
ugrad.correspondence f,
ugrad.address e,
ugrad.f_lookup fl
WHERE ip.appl_id = f.appl_id
AND ip.APPL_ID = e.APPL_ID
AND fl.TYPE_CODE='C'
AND ip.record_stage = 'Prospect'
AND e.COUNTRY_CODE=fl.code
AND e.table_name = 'INQUIRY_PROSPECT'
AND e.address_type =
NVL ((SELECT gg.address_type
FROM ugradadm.address gg
WHERE gg.address_type =
DECODE (f.mailpref,
'Home', 'HOME',
'Best', 'LOCAL',
'HOME'
AND gg.table_name = 'INQUIRY_PROSPECT'
AND gg.APPL_ID = ip.appl_id
AND((gg.address_type='LOCAL' AND NVL(gg.address_expir_date,sysdate)>sysdate)
OR gg.address_type='HOME')),
'HOME'
AND f.batchid = :Batch_ID
This report when bursted sends an email with the layout template as html body.
The EMAIL configuration is set with a server Port number and its host address. -
How to send pdf or excel attachment as saved alv layout in email
Hi Guru,
I am developing a report in which, i am sending report as excel attachment after clicking a button on top of alv grid, and pdf attachment after clicking another button on top of alv grid. I am sending mail by two ways they are:
1) I am populating my internal table value in separate internal table and converting that to string and sending email as excel attachment.
2) And am converting report as spooljob, and using abapspool 2 pdf function module i am converting spool to pdf, after that am send that pdf as mail attachment.
Now my requirement is i need to send email attachment as layout which is displayed in the alv screen, even i hide a column and change the layout it is going with all the columns. What should i do for this problem.
Regards,
RithikaHi,
Check if the below steps will solve the problem.
* Get the run time ALV layout (field catalog) using the below method.
data: r_grid TYPE REF TO cl_gui_alv_grid.
CALL METHOD r_grid->get_frontend_fieldcatalog
IMPORTING
et_fieldcatalog = t_fcat.
* Adjust the download table according to t_fcat. -
Run and send report as email from forms10g
Hi,
we are generating a report from forms10g and sending it as an attachment in an email using RUN_REPORT_OBJECT and everyting is fine.
but we would like to use the parameter 'REPLYTO' in addition to FROM,CC,SUBJECT. i tried to use 'REPLYTO' but in the email i am not seeing the email address corresponding to the 'REPLYTO'
ADD_PARAMETER(thelist, 'REPLYTO',TEXT_PARAMETER, report_replyto_address);
can anyone guide me how to use this 'REPLYTO' parameter
Also is there anyways we can het a 'BODY' in the email, i think we do not have 'BODY' as the parameter
Thanks
VinodI don't know about Run_product.
U can achieve it by using rwrun command
eg. Client_host(rwrun...)
this proc. in Webutil package.
we can pass parameter like Desformat=PDF,Destype=MAIL
reply_to,cc,bcc,subject, from, desname, report output send as attachment to that mail.
Best Regards,
Avinash Deokar -
Send Report output as Email attachment (PDF)
Hi Experts,
i am trying to send the contents of an internal table from my report as email using PDF attachment. I have coded the logic and i get the attachment in the email. When i try to open the attachement, i cannot open it.
The message i get is "_Adobe reader could not open the attachment "attach.pdf" because it is either not a supported file type or the file has been damaged(for example, it was sent as an email attachment and wasn't correctly decoded )._
Not sure where i went wrong.
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[] = it_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. "send_file_as_email_attachmentHello RnB,
You can check the mentioned link for the same:
[Simple Program to generate PDF from ABAP List Output.|http://www.abapmadeeasy.com/2011/02/sap-abap-simple-program-to-generate-pdf.html]
Regards,
Uttam Agrawal -
Send report output via email as zipped attachment
Is it possible for the report output to be zipped before being attached to an email when running on a windows reports_server? On unix we theoretically have the ability to modify the mail.sh shell script that performs the mail operation for reports.
Hi Richard
This is a Reports 9i solution.
You may create a batch file that runs the report, compresses the file and invokes, say, a Java application that mails the given .zip file.
More "advanced" options would be:
You may create a pluggable destination that captures report output. Next, your code does the compresses the output file and mails it.
A simpler solution would be to run two reports. First, that creates the reports output file. In its AFTER_REPORT trigger, call Java method (thru. Java Importer), that picks up the output file and compresses it. Second, that uses XML distribution feature of Reports 9i and mails the .zip file as a file attachment using appropriate construct.
Regard
Sripathy -
Send report query as email attachment
Hi,
I have created a multireport query under Shared Components that allows users to print several sql queries to a pdf file in a prefefined format. Is it possible to generate an email out of Apex with this report query pdf as an attachment (without having the users save the pdf to their hard drive and and manually attach to an email)?
Thanks,
ForrestHello RnB,
You can check the mentioned link for the same:
[Simple Program to generate PDF from ABAP List Output.|http://www.abapmadeeasy.com/2011/02/sap-abap-simple-program-to-generate-pdf.html]
Regards,
Uttam Agrawal -
Exporting a crystal report as PDF and Attaching to an email via code - Filename Issuses?
Post Author: alynch
CA Forum: .NET
I need to export a crystal report as a pdf and send it out via email. I have created a subroutine that works but the attached filename come up as "untitled.txt" so the receiving machine believes it is a text file. If I rename it on the recipients machine to a ".pdf" I can open it with acrobat and it looks OK. Does anyone know how to rename the file as a pdf prior to sending it out?
Thank You.
al
I have included a copy of the subroutine:
Dim repdoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
Dim diskOpts As New CrystalDecisions.Shared.DiskFileDestinationOptions()
Dim ExpOpts As CrystalDecisions.Shared.ExportOptions
Dim MailOpts As New CrystalDecisions.Shared.MicrosoftMailDestinationOptions()
repdoc = Me.CrystalReport11
repdoc.Load("C:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects\WindowsApplication3\WindowsApplication3\CrystalReport1.rpt")
ExpOpts = repdoc.ExportOptions
With ExpOpts
.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.MicrosoftMail
.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
End With
With MailOpts
.MailMessage = "Message"
.MailToList = "enter email adress here"
.MailSubject = "Attached is a PDF file - .net Export test "
End With
ExpOpts.DestinationOptions = MailOpts
Try
repdoc.Export()
Catch err As Exception
MessageBox.Show(err.ToString())
End Try
End SubPost Author: Knight
CA Forum: .NET
I had this same problem today, here's what I used. Its built in 2 parts. Step one loops throught and exports PDF copies of a traking report. Step 2 builds an email list from a SQl query and sends it.STEP ONE:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'Declare the some variables Dim row1 As DataRow Dim brokerID As String Dim brokername As String Dim brokerEmail As String Dim shipdate As String Dim crParameterFieldDefinitions As ParameterFieldDefinitions Dim crParameterFieldDefinition As ParameterFieldDefinition Dim crParameterValues As New ParameterValues() Dim crParameterDiscreteValue As New ParameterDiscreteValue() Dim crParameterFieldDefinitions1 As ParameterFieldDefinitions Dim crParameterFieldDefinition1 As ParameterFieldDefinition Dim crParameterValues1 As New ParameterValues() Dim crParameterDiscreteValue1 As New ParameterDiscreteValue() Dim CrReport As New CrystalReport1() ' Report Name Dim report As ReportDocument = "O:KNIFormats_ReportPrivateSMStageShipmentInfo" Dim CrExportOptions As ExportOptions Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions() Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions() Dim SHIPDATE123 As String SHIPDATE123 = _month & "/" & _day & "/" & year Dim db As String db = System.Configuration.ConfigurationSettings.AppSettings("Datalogin") Dim sqlCon As New SqlConnection sqlCon.ConnectionString = db Dim strsql1 As String strsql1 = "SELECT tblSOOrd_Hdr.BrokerCd, tblSO_Ord_Hdr.BrokerName, tblSM_Ship_Hdr.ShipDate " strsql1 &= "FROM tblSO_Ord_Hdr INNER JOIN tblSM_Ship_Hdr ON tblSO_Ord_Hdr.Locale = tblSM_Ship_Hdr.Locale AND tblSO_Ord_Hdr.OrdNo = tblSM_Ship_Hdr.OrdNo AND " strsql1 &= " tblSO_Ord_Hdr.RlsNo = tblSM_Ship_Hdr.RlsNo INNER JOIN tblSys_Cust_Broker ON tblSO_Ord_Hdr.BrokerCd = tblSys_Cust_Broker.BrokerCd " strsql1 &= "GROUP BY tblSO_Ord_Hdr.BrokerCd, tblSM_Ship_Hdr.ShipDate, tblSO_Ord_Hdr.BrokerName " strsql1 &= "HAVING (tblSM_Ship_Hdr.ShipDate = '" & SHIPDATE123 & "') " Dim da1 As New SqlDataAdapter(strsql1, sqlCon) Dim worktbl1 As DataTable worktbl1 = New DataTable("tblEmail") da1.Fill(worktbl1) da1.FillSchema(worktbl1, SchemaType.Source) If worktbl1.Rows.Count > 0 Then For Each row1 In worktbl1.Rows brokerID = CStr(row1("BrokerCd")).Trim brokername = CStr(row1("BrokerName")).Trim shipdate = CStr(row1("ShipDate")).Trim CrReport.Load() crParameterDiscreteValue.Value = shipdate crParameterFieldDefinitions = CrReport.DataDefinition.ParameterFields crParameterFieldDefinition = crParameterFieldDefinitions.Item("ShipDate") crParameterValues = crParameterFieldDefinition.CurrentValues crParameterValues.Clear() crParameterValues.Add(crParameterDiscreteValue) crParameterFieldDefinition.ApplyCurrentValues(crParameterValues) crParameterDiscreteValue1.Value = brokerID crParameterFieldDefinitions1 = CrReport.DataDefinition.ParameterFields crParameterFieldDefinition1 = crParameterFieldDefinitions1.Item("Broker") crParameterValues1 = crParameterFieldDefinition1.CurrentValues crParameterValues1.Clear() crParameterValues1.Add(crParameterDiscreteValue1) crParameterFieldDefinition1.ApplyCurrentValues(crParameterValues1) CrDiskFileDestinationOptions.DiskFileName = "c:Test_Folder20" & _year & "-" & _month & "-" & day & "" & brokername & ".pdf" CrFormatTypeOptions.FirstPageNumber = 1 ' Start Page in the Report CrFormatTypeOptions.LastPageNumber = 1000 ' End Page in the Report CrFormatTypeOptions.UsePageRange = True CrExportOptions = CrReport.ExportOptions With CrExportOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.PortableDocFormat .DestinationOptions = CrDiskFileDestinationOptions .FormatOptions = CrFormatTypeOptions End With Try CrReport.Export() Catch err As Exception MessageBox.Show("DID NOT EXPORT") End Try Next MessageBox.Show("All PDF's exported succesfully") End If End SubSTEP 2: Private Sub Button3Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim row2 As DataRow Dim SHIPDATE123 As String SHIPDATE123 = _month & "/" & _day & "/" & year Dim db1 As String db1 = System.Configuration.ConfigurationSettings.AppSettings("Datalogin") Dim sqlCon As New SqlConnection sqlCon.ConnectionString = db1 Dim strsql2 As String strsql2 = "SELECT tblSOOrd_Hdr.BrokerCd, tblSys_Cust_Broker.BrokerName, tblSM_Ship_Hdr.ShipDate, tblSys_Cust_Broker.ContactEmail " strsql2 &= "FROM tblSO_Ord_Hdr INNER JOIN tblSM_Ship_Hdr ON tblSO_Ord_Hdr.Locale = tblSM_Ship_Hdr.Locale AND tblSO_Ord_Hdr.OrdNo = tblSM_Ship_Hdr.OrdNo AND " strsql2 &= " tblSO_Ord_Hdr.RlsNo = tblSM_Ship_Hdr.RlsNo INNER JOIN tblSys_Cust_Broker ON tblSO_Ord_Hdr.BrokerCd = tblSys_Cust_Broker.BrokerCd " strsql2 &= "GROUP BY tblSO_Ord_Hdr.BrokerCd, tblSM_Ship_Hdr.ShipDate, tblSys_Cust_Broker.ContactEmail, tblSys_Cust_Broker.BrokerName, tblSys_Cust_Broker.Email_ASN " strsql2 &= "HAVING (tblSM_Ship_Hdr.ShipDate = '" & SHIPDATE123 & "') AND (tblSys_Cust_Broker.Email_ASN = 1) AND (tblSys_Cust_Broker.ContactEmail <> '') " Dim da1 As New SqlDataAdapter(strsql2, sqlCon) Dim worktbl2 As DataTable worktbl2 = New DataTable("tblEmail12") da1.Fill(worktbl2) da1.FillSchema(worktbl2, SchemaType.Source) Dim brokerID As String Dim brokername As String Dim brokerEmail As String Dim shipdate As String If worktbl2.Rows.Count > 0 Then For Each row2 In worktbl2.Rows brokerID = CStr(row2("BrokerCd")).Trim brokername = CStr(row2("BrokerName")).Trim brokerEmail = CStr(row2("ContactEmail")).Trim shipdate = CStr(row2("ShipDate")).Trim Dim mail As New MailMessage Dim att As String att = "c:Test_Folder20" & _year & "-" & _month & "-" & _day & "" & brokername & ".pdf" 'set the addresses mail.From = New MailAddress("[email protected]") mail.To.Add(brokerEmail) mail.Attachments.Add(New Attachment(att)) 'set the content mail.Subject = "Shipment Tracking report from Knox Nursery for " & SHIPDATE123 mail.IsBodyHtml = True mail.Body = "
" mail.Body &= "This shipment update has been requested by:
" 'send the message Dim smtp As New SmtpClient smtp.Send(mail) ' MessageBox.Show("No Records Found", "Failed to send", MessageBoxButtons.OK, MessageBoxIcon.Stop Next Else MessageBox.Show("No broker have opted in", "No Emails Sent", MessageBoxButtons.OK, MessageBoxIcon.Information) End If MessageBox.Show("Emails sent... ", "Emails Sent", MessageBoxButtons.OK, MessageBoxIcon.Information) End Sub -
How to send ALV list report as html attachment in a mail??
Hi all,
I have an ALV report which I want to send as an HTML attachment in a mail to an external id. I know that spool can be converted to HTML attachment in a mail. But I don't want to have 2 programs - one for generating ALV and the other to send mail with the spool-converted of the first report as attachment. I want to send the mail in the same program itself. Is it possible? Helpful answers will be suitably rewarded.Hi Sandip,
In your ALV program after the alv output is build in the program do the following steps.
1). Export the list to memory
2). Import the list from mempry
3). Do a COmpress of the data
4). Send an email as an attachment using the normal FM.
Take a look at the following links which will explain how to do the above steps.
http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
remember to change the doc type as 'HTM' in the FM to send email.
Cheers
VJ
Maybe you are looking for
-
I would like to install the Oracle 11 client on OpenSuse 12-64, but when I try, the installer shows me a list of about 20 kernel parameters and packages that are incorrect. The packages required by the Oracle client are all older versions than the on
-
Without MRP, with BOM explosion
Hi, I'm new to SAP and learning SAP SCM. I would like someone to brief me on what the following lines imply, especially 'without MRP, with BOM explosion'. "dependent requirements must be determined for materials that are planned in SAP ECC. So, you a
-
Problems installing HT5371 OS X Mountain Lion: Supported digital camera RAW formats
I've downloaded the above file, but when I try to install it I get a message saying that Aperture version 3.4 or later, or iPhoto version 9.4 or later, is required to install this update. I have iPhoto 11 9.4.2 installed, but not Aperature. Has an
-
My Ipad3 is very slow after installing 8.02 and needs a hard reset every 2 minutes.
Hello Community, I had a wonderful running Ipad3 32gb running on IOS7, now after installing IOS8.02 this device is slow (e.g. Safari) and needs a restart (hard reset) every to minutes because it freezed up. I´m quite unhappy. I tried to stop processe
-
I have 2 mobileme accounts synced up on my iPhone 3G running 3.0 1 is set as the default account and has everything synced (mail, contacts, calender) the other 1 has only mail synced. When I try to publish a picture to a mobileme gallery it is trying