Report 3.0 & e-mail
Iam working with FORMS 5.0 and REPORT 3.0.
When i intend to send an inform from the preview to the e-mail, i obtain then following error message :
REP-4201 and REP-4220
I have OUTLOOK EXPRESS 5 and INTERNET EXPLORER 5 installed.
How may i send e.mails from then preview of report 3.0 ?
Best regards and thanks.
null
Hi,
You can send the report to mail.
This is done by directing the email output to
be directly sent via email without previewing
it in the Report Previewer,
This is achived by setting the following parameters:
DESTYPE: MAIL
DESFORMAT: PDF or HTML
DESNAME: Name of the email id
The result will be an email message with the
output attached as the target format.
Similar Messages
-
Converting report to PDF and mailing
Hi every one,
I've gone through various threads and i'm aware of the Functional module's used to
convert the report to pdf and mail it back.Like CONVERT_OTFSPOOLJOB_2_PDF, CONVERT_OTF_2_PDF and for mailing we have SEND_NEW_DOCUMENT_ATT_SEND_API1.
I've worked with this but my problem is i'm not able to convet the report output to pdf.When i'm doing this i'm getting the output of my functional module converted to pdf like the number of header and item records available for the given data in the selection screen.
Since all the threads i've gone through is converting the single internal table which has the output to pdf.
But i've got the REUSE_ALV_HIERSQL_LIST_DISPLAY, hierarchial report which as known has got two internal tables.How to the same to this kind of report....More over is it possible to convert report to pdf in online without transfering it to spool and getting the spool id to convert it to pdf.........
Any help or suggestions will surely be rewarded......
Thanks in Advance.....Here is the complete code for you;
It Converts spool request into PDF document and emails it.
<b>http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm</b>
Regards,
Vishal -
Sending report output via E-mail (excel pivoted format)
Hi all,
i have a written a report where i need to send the report output to somebody via
E-mail.i am sending this report output via E-mail successfully.The receiver receives, my output in excel format.but this excel is not <b>pivoted</b>.
i want , the receiver should get my output in pivoted excel format.i.e my output data should be exactly fit in the excel sheet.
now the columns in excel sheet are overlapping.once i double clicked, the columns are getting separated.i do not want to double click.i want all the columns should come properly i.e excel field length should be adjusted as per the output field length.
i am giving my coding below.plz suggest how i can do the above thing .it's urgent.
any idea will be highly appreaciated.
Regards
if not p_email1 is initial.
perform fill_report_csv.
perform f_send_internet_mail.
endif.
FORM fill_report_csv.
data : l_text(232) type c,
v_matnr1(21) type c,
v_matnr(21) type c,
v_matkl(14) type c,
v_maktx(45) type c,
v_ttlstk(14) type c,
v_verpr(14) type c,
v_werks(14) type c,
v_lgort(14) type c,
v_char(10) type c,
v_stks type p ,
v_po(40) type c,
v_qty(13) type c,
v_qty1 type sy-datum,
v_date(15) type c,
v_date1(15) TYPE C,
v_name(35) type c,
v_eknam(18) type c,
v_lifnr(15) type c,
l_po(40) type c,
v_matnr(20) type c,
l_rate(11) type p decimals 5,
l_flag type c.
concatenate c_equal c_colon 'PO no.' c_colon
into v_po.
concatenate c_equal c_colon 'Material no.' c_colon
into v_matnr.
concatenate c_equal c_colon 'Description.' c_colon
into v_maktx.
concatenate c_equal c_colon 'Due Qty.' c_colon
into v_qty.
concatenate c_equal c_colon 'Del Date.' c_colon
into v_date.
concatenate c_equal c_colon 'Vendor.' c_colon
into v_name.
concatenate c_equal c_colon 'Buyer.' c_colon
into v_eknam.
concatenate c_equal c_colon 'Vendor Code.' c_colon
into v_lifnr.
concatenate
v_po v_matnr v_maktx v_qty
v_date v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
append i_download .
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
clear wa_output.
loop at i_output into wa_output.
on change of wa_output-ebeln.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
**-- Checking of page break
v_lines = sy-linno + v_lines .
if 55 < v_lines .
write:/0(161) sy-uline.
new-page.
endif.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
*-- Calculating the due qty.
wa_output-dumng = wa_output-menge - wa_output-wemng.
*-- Writing the Line items of the PO.
read table i_ekpo into wa_ekpo
with key ebeln = wa_output-ebeln
ebelp = wa_output-ebelp.
l_rate = wa_ekpo-netpr / wa_ekpo-peinh.
*-- Writing of PO detail
if wa_output-dumng gt 0 .
v_qty = wa_output-dumng.
v_date1 = wa_output-eindt.
v_maktx = wa_output-maktx.
if wa_output-maktx+0(1) = '"' .
concatenate c_equal wa_output-maktx
into v_maktx .
else .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
endif .
if wa_output-name1+0(1) = '"' .
concatenate c_equal wa_output-name1
into v_name .
else .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
endif .
v_name = wa_output-name1.
v_lifnr = wa_output-lifnr.
write wa_output-eindt to v_date1 DD/MM/YYYY.
concatenate '="' wa_output-ebeln '/'
wa_output-ebelp '"' into v_po .
concatenate '="' wa_output-matnr '"' into v_matnr .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
concatenate c_equal c_colon wa_output-dumng c_colon
into v_qty1 .
concatenate c_equal c_colon wa_output-eindt c_colon
into v_date1 .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
concatenate c_equal c_colon wa_output-eknam c_colon
into v_eknam .
concatenate c_equal c_colon wa_output-lifnr c_colon
into v_lifnr .
concatenate c_equal c_colon wa_mard-werks '/'
wa_mard-lgort c_colon
into v_lgort .
concatenate '="' wa_output-lifnr '"' into v_lifnr .
condense:v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
concatenate
v_po v_matnr v_maktx v_qty
v_date1 v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
concatenate con_cret i_download INTO i_download .
append i_download .
endif.
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
endloop.
ENDFORM. " fill_report_csv
*& Form f_send_internet_mail
text
--> p1 text
<-- p2 text
FORM f_send_internet_mail.
Variables
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
data : found_receiver type c,
v_title(80) type c,
l_text(180) type c.
Fill the document data.
gd_doc_data-doc_size = 1.
Adds text to email text table
append 'Pls see attached open purchase order report.' to it_message.
append '' to it_message.
concatenate 'Note: This is system generated report'
', figures may subject to actual physical count.'
into l_text separated by space.
append l_text to it_message.
Populate the subject/generic message attributes
CLEAR gd_doc_data.
READ TABLE i_download INDEX w_cnt.
gd_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( i_download ).
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
if p_asdate is initial .
concatenate p_title ' '
sy-datum sy-uzeit into v_title separated by space.
else .
concatenate p_title ' '
p_bldat p_cputm into v_title separated by space.
endif .
gd_doc_data-obj_descr = v_title .
gd_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = i_download[].
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Create attachment notification
it_packing_list-transf_bin = 'X'.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = 'XLS'.
it_packing_list-obj_descr = 'OPEN PURCHASE ORDER' .
it_packing_list-obj_name = 'PO.XLS' .
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
assign SAP user smtp address from successful retrieval.
loop at p_email.
Add the recipients email address
found_receiver = 'X' .
it_receivers-receiver = p_email-low.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers .
endloop .
Add default recipient email when unable to locate purc group email
if found_receiver is initial .
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers.
endif .
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = it_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.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
Instructs mail send program for SAPCONNECT to send email.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = ' '
and return.
endif.
ENDFORM. " f_send_internet_mailHi,
go through this link,
http://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
you have some sample programs.
Regards,
Raghavendra -
Hi all,
i have a written a report where i need to send the report output to somebody via
E-mail.i am sending this report output via E-mail successfully.The receiver receives, my output in excel format.but this excel is not <b>pivoted</b>.
i want , the receiver should get my output in pivoted excel format.i.e my output data should be exactly fit in the excel sheet.
now the columns in excel sheet are overlapping.once i double clicked, the columns are getting separated.i do not want to double click.i want all the columns should come properly i.e excel field length should be adjusted as per the output field length.
i am giving my coding below.plz suggest how i can do the above thing .it's urgent.
any idea will be highly appreaciated.
Regards
if not p_email1 is initial.
perform fill_report_csv.
perform f_send_internet_mail.
endif.
FORM fill_report_csv.
data : l_text(232) type c,
v_matnr1(21) type c,
v_matnr(21) type c,
v_matkl(14) type c,
v_maktx(45) type c,
v_ttlstk(14) type c,
v_verpr(14) type c,
v_werks(14) type c,
v_lgort(14) type c,
v_char(10) type c,
v_stks type p ,
v_po(40) type c,
v_qty(13) type c,
v_qty1 type sy-datum,
v_date(15) type c,
v_date1(15) TYPE C,
v_name(35) type c,
v_eknam(18) type c,
v_lifnr(15) type c,
l_po(40) type c,
v_matnr(20) type c,
l_rate(11) type p decimals 5,
l_flag type c.
concatenate c_equal c_colon 'PO no.' c_colon
into v_po.
concatenate c_equal c_colon 'Material no.' c_colon
into v_matnr.
concatenate c_equal c_colon 'Description.' c_colon
into v_maktx.
concatenate c_equal c_colon 'Due Qty.' c_colon
into v_qty.
concatenate c_equal c_colon 'Del Date.' c_colon
into v_date.
concatenate c_equal c_colon 'Vendor.' c_colon
into v_name.
concatenate c_equal c_colon 'Buyer.' c_colon
into v_eknam.
concatenate c_equal c_colon 'Vendor Code.' c_colon
into v_lifnr.
concatenate
v_po v_matnr v_maktx v_qty
v_date v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
append i_download .
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
clear wa_output.
loop at i_output into wa_output.
on change of wa_output-ebeln.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
**-- Checking of page break
v_lines = sy-linno + v_lines .
if 55 < v_lines .
write:/0(161) sy-uline.
new-page.
endif.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
*-- Calculating the due qty.
wa_output-dumng = wa_output-menge - wa_output-wemng.
*-- Writing the Line items of the PO.
read table i_ekpo into wa_ekpo
with key ebeln = wa_output-ebeln
ebelp = wa_output-ebelp.
l_rate = wa_ekpo-netpr / wa_ekpo-peinh.
*-- Writing of PO detail
if wa_output-dumng gt 0 .
v_qty = wa_output-dumng.
v_date1 = wa_output-eindt.
v_maktx = wa_output-maktx.
if wa_output-maktx+0(1) = '"' .
concatenate c_equal wa_output-maktx
into v_maktx .
else .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
endif .
if wa_output-name1+0(1) = '"' .
concatenate c_equal wa_output-name1
into v_name .
else .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
endif .
v_name = wa_output-name1.
v_lifnr = wa_output-lifnr.
write wa_output-eindt to v_date1 DD/MM/YYYY.
concatenate '="' wa_output-ebeln '/'
wa_output-ebelp '"' into v_po .
concatenate '="' wa_output-matnr '"' into v_matnr .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
concatenate c_equal c_colon wa_output-dumng c_colon
into v_qty1 .
concatenate c_equal c_colon wa_output-eindt c_colon
into v_date1 .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
concatenate c_equal c_colon wa_output-eknam c_colon
into v_eknam .
concatenate c_equal c_colon wa_output-lifnr c_colon
into v_lifnr .
concatenate c_equal c_colon wa_mard-werks '/'
wa_mard-lgort c_colon
into v_lgort .
concatenate '="' wa_output-lifnr '"' into v_lifnr .
condense:v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
concatenate
v_po v_matnr v_maktx v_qty
v_date1 v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
concatenate con_cret i_download INTO i_download .
append i_download .
endif.
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
endloop.
ENDFORM. " fill_report_csv
*& Form f_send_internet_mail
text
--> p1 text
<-- p2 text
FORM f_send_internet_mail.
Variables
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
data : found_receiver type c,
v_title(80) type c,
l_text(180) type c.
Fill the document data.
gd_doc_data-doc_size = 1.
Adds text to email text table
append 'Pls see attached open purchase order report.' to it_message.
append '' to it_message.
concatenate 'Note: This is system generated report'
', figures may subject to actual physical count.'
into l_text separated by space.
append l_text to it_message.
Populate the subject/generic message attributes
CLEAR gd_doc_data.
READ TABLE i_download INDEX w_cnt.
gd_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( i_download ).
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
if p_asdate is initial .
concatenate p_title ' '
sy-datum sy-uzeit into v_title separated by space.
else .
concatenate p_title ' '
p_bldat p_cputm into v_title separated by space.
endif .
gd_doc_data-obj_descr = v_title .
gd_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = i_download[].
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Create attachment notification
it_packing_list-transf_bin = 'X'.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = 'XLS'.
it_packing_list-obj_descr = 'OPEN PURCHASE ORDER' .
it_packing_list-obj_name = 'PO.XLS' .
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
assign SAP user smtp address from successful retrieval.
loop at p_email.
Add the recipients email address
found_receiver = 'X' .
it_receivers-receiver = p_email-low.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers .
endloop .
Add default recipient email when unable to locate purc group email
if found_receiver is initial .
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers.
endif .
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = it_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.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
Instructs mail send program for SAPCONNECT to send email.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = ' '
and return.
endif.
ENDFORM. " f_send_internet_mailans
-
Report adres in a mail distrubuted report
Hello,
I know how i can send an e mail to several people. I add a link to the report in the e-mail boddy.
I would like a link to another server adres then it will be by default. Is there anybody who know where I can set the adress to the report (in the link bellow the e-mail)
for example:
now it is: 'http:\\hakw1..........
I would like change it to 'https:\\Hakwood.....
thanks for helpHi Robert,
Based on my understanding, you want to change report manager URL
http://xxx to https://xxx, right?
In Reporting Services, we can create URL reservation like
https://xxx. Then we can select it to require that all requests to Report Manager are routed over HTTPS. Optionally, if we select an SSL certificate, we can specify a custom port. The default is 443 but we can use any port that is available.
As we tested in our environment, we create a self-signed certificate(test) in IIS manager. When creating the report manager URL, we can select the self-signed certificate in RSCM. And we specify the SSL port as 443. Through this URL, we can access the report
manager successfully, and URL always displays as https://xxx when we access any folder/report in report manager.
For more information, please refer to this article:
A step-by-step example of configuring a reporting services point for HTTPS in System Center 2012 Configuration Manager.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu -
Send Report to several e-mail addresses problem!
Hi,
I want to deliver a report to several e-mail addresses because every page is personalized and has to be delivered to a special e-mail address.What can i do?
Please help!
Thanks in advance.
nullhello,
this functionality is available in reports 9i which will be part of 9iAS Release 2.
regards,
the oracle reports team -
Report output send through mail
Dear friends,
Looking for sample report to send the report output through external mail on execution.
Regards,
Praveen Lobo*& Report ZKB_EMAIL
REPORT zkb_email NO STANDARD PAGE HEADING LINE-SIZE 200.
TABLES: ekko.
PARAMETERS: p_email TYPE somlreci1-receiver
DEFAULT '<b>WRITE EMAIL ID EG [email protected]'</b>.
Output Table
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.
Mail Parameters
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.
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR' INTO it_attach SEPARATED BY space.
CONCATENATE space it_attach INTO it_attach.
APPEND it_attach.
LOOP AT it_ekpo INTO wa_charekpo.
CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
wa_charekpo-aedat wa_charekpo-matnr
INTO it_attach SEPARATED BY space .
CONCATENATE space 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'.
w_doc_data-skip_scren = 'X'.
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'.
APPEND t_receivers.
CLEAR t_receivers.
t_receivers-receiver = sy-uname. " replace with <login name>
t_receivers-rec_type = 'B'.
t_receivers-express = 'X'.
APPEND t_receivers.
CLEAR 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_ATTACHMENT
*& 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
Rewards if useful.............
Minal -
Sendin Spool reports to an e-mail address.
Just wondering how one would go about developing a process to look for a specific spool report and send it to a specific e-mail address. I would place the reports and associated e-mail address in a Z table to be maintained by a user group. I have no clue on how to read the spool and collect a specific report to be sent via e-mail. Any help or suggestions would be greatly appreciated.
Thanks,
ScottHere is some sample code. This program takes the spool from a previous job step. It converts this spool to PDF and then inserts this PDF as an attachment in an E-mail.
* Program Name: KEG Job Sched Run with PDF Output Creation: 03/22/2001
* SAP Name : ZESU_JOB_RUN_WITH_PDF_OUTPUT Application: U *
* Author : Thomas Jung Type: 1 *
* Description : This Program will read the spool produced
* by the specified previous job step and converts it to
* PDF. This PDF-Formatted report is then output to a file. *
* Inputs: File name, job step *
* Outputs: File formatted in PDF with the report output. *
* External Routines
* FILE_GET_NAME
* CONVERT_ABAPSPOOLJOB_2_PDF
* CONVERT_OTFSPOOLJOB_2_PDF
* Z_E_OPEN_FILE_FOR_OUTPUT_BIN
* Z_E_WRITE_TO_FILE_WITH_LENGTH
* SO_NEW_DOCUMENT_ATT_SEND_API1
* BAPI_USER_GET_DETAIL
* Return Codes:
* The program uses the standard function modules for File manipulation
* therefore it has all the standard error routines for Files. *
* Ammendments: *
* Programmer Date Req. # Action *
* ================ ========== ====== ===============================*
* Thomas Jung 03/27/2001 ------ Initial Program. *
report zesu_job_run_with_pdf_output message-id zes_job.
* DATA DICTIONARY TABLES *
tables: raldb. "Transfer Structure for Logical Databases
tables: tbtcp.
tables: icon, "Icons table
bapiadsmtp, "BAPI structure for e-mail addresses (central
bapiadpag.
* TYPE POOLS *
type-pools: sbdst.
* CONSTANTS *
constants: logical_file_name like filename-fileintern
value 'ZEX_STANDARD_FILENAME',
pdf_ext(4) type c
value '.pdf',
pdf_type(3) type c
value 'PDF',
internet(1) type c
value 'U',
dist_list(1) type c
value 'C',
kimball_domain(12) type c value '@kimball.com'.
constants: kim_ftp(80) type c
value
'ftp://kww.kog.kimball.com/webtools/acrobat_reader/acroread40w95.exe'.
constants: ext_ftp(80) type c
value
'http://www.adobe.com/products/acrobat/readermain.html'.
* VARIABLES *
data: length type i.
data: f4_field like trdir-name.
data: pathleng type i,
nameleng type i,
physleng type i.
data jselect like btcselect.
data: report like sy-repid.
data: doc_chng like sodocchgi1.
data: tab_lines like sy-tabix.
* INTERNAL TABLES *
data: begin of html_tab occurs 0.
include structure w3html.
data: end of html_tab.
data: icontab(32) occurs 10 with header line.
data: itab like abaplist occurs 0 with header line.
data: ipdf like tline occurs 0 with header line.
data: objpack like sopcklsti1 occurs 2 with header line.
data: objhead like solisti1 occurs 1 with header line.
data: objbin like solisti1 occurs 10 with header line.
data: objtxt like solisti1 occurs 10 with header line.
data: reclist like somlreci1 occurs 5 with header line.
* SELECTION SCREEN LAYOUT *
selection-screen begin of block one with frame title text-001.
parameters: fileintn like filename-fileintern obligatory
default logical_file_name,
filepath like rlgrap-filename lower case.
parameters: file1 like rlgrap-filename obligatory lower case,
physname like rlgrap-filename lower case.
parameters: date1 as checkbox.
parameters: time1 as checkbox.
selection-screen end of block one.
selection-screen begin of block two with frame title text-002.
parameter: step like tbtcp-stepcount.
parameter: abap radiobutton group one.
parameter: oft radiobutton group one.
selection-screen end of block two.
selection-screen begin of block three with frame title text-003.
parameter: file radiobutton group two.
parameter: email radiobutton group two.
selection-screen skip 1.
parameter: int radiobutton group thre.
parameter: dis radiobutton group thre.
selection-screen skip 1.
parameter: ext_user like somlreci1-receiver.
selection-screen end of block three.
* SELECTION SCREEN PROCESSING - OUTPUT *
at selection-screen output.
perform filename_processing.
loop at screen.
if screen-name eq 'FILEPATH' or
screen-name eq 'PHYSNAME'.
screen-input = 0.
modify screen.
endif.
endloop.
* START OF SELECTION *
start-of-selection.
move sy-repid to report.
perform auth_check.
perform filename_processing.
perform get_spool.
perform convert_list_to_pdf.
if file = 'X'.
perform write_to_file.
else.
perform send_pdf_in_email.
endif.
*& Form filename_processing
* Prepair to conver to the logical file name to a physical name
* --> p1 text
* <-- p2 text
form filename_processing.
perform get_filename using fileintn file1 physname.
nameleng = strlen( file1 ).
physleng = strlen( physname ).
pathleng = physleng - nameleng.
if pathleng > 0.
filepath = physname(pathleng).
endif.
endform. " filename_processing
*& Form get_filename
* Convert the logical file name into a physical file name
* -->P_FILEINTN Input Logical File Name
* -->P_FILE1 Filename selected by input
* -->P_PHYSNAME Output Physical File Name
form get_filename using p_fileintn
p_file1
p_physname.
data: p_file2 like rlgrap-filename.
clear p_file2.
move p_file1 to p_file2.
if date1 = 'X'.
concatenate p_file2
sy-datum
into p_file2.
endif.
if time1 = 'X'.
concatenate p_file2
sy-uzeit
into p_file2.
endif.
concatenate p_file2
pdf_ext
into p_file2.
call function 'FILE_GET_NAME'
exporting
client = sy-mandt
logical_filename = p_fileintn
operating_system = sy-opsys
parameter_1 = p_file2
* PARAMETER_2 = ' '
* PARAMETER_3 = ' '
* USE_PRESENTATION_SERVER = ' '
* WITH_FILE_EXTENSION = ' '
* USE_BUFFER = ' '
importing
* EMERGENCY_FLAG =
* FILE_FORMAT =
file_name = p_physname
exceptions
file_not_found = 1
others = 2
if sy-subrc <> 0.
message e001(zes_general) with sy-subrc.
endif.
endform. " get_filename
*& Form write_to_file
* TRANSFER PDF DATA TO OUTPUT FILE
* --> p1 text
* <-- p2 text
form write_to_file.
data: string_out type string.
describe field objbin length length.
call function 'Z_E_OPEN_FILE_FOR_OUTPUT_BIN'
exporting
filename1 = physname.
loop at objbin.
clear string_out.
move objbin to string_out.
call function 'Z_E_WRITE_TO_FILE_WITH_LENGTH'
exporting
filename1 = physname
length = length
please_open_file = 'NO'
string = string_out.
endloop.
endform. " write_to_file
*& Form convert_list_to_pdf
* Convert to Spool to PDF
* --> p1 text
* <-- p2 text
form convert_list_to_pdf.
data: spool_id like tsp01-rqident.
move tbtcp-listident to spool_id.
****Is this ABAP List Processing?
if abap = 'X'.
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = spool_id
* NO_DIALOG =
* DST_DEVICE =
* PDF_DESTINATION =
* IMPORTING
* PDF_BYTECOUNT =
* PDF_SPOOLID =
* LIST_PAGECOUNT =
* BTC_JOBNAME =
* BTC_JOBCOUNT =
tables
pdf = ipdf
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
others = 12.
if sy-subrc <> 0.
message i016 with sy-subrc.
endif.
else.
****Or is this SAPscript?
call function 'CONVERT_OTFSPOOLJOB_2_PDF'
exporting
src_spoolid = spool_id
* NO_DIALOG =
* DST_DEVICE =
* PDF_DESTINATION =
* IMPORTING
* PDF_BYTECOUNT =
* PDF_SPOOLID =
* OTF_PAGECOUNT =
* BTC_JOBNAME =
* BTC_JOBCOUNT =
tables
pdf = ipdf
exceptions
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
others = 12.
if sy-subrc <> 0.
message i016 with sy-subrc.
endif.
endif.
perform convert_pdf tables ipdf
objbin.
endform. " convert_list_to_pdf
*& Form get_spool
* Read the job log to get the spool number for the specified step
* --> p1 text
* <-- p2 text
form get_spool.
clear jselect.
*jselect-jobname = '*'.
jselect-username = '*'.
****Have this program get its own Job Name
call function 'GET_JOB_RUNTIME_INFO'
importing
* EVENTID =
* EVENTPARM =
* EXTERNAL_PROGRAM_ACTIVE =
jobcount = jselect-jobcount
jobname = jselect-jobname
* STEPCOUNT =
exceptions
no_runtime_info = 1
others = 2.
****Read the spool number for this job step.
clear tbtcp.
select single listident from tbtcp
into tbtcp-listident
where jobname = jselect-jobname
and jobcount = jselect-jobcount
and stepcount = step.
if tbtcp-listident = 0.
message i009 with step.
endif.
endform. " get_spool
*& Form convert_pdf
* Take the PDF information returned by the function module
* and convert it to a file readable format. It currently is
* in a printable-only format.
* -->P_IPDF PDF Source
* -->P_OBJBIN PDF Destination
form convert_pdf tables t_source_tab structure ipdf
t_target_tab structure objbin.
data: l_hfeld(1600) type c,
l_offset type p,
l_tabix like sy-tabix,
l_max type i,
l_linecount_source type i,
l_length_source type i,
l_length_target type i.
* Zeilenlänge des Quell-PDF-Files
describe field t_source_tab length l_length_source.
* Zeilenlänge der Ziel-Mime-Tabelle
describe field t_target_tab length l_length_target.
* Zeilenanzahl des Quell-PDF-Files
describe table t_source_tab lines l_linecount_source.
* Die maximale Zielgröße wird durch das Feld l_hfeld begrenzt.
l_max = l_length_target + l_length_source.
* IF L_MAX > 1600.
* RAISE CONVERT_NOT_POSSIBLE.
* ENDIF.
refresh t_target_tab.
loop at t_source_tab.
l_tabix = sy-tabix.
move t_source_tab to l_hfeld+l_offset.
* falls letzte zeile der quelltabelle erreicht
if l_tabix = l_linecount_source.
l_length_source = strlen( t_source_tab ).
endif.
l_offset = l_offset + l_length_source.
while l_offset ge l_length_target.
clear t_target_tab.
t_target_tab = l_hfeld(l_length_target).
append t_target_tab.
shift l_hfeld by l_length_target places.
l_offset = l_offset - l_length_target.
endwhile. " l_offset ge p_length_target
* falls letzte zeile der quelltabelle erreicht
if l_tabix = l_linecount_source.
if l_offset gt 0.
clear t_target_tab.
t_target_tab = l_hfeld(l_offset).
append t_target_tab.
endif. " l_offset gt 0
endif. " l_tabix = l_linecount_lines
endloop. " p_source_tab
endform. " convert_pdf
*& Form auth_check
* Perform Authorization Check
* --> p1 text
* <-- p2 text
form auth_check.
authority-check object 'Z_ABAP_CHK'
id 'BUKRS' dummy
id 'ACTVT' dummy
id 'WERKS' dummy
id 'REPID' field report.
if sy-subrc ne 0.
message e024.
endif.
endform. " auth_check
*& Form send_pdf_in_email
* Transfer the PDF file in an E-Mail
* --> p1 text
* <-- p2 text
form send_pdf_in_email.
data: iaddsmtp type bapiadsmtp occurs 0 with header line.
data: ireturn type bapiret2 occurs 0 with header line.
concatenate text-010 jselect-jobname text-011
into doc_chng-obj_descr
separated by space.
clear objtxt.
objtxt = text-012.
append objtxt.
clear objtxt.
objtxt = text-013.
append objtxt.
clear objtxt.
concatenate text-014 jselect-jobname
into objtxt
separated by space.
append objtxt.
clear objtxt.
objtxt = text-015.
append objtxt.
clear objtxt.
objtxt = text-016.
append objtxt.
clear objtxt.
append objtxt.
clear objtxt.
concatenate text-017 kim_ftp
into objtxt
separated by space.
append objtxt.
clear objtxt.
concatenate text-018 ext_ftp
into objtxt
separated by space.
append objtxt.
describe table objtxt lines tab_lines.
read table objtxt index tab_lines.
doc_chng-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.
describe table objbin lines tab_lines.
concatenate jselect-jobname pdf_ext
into objhead.
append objhead.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = pdf_type.
objpack-obj_name = jselect-jobname.
concatenate text-019 jselect-jobname
into objpack-obj_descr
separated by space.
objpack-doc_size = tab_lines * 255.
append objpack.
if int = 'X'.
clear iaddsmtp.
refresh iaddsmtp.
clear bapiadsmtp.
call function 'BAPI_USER_GET_DETAIL'
exporting
username = ext_user+0(12)
tables
return = ireturn
addsmtp = iaddsmtp.
loop at iaddsmtp where std_no = 'X'.
clear bapiadsmtp.
move iaddsmtp to bapiadsmtp.
endloop.
if bapiadsmtp-e_mail = ''.
concatenate ext_user kimball_domain
into reclist-receiver.
else.
move bapiadsmtp-e_mail to reclist-receiver.
endif.
move internet to reclist-rec_type.
else.
reclist-receiver = ext_user.
move dist_list to reclist-rec_type.
endif.
append reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = doc_chng
put_in_outbox = 'X'
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
tables
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
* CONTENTS_HEX =
* OBJECT_PARA =
* OBJECT_PARB =
receivers = 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
case sy-subrc.
when 0.
message i014 with reclist-receiver.
when 1.
message i015 with text-027.
when 2.
message i015 with text-028.
when 3.
message i015 with text-029.
when 4.
message i015 with text-030.
when 5.
message i015 with text-031.
when 6.
message i015 with text-032.
when 7.
message i015 with text-033.
when 8.
message i015 with text-036.
when others.
message i015 with text-036.
endcase.
endform. " send_pdf_in_email -
Report RSWUWFML to send mails to Outlook about the work item Arrival
Hello,
Report RSWUWFML to send mails to Outlook about the work item Arrival - Can we make settigns so that only work items pertaining to Leave Requests are sent to the Outlook.
Please help.
Regards,
PoornimaHi Poornima,
RSWUWFML is very old, you should use RSWUWFML2 at least but if you are on release Basis 6.40 or above you should use Extended Notifications. As mentioned in the other posts you need to restrict your selection criteria by task TSXXXXXXX. The task associated with the work items you want to send a notifcation about. You need to open the workflow definition and open the step in th definition that corresponds to the work item.
Another way would be to highlight one of the work items in the users inbox SBWP in the backend and click the "Details" button in the toolbar. You will see the task ID listed there.
Regards,
Eddie -
Mail hangs when it receives a report that an e-mail could not be delivered.
Hi Guys :o),
One bug which is really bugging me is that every time I receive a bounced e-mail report, with a subject line containing words to the effect of:
"Undeliverable. Return to sender."
or:
"The message could not be delivered."
Mail is unable to pull any subsequent e-mails down from the POP server.
So I junk the report, and then I delete it.
However, lo and behold, the errant e-mail is INSTANTLY back in my Inbox, plus there's now AT LEAST one copy in my Mail Junk, and also AT LEAST one copy in my Mail Trash.
Round and round I go, junk, delete, junk, delete, but the errant e-mail refuses to go away, and Mail continues to be unable to pull any new e-mails down from the POP server.
Eventually, Mail just hangs, with a spinning disk.
Even a force quit and relaunch of Mail doesn't resolve the spinning disk.
The errant message just sits there, REFUSING to be deleted.
The only way to get round this bug is for me to go up to my POP server, delete the report, and then PURGE DELETE the report - on the POP server !
I then have to go in to my Mac, and go:
--> Users --> Home --> Library --> Mail --> Account --> Inbox, Junk, and Deleted
and then manually drag ALL copies of the report into the trash on the Desktop.
It happens so often (pretty much every day) that I've had to create a shortcut in my Dock which leads straight to the Account folder.
Mail has always been buggy under ALL versions of OS X, but this ongoing bug drives me crazy, mainly because there's NO logical reason for it.
Just because I receive an e-mail message from the Hotmail server, for example, which says that my e-mail could not be delivered, usually because the recipient's inbox is full, or because no such address exists, on paper, that's just another e-mail which Mail is pulling down from the POP server.
However, EVERY TIME I receive such a report, Mail hangs.
I'm reluctant to rebuild my Mailboxes, in case I lose any messages, but I will if you advise it.
Any workaround would be gratefully received.
With best wishes to everyone in the Apple community, especially those on the Infinity Loop.
In particular, I wish Mr Jobs a very speedy recovery.
Cool,
Michael T
London, EnglandQuit Mail, Right click on that Mail folder, choose archive, you'll get everything in the folder, and the folder itself in a file called Mail.zip, move it to a safe place, same for the Mail Downloads folder... only the plist is separate.
/Users/YourUserName/Library/Preferences/com.apple.mail.plist
Not certain, but this can fix myriad Mail problems...
Safe Boot from the HD, (holding Shift key down at bootup), it will try to repair your Disk Directory while the spinning radian is happening, so let it go, run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move these folder & file to the Desktop.
Move this Folder to the Desktop...
/Users/YourUserName/Library/Caches/Mail/
Move this file to the Desktop...
/Users/YourUserName/Library/Mail/Envelope Index
Reboot.
If that doesn't do it and you can afford to redo all your Rules, try these & reboot...
/Users/YourUserName/Library/Mail/MessageRules.plist
/Users/YourUserName/Library/Mail/MessageRules.plist.backup -
How to automatically attached multiple PDF reports to an e-mail and send
Hello.
I have a requirement to generate multiple PDF reports using Oracle Reports 6i on the web, then automatically attach these PDF reports to an Outlook e-mail and then bring up the Outlook e-mail dialog box so the user can modify the e-mail (such as adding more attachments, adding a CC, BC, change the message text) before sending the e-mail. I want to be able to initiate all these tasks from Oracle webforms 6i in a three-tier environment.
I have already read various notes and solutions but none of them address all my requirements. Examples:
1. Using OLE to interface with Outlook - but OLE does now work on the Web
2. Using Java stored procedure or UTL_SMTP - but this does not bring-up an e-mail dialog box
3. Using mailto: in HTML and web.show_document - but this does not allow you to attach a PDF file
Can you please advise on possible solutions to my requirements. Thank you very much.
Regards,
ArmandoHere is a great resource for sending binaries.
http://otn.oracle.com/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
You'll want to use utl_http to run each report with a destype=file and then have another procedure running to check to see when all of your reports have finished. After they are finished, you would run the stored procedure to get all of the binaries, attach them in an email and then send it.
If you want to concate all of the PDF files into one large file, you can do this with a Java stored procedure using iText.
http://www.lowagie.com/iText/ -
E-Mail reporting in file to mail adapter scenario
Experts,
I am working on a file to mail adapter in which, have to just send a mail to the recipient by putting a subject line and mail body.
am following the following example
/people/community.user/blog/2006/09/07/email-reporting
but my requirement is not to send the mail attachment. I just need to send a mail body stating the error location.
here at teh receiver side, have downloaded a mail.xsd. in this "subject line","from field" , "to" field is there but there is no "mail body" field .
Can any one please help me out. I just require to send a mail body to the recipient.
Thanks
VeeruExpert,
I have used but still am getting teh attachment not as a mail body.
Isit possible to send the mail body via XSLT mapping , for eg
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://perks.com/MailTest">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
<Subject>Error files from XI</Subject>
<From>from mail ID</From>
<To>to mail id</To>
<Content_Type>text/html</Content_Type>
<Content>
<xsl:text xsl:space="preserve">The error files for which service entry has not been created:</xsl:text>
<xsl:value-of select="$break"/>
<xsl:value-of select="$break"/>
<xsl:value-of select="$tableB"/>
<xsl:value-of select="$thB"/>
<xsl:value-of select="$tdB"/>
<xsl:text xsl:
</Content>
</ns1:Mail>
</xsl:template>
</xsl:stylesheet>
Any suggestions?
Thanks
Veeru -
Report Output to be mailed as an attachment-On Schedule
Hi ,
I have a requirement to develop a oracle report with reportbuilder6i,the report output should be in excel format,needs to be run every monday and has to be mailed to some id [email protected]
While converting it to excel output emp.xls using text_io iam saving it in some location .I want that emp.xls to be mailed to an email id ,also the report has to be scheduled to run periodically.
If any one has done it,can u share the details and code.
Thanks in Advance.
Regards,
RojaAt the first outset, I dont think, this is possible. Moreover, this approach is definitely not recommended since it will severely impact on the system performance and if there is a Security Team, they will not allow to have this practice.
Normally, either we can send as PDF attachment to any internal user via email or this can also be sent externally via PDF. There is also an option to view as PDF from the existing output itself.
G. Lakshmipathi -
ALV report as an e-mail attachment
Hi,
I know this topic has been discussed many times. The program is not run background so if any of you could let me know the steps to achieve this it will be great !
Thanks a lot.Hi,
Download The ALV Report in An Excel Or HTML Format And Send It as An Attachment With The Mail.
DATA : it_html LIKE w3html OCCURS 0 .
CALL FUNCTION 'WWW_LIST_TO_HTML'
EXPORTING
list_index = v_lind " list index
TABLES
html = it_html.
After Downloading into a table it Send This As An Attachment with the Mail as follows
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_message1 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 v_num TYPE i.
DATA: t_packing_list LIKE sopcklsti1 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.
PERFORM send_file_as_email_attachment
TABLES it_message
it_attach
USING '[email protected]'
'TCS Details'
'HTM'
'filename'
CHANGING gd_error
gd_reciever.
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.
CONSTANTS:
con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
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,
w_doc_data LIKE sodocchgi1.
DATA v_sent TYPE sonv-flag.
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 = 'P'.
CLEAR it_message.
REFRESH it_message.
it_message[] = 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 = 1.
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
REFRESH it_message.
it_message[] = it_html[].
t_packing_list-transf_bin = ' '.
t_packing_list-head_start = 1.
t_packing_list-head_num = 4.
t_packing_list-body_start = 1.
CLEAR v_num.
DESCRIBE TABLE it_message 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 = 'TCS Scenario'.
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.
SELECT SINGLE email FROM zdrp_tcsmail INTO v_email WHERE vkorg = p_vkorg.
SPLIT v_email AT ',' INTO TABLE itab_temp_email.
LOOP AT itab_temp_email.
t_receivers-receiver = itab_temp_email-emailid.
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_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = v_sent
NEW_OBJECT_ID =
TABLES
packing_list = t_packing_list
OBJECT_HEADER =
CONTENTS_BIN =
contents_txt = it_message
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
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
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM. "send_file_as_email_attachment
Regards
Ahasan
Message was edited by: Ahsan
Message was edited by: Ahsan
Message was edited by: Ahsan -
Link to SAP Report Output from SAP Mail Inbox
Hi Experts,
I wants to send a link of SAP ALV Report output screen to SAP mail inbox and if a user clicks that link ,the report output
screen should open and user has to see & interact the ouput of that ALV Report.how can i achieve this without webdynpro
and workflow.
Regards,
Veera.Hi Asif
When I said 'pdf/rtf/html/htmlcss', I meant any one of the above.
You need to run the report as:
rwrun60 <report_name> <connection_string> desformat=pdf destype=mail desname=<email_id> batch=yes
In case you want to mail as HTMLCSS, replace PDF in DESFORMAT option in the above command to:
DESFORMAT=HTMLCSS.
Regards
Sripathy -
Report RFFOAVIS_FPAYM with E-Mail -- Error SO619
Hello,
we are sendung SEPA prenotifications to customers during using payment run with transaction F110.
Here we are creating output messages (email) with report RFFOAVIS_FPAYM. Printer is MAIL.
Sometimes we are getting error messages that some messages have not been sent correctly.
Messages:
SO619 - Error during sending procedure
F0388 - Sending of email and pring of prenotification to payment "XX XXXXXXXX" is not possible.
Masterdata settings are correct AND we called the customers and asked them if they received the emails. They said "YES", so the email has been sent correctly although the system raises the error message...
I suppose it has has something to do with the return of the message status. So the error report is created before the sending status arrived.
Has anyone an idea how to solve that problem`?
Kind regards.
Christhanks for reply.
I don't want to check everytime the SCOT. Even due to the fact that F110 is processed by employee in FI. And they won't work with SCOT.
I'm asking for a solution to avoid these faulty error messages.
Chris
Maybe you are looking for
-
Dear all, I am trying to change the Price control of a material from V to S. It is showing me a system message as follows: Price control cannot be changed (cost component split exists) Message no. M3160 Diagnosis Costing is active and has already bee
-
Hi, I'm new with web services and want to publish a stateless Java class as web service. I've created the WSDL file by means of the Web Service Publishing Wizard. when I run the "Web service stub/Skeleton Wizard" in step 1 of 2 appears the following
-
Create a table with all the months between two dates
Hi all, I have a purchase table recording individual purchases. One of the fields is my Date field (date of purchase). I would like to create a table 'All_months' with two entries ('month_no' and 'month') which will be based on the first and last dat
-
Backup photos to DVD (Not Time Machine)
Hi, I am running Time Machine and backing up locally. What I am interested in doing is backing up my photos to DVDs and storing the DVDs off site. Is there any easy & free way to do that? I know I can make a burn folder and do it by hand. What I am l
-
The music button on Settings/Store does not appear.
When I go to settings/store, I only have apps and the books buttons. There is no music button. This happens on my iPhone 3GS and iPad 1. I also have 2 mac with OSX Lion and I do not have the automatically dowonload music option on itunes. I cannot fi