Email Attachment Via Report
Hi Friends
I have an issue like i need to send the internal table data to distribution list as an attachment.. I am able to send the email attachment to the list but in the Parameter OBJBIN i hardcoded the sy-uname sy-repid to make sure that along with the output prog name and userid also gets displayed in the attachment..
My issue is Like while debuggin the FM SO_NEW_DOCUMENT_ATT_SEND_API1 i am getting the data line by line but in output attachment i am getting it as a single line..
I want to see the output with prog name and sy-repid line one after other..
Kindly help me in solving this issue
Thanks in advance,
Kishore
Hi Srinivas,
Thanks a lot for your response. Actually i already have tat piece of code which u have mentioned in your scrap.
This is my code
for eg.
CONCATENATE '0101010101' 'HI HOW ARE U' INTO objbin
SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
APPEND OBJBIN.
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = 'PURCHASEORDERS'.
APPEND OBJHEAD.
Creation of the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'HTM'.
OBJPACK-OBJ_DESCR = 'COST SWEEPER.htm'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
Completing the recipient list
clear reclist.
refresh reclist[].
reclist-receiver = 'Z_FI_SYS_ACT'.
reclist-rec_type = 'C'.
APPEND reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = objpack
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = reclist[]
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
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.
Thanks a lot
Kishore
Similar Messages
-
Send Email Attaching the Report generated in Program.
Hi All,
I am generating a report in list format with write statements.
My requirement is to send an email attaching this report as an attachment.
I wanted to know how to get the listobject of the report generated by my program from the memory. Can anyone guide me with this ?
It will be appreciable , If any one can give me more information on sending mails attaching the reports generated by the program.
Thanks in advance,
MayankHi,
I think the problem is not clear.
My problem is to get the listobject name which got generated after the program run.I want to attach this list report to the email. I have seen a code from one of the link.
Here it is.
List of Users According to Logon Date and Password Change
NOTE: Create ALI/OTF Document in Spool
SUBMIT rsusr200 WITH valid = 'X'
WITH notvalid = space
WITH unlocked = 'X'
WITH locked = space
EXPORTING LIST TO MEMORY AND RETURN.
<b>* Read list from memory into table
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = lt_listobject
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
Error in function module &1
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.</b>
Because listobject is of size RAW(1000)
and objbin is of size CHAR(255) we make this table copy
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = lt_listobject
out = lt_objbin
EXCEPTIONS
compress_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
Error in function module &1
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
Here the report is sumitted with the option of exporting the list in to the memory which is later read using 'LIST_FROM_MEMORY'.
But here i need the same report's output to be captured and want to read the list generated from memory into table.
How can i get the listobject of the list generated by the report in the same report program itself ??
Please let me know.
Mayank -
Receive email and read email attachment via BPEL
Hi All,
Does anyone know how to or has a module on receiving email and read email attachment via BPEL.
Im now reading and exploring UMS adapter as this activity can handle both reading email and email attachment.
Your response/s will be very much appreciated. Thanks.943363 wrote:
Hello,
I have an Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bits on an AIX 5.3 mainframe without the enterprise web interface.
I would like to do that process :
a daily email is sent to the oracle instance with a CSV in attachment.
I would like that attachment in a directory configured onto the instance.
I have a PL/SQL procedure triggered by a job that will insert the content of the CSV in a table.
Is that process possible with what I have ?
Thanks in advance,
Best Regards,
Grégory B.Databases don't receive email. Just sftp the file and schedule a job to process it. -
Send file as email attachment not working
any help would be greatly appreciated...
When I click "send file as email attachment" it will open outlook with the PDF attached but when I click send on the email, the email closes like it is sent but never actually gets sent (nothing in sent items and recipient never gets the email)
Adobe Acrobat 11 Pro (Creative Cloud Suite installed)
Outlook 2013Hi sandyw26405588,
Could you please try sending PDF as email attachment via another email apart from Outlook.
Are you able to send the file successfully?
Also, go under 'Help> Check for Updates' and ensure if you are using the latest version of Acrobat XI i.e. 11.0.10
Have you tried sending any other PDF via Outlook?
Let me know.
Regards,
Anubha -
To send output as a PDF attachment via email
Hi experts
I have the (smartform) output data in OTF format..and displaying it in PDF form with FM 'HR_EFI_SHOW_PDF_FORM' .
Now the requirement is <b>to send this output as a PDF attachment via email</b>.
Please help me with sample code to perform this.
Regards,
Matt.Hi,
Check this links,
/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
Also for email:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8cd6adbb-0301-0010-39ba-938c601d5db9
Refer the following link for more details:
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
Thanks,
Reward If Helpful. -
I want to send my output of report as an email attachment
i am having internal table contains values.
i want that output should be send as an email attachment
to email id given in selection screen.
help me how to pass that internal table to the parameters
of SO_DOCUMENT_SEND_API1 function module
should i call any function modules to format my internal table to get as an attachment in email.
help me its urgent..*& Report ZEMAIL_ATTACH *
*& Example of sending external email via SAPCONNECT *
REPORT ZEMAIL_ATTACH .
TABLES: ekko.
PARAMETERS: p_email TYPE somlreci1-receiver
DEFAULT '[email protected]'.
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
wa_ekpo TYPE t_ekpo.
TYPES: BEGIN OF t_charekpo,
ebeln(10) TYPE c,
ebelp(5) TYPE c,
aedat(8) TYPE c,
matnr(18) TYPE c,
END OF t_charekpo.
DATA: wa_charekpo TYPE t_charekpo.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
*START_OF_SELECTION
START-OF-SELECTION.
* Retrieve sample data from table ekpo
PERFORM data_retrieval.
* Populate table with detaisl to be entered into .xls file
PERFORM build_xls_data_table.
*END-OF-SELECTION
END-OF-SELECTION.
* Populate message body text
perform populate_email_message_body.
* Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Example .xls documnet attachment'
'XLS'
'filename'
changing gd_error
gd_reciever.
* Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp aedat matnr
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekpo.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_XLS_DATA_TABLE
* Build data table for .xls document
FORM build_xls_data_table.
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
* con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
* con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
LOOP AT it_ekpo INTO wa_charekpo.
CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
wa_charekpo-aedat wa_charekpo-matnr
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
* Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
* Fill the document data.
w_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
* Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
* Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
* Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
* Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
* Populate zerror return code
ld_error = sy-subrc.
* Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
* Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
* Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'Please find attached a list test ekpo records'.
APPEND it_message.
endform.
" POPULATE_EMAIL_MESSAGE_BODY -
Send PDF-Spool via email-Attachment
Hi,
i send an internal table to spool and convert it.
this works ok.
But when i send it via
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
i have problem with the attachment (PDF-Error).
Has anyboby a codeexample?
Here my short report until Conversion into PDF
REPORT ZGRO_TEST.
TABLES: MARA.
DATA: BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE MARA.
DATA: END OF ITAB.
DATA: FILESIZE TYPE I.
Spoolnummer
DATA: SPOOL_NR LIKE TSP01-RQIDENT.
PDF Ausgabetabelle
DATA: BEGIN OF PDF_OUTPUT OCCURS 0.
INCLUDE STRUCTURE TLINE.
DATA: END OF PDF_OUTPUT.
START-OF-SELECTION.
SELECT * FROM MARA INTO TABLE ITAB UP TO 100 ROWS.
Ausgabe in Spool umleiten
NEW-PAGE PRINT ON LINE-SIZE 255
NO DIALOG
NO-TITLE
NO-HEADING
IMMEDIATELY ' '.
interne tabelle ausgeben
LOOP AT ITAB.
WRITE:/ ITAB.
ENDLOOP.
Rücksetzen Spollausgabe auf Bildschirm.
NEW-PAGE PRINT OFF.
Spoolnummer besorgen
SPOOL_NR = SY-SPONO.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = SPOOL_NR
IMPORTING
PDF_BYTECOUNT = FILESIZE
TABLES
PDF = PDF_OUTPUT.
END-OF-SELECTION.
How can i use the PDF_OUTPUT as email attachment?
Thanks for help.
Regards, Dieterafter you get the pdf output:
do like this:
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
Send file by email as pdf PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .pdf documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
FORM send_file_as_email_attachment tables it_message
it_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.
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.
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.
Regards,
Ravi -
CS6, no longer available? Quiz Reporting by email attachment
Our company has a custom-built ColdFusion LMS which pulls in data from Captivate via the Email attachment option. See below:
This option looks to have been removed from Captivate 6.
Anyone know how to get around this issue?
ThanksYou are correct that the email reporting option has been removed from Captivate 6.
I suggest you look at the External Server Reporting option which uses PHP files and port the code over to ColdFusion to work with your custom LMS. That's probably the most direct route. -
Scheduling a Report to Deliver As an Email Attachment
Hi,
I want to schedule a Report to Deliver As an Email Attachment. But I am getting the below error.
oracle.apps.xdo.service.delivery.DeliveryException: oracle.apps.xdo.delivery.DeliveryException: Exception reading response;
nested exception is:
java.net.SocketException: Connection reset
at oracle.apps.xdo.service.delivery.impl.DeliveryServiceImpl.deliverToEmail(DeliveryServiceImpl.java:235)
at oracle.apps.xdo.servlet.scheduler.XDOJob.deliver(XDOJob.java:1215)
at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:493)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
In the below link its given to setup the email server (ArGoSoft Mail Server Freeware)
http://www.oracle.com/technology/obe/obe_bi/bipub/advance/advance.htm
But I did not do the steps mentioned in the above link. Since I have email server configured on my system.
I am using the proper Host name and Port. Can you please suggest why I am getting this error.
Thanks,
ShivaNot really the best way to go. You'll waste a lot of time and it may not work for your receiver. Most email hosts have file size limits that make emailing video files a problem. Better choice is upload you video to YouTube or some other file sharing site then email a link.
-
Pdf file sent via email attachment gets a webloc extension
Someone sent an email with a pdf attachment to our entire school via our google mail account. People with PCs were able to open the pdf files. Mac users received the pdf files with a webloc extension (i.e. - filename.pdf.webloc) and were unable to open it. How did this happen and how can we prevent it from happening again? I had 2 of the pdf files on my mac (one of which I created) and they did not have a webloc extension. Any help would be great. Thank you!!
Hi Kappy.
I tried that and received a message from Adobe Acrobat that read "Adobe Reader could not open 'Absentee Ballot.pdf' 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 wasn't correctly decoded).
Since we have 300+ families who receive these emails and I don't know who has a mac and who doesn't I would rather be able to send the pdf attachments and prevent the webloc from being applied at all versus letting everyone know how to remove it once they receive it.
Thanks for replying.
Christina -
Error opening PDF file when send as attachment via email
Hi,
I searched around the forum to resolve my issue and there's alot of post that is related but i can't find any answer to my issues.
Here's the scenario :-
I try to convert the smartform to PDF and then send the PDF as an attachment via email.
After converting the smartform to PDF, i managed to download the file and view it without any problem but i can't view the PDF as an attachment. It has the following error :-
Adobe Reader could not open '4500002325.PDF' because it is either not a supported fle type or because the file has been damaged (for example, it was sent as an email and wasn't correctly decoded
The following is the snapshot of my code:-
* Determine smartform function module for invoice
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
* error handling
ent_retco = sy-subrc.
PERFORM protocol_update_i.
ENDIF.
ls_control_param-getotf = 'X'.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
zxekko = l_doc-xekko " user_settings = ' '
zxpekko = l_doc-xpekko
IMPORTING
document_output_info = l_ssfcrespd
job_output_info = l_ssfcrescl
job_output_options = l_ssfcresop
TABLES
l_xekpo = l_doc-xekpo[]
l_xekpa = l_doc-xekpa[]
l_xpekpo = l_doc-xpekpo[]
l_xeket = l_doc-xeket[]
l_xtkomv = l_doc-xtkomv[]
l_xekkn = l_doc-xekkn[]
l_xekek = l_doc-xekek[]
l_xkomk = l_xkomk
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = v_len_in
BIN_FILE = v_bin_file
TABLES
OTF = l_ssfcrescl-otfdata
LINES = l_pdf
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5.
* email subject
CONCATENATE 'Purchase order' l_doc-xekko-ebeln INTO lw_subject
SEPARATED BY space.
* RECIPIENTS
lwa_recipients-rec_type = 'U'.
lwa_recipients-express = 'X'.
SELECT adr6~smtp_addr
INTO TABLE gv_smtp_addr
FROM ekko AS ekko INNER JOIN
lfa1 AS lfa1 ON ekko~lifnr = lfa1~lifnr INNER JOIN
adr6 AS adr6 ON adr6~addrnumber = lfa1~adrnr
WHERE ekko~ebeln = l_doc-xekko-ebeln.
IF NOT gv_smtp_addr[] IS INITIAL.
LOOP AT gv_smtp_addr INTO gv_smtp_addr_line FROM 2.
lwa_recipients-receiver = gv_smtp_addr_line.
lwa_recipients-copy = ''.
APPEND lwa_recipients TO ptb_recipients.
ENDLOOP.
* Text Data
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ST'
language = 'E'
name = 'TEST'
object = 'TEXT'
TABLES
lines = lv_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT lv_lines INTO lv_lines_line.
ltb_objtxt = lv_lines_line-tdline.
APPEND ltb_objtxt.
ENDLOOP.
DESCRIBE TABLE ltb_objtxt LINES lw_tab_lines.
READ TABLE ltb_objtxt INDEX lw_tab_lines.
* document data contains information for the whole message
lwa_doc_chng-obj_descr = 'ABAPlist'.
* Control Data
lwa_doc_chng-obj_name = 'TESTING'.
lwa_doc_chng-sensitivty = 'F'.
lwa_doc_chng-no_change = 'X'.
lwa_doc_chng-priority = '1'.
lwa_doc_chng-obj_prio = '1'.
lwa_doc_chng-obj_langu = sy-langu.
CLEAR ltb_objpack-transf_bin.
*Attachment
*Move the binary attachment to other internal table.
ltb_objpack-head_start = 1.
ltb_objpack-head_num = 0.
ltb_objpack-body_start = 1.
ltb_objpack-body_num = lw_tab_lines.
ltb_objpack-doc_type = 'RAW'.
APPEND ltb_objpack.
clear : lw_tab_lines.
*Get the number of lines in the Attachment (PDF FILE)
* DESCRIBE TABLE it_mess_att LINES lw_tab_lines.
DESCRIBE TABLE l_objbin lines lw_tab_lines.
ltb_objpack-transf_bin = 'X'.
ltb_objpack-head_start = 1.
ltb_objpack-head_num = 1.
ltb_objpack-body_start = 1.
ltb_objpack-body_num = lw_tab_lines.
ltb_objpack-doc_type = 'PDF'.
ltb_objpack-obj_descr = l_doc-xekko-ebeln.
ltb_objpack-doc_size = lw_tab_lines * 255.
APPEND ltb_objpack.
*Email Subject
lwa_doc_chng-obj_descr = lw_subject.
lwa_recipients-receiver = recipeint.
lwa_recipients-rec_type = 'U'.
lwa_recipients-copy = 'X'.
lwa_recipients-express = 'X'.
APPEND lwa_recipients TO ptb_recipients.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = lwa_doc_chng
COMMIT_WORK = 'X'
TABLES
packing_list = ltb_objpack
contents_bin = l_objbin
contents_txt = ltb_objtxt
receivers = ptb_recipients.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDIF.
Edited by: ~loObie on Apr 23, 2010 12:01 PM
Edited by: ~loObie on Apr 23, 2010 12:02 PMDid you send the pdf in the following format ...
2. Sending PDF as mail.
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = sy-uname.
t_receivers-rec_type = 'B'.
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.
Quote from the Following [LINK|http://www.sap-basis-abap.com/smartforms/convert-the-smart-form-into-pdf-and-send.htm] -
Report output getting truncated in email attachment
Hello Gurus,
My requirement is to send a report output as an email attachment.
I have done the coding for this but have a small problem. In the attachment the report is getting truncated after certain length.
Can you advise wats the problem ?
Regards,
SuhasHello Guys,
I too was contemplating on those lines. But actually i was calculating the File Size incorrectly.
Changed the code & now it working !!!!!!!
BR,
Suhas -
Sending a binary attachment via email, looking for a more clean way
Hi experts.
I finally managed to send a binary attachment via email. Why "finally"? Never done before!
Also I got to manage the "not standard" .SAP file extension, because the attachment is a transaction link.
So let me explain how i did it:
take SO_NEW_DOCUMENT_ATT_SEND_API1, filling following input data:
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = st_docdata
commit_work = 'X'
TABLES
packing_list = lt_packlist
contents_hex = lt_hex
contents_txt = lt_content
receivers = lt_recv
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.
But how to fill lt_hex? Well I did not found a way to transfer text data into raw data structure (lt_hex is type SOLIX).
So, here is the trick:
fill another table, lt_bin type SOLISTI1, with attachment content (text data);
dump lt_bin content to a file on application server, having care to specify TEXT MODE and UTF-8 encoding;
now reopen the same file in BINARY MODE and transfer content to lt_hex.
Why I did not use parameter
content_bin
? Because SAP ECC 6 is unicode enabled (I think UTF-16) and file has got to be UTF-8 or ASCII. Also, packing_list for attachment must specify binary tranfer mode. And doing so each UTF-16 character (2 bytes) is split into 2 characters (1 char + 1 NUL byte). Attachment is now unusable.
What is the question? Here it is: how to fill lt_hex data directly from text (UTF-16) data, avoiding conversion errors?
Thank you in advance.Hi Chhayank,
the problem is not the exported xls. If you have a look inside with Notepad or something like that, you will see that your leading zeros are exported correct.Excel-settings occurs this problem, it is all about how to open the document. If you use the import-assistant you will have no problems because there are options available how to handle the different columns.
Another solution might be to get familiar with ABAP2XLS-Project. I got in my mind, that there is a method implemented, that will help you solving this problem. But that is not a five minute job
~Florian -
Oracle Reports - Change Email Attachment Name
Hello,
I'm sending salary receipts in PDF via email using Report Server 10g. It's working but i want to change the PDF name, in order to appear the number of employee in the name (something like Receipt_00001.PDF)
I used to accomplished that in other versions using the DESNAME parameter, but now since its Web and via Reports Server that doesnt work :(
PROCEDURE EXEC_REPORT_SRV_FILE (WK_REPORT VARCHAR2 /* report name */,
WK_PROC VARCHAR2 /* process name */,
wk_file VARCHAR2 /*a parameter value that i use in the command below*/)
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESNAME,wk_file);
Where i call the EXEC_REPORT_SRV_FILE i tested like this below but just for doing this, the emails are no longer sent and it gives me the error in (**)
I done this because i think it would be in the 3rd parameter, but i was in doubt it could be in the 2nd one but i dont think so..
exec_report_srv_file (name_in ('PARAMETER.PR_DRIVE_APLIC')
|| name_in ('PARAMETER.PR_DIRECT_APLIC')
|| retorna_barra
|| lower (giaf6i_var_lib.cp_filename),
'Receipt1'||lower (pname),
'Receipt2'||wk_dest_file
Executed successfully but there were some errors when distribute the output REP-50159: Executed successfully but there were some errors when distribute the output
I'm using Oracle Reports 10g.
This is so urgent that i joined this forum just for this (For now.. :) )
Thank you so much in advance for your time.
Best regards,
Nuno Neves.- What is the difference between the reports that work and the ones that do not work?
- I would suggest to apply latest patchset 10.1.2.3
https://updates.oracle.com/download/5983622.html
Thanks, Roberto -
Send email with attachment via XI
Hi,
I need some help regarding sending out email with attchment via XI. My scenario will be I will need to send an email with attachment of Purchase Order (PDF format). I need to do it via XI. Is there any best way for me to configure my SENDER/RECEIVER Mail Adapter in order to send the email with PDF attachment via XI.
Appreciate any valuable thoughts and advice.
Thanks,
ZubairHave you seen these blogs
https://weblogs.sdn.sap.com/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
regards
SKM
Maybe you are looking for
-
After Effects Availability in Application Manager
After Effect does not appear in my adobe application manager. How can I make it available to Install?
-
Hi Team, I do not have routing for my finished goods. I have maintained in OPJG the default operation for my order type. In Control key the check box "Cost" is not activated. In OPJH, i have assigned the settlement profile as PP01. With this conditi
-
How to Split Column Data Based on Identifier
Hi, I am using oracle database. I am having data in this format in my column 1234~2345~3456~4567. I need a query to split the data in the column based on the identifier '~',so that i can pick out the value after the second occurrence of the identifie
-
ipad2 not taking a charge
-
I plugged in the Blackberry Desktop software, which caused the Tour to reboot. This has recovered in the past to successful reboots, the software has worked ok for more than a year. but now the Tour is stuck forever on reboot - the status bar stuck