Bursting by email a report: double pdf attached
Hi. When I'm bursting a report I send 1 report to 2 persons. But the first person receives double attached pdf and the second person only one pdf (correctly). Why?
Thanks, bye.
Riccardo
i don't Know where it is possible to setting
smtp server
username and password to acces to the external smtp
Do you Know if there is a parameter file to setting this parameter ??
Than'k a lot again.
Similar Messages
-
Is there a way to send the email notification as a PDF attachment and the email receipt as an email
Has anyone found a way to send the email notification as a PDF attachment rather than email? I would still like to send the receipt as an email though? Any thoughts or experiences out there?
Thanks for prompt response. Does this mean that there are future plans to do this?
The forms received are used as part of a registration process into aonther system and aren't that User friendly in an email form. They have to be processed as received, so not efficiet to go in through the back end. -
Emailing a report in pdf format.
Hi ,
I have a requirement of monthly getting a report in pdf format and mailing it as an attachment.
Please tell me if this is possible on apex.
thanks,It's possible.. Now, can you change you name in the forum so we know who were are talking to, we are a friendly group here, and normally don't bite..If you have BI Publisher available, you can build a report in it,m and have it scheduled to send reports .. Or you can look at this thread Re: send .pdf-file from report query in an email which talks about running the report to the server using an APEX api and then sending the resulting pdf via a dbms_job you setup..
Thank you,
Tony Miller
Webster, TX -
Email Billing document as PDF Attachment while saving from VF01/02
Hi,
Can anybody suggest if there is any BADI/User Exit/Configuration exists in order to email Billing document as a PDF attachment while saving from VF01 or VF02?
We need to trigger this while saving the Output type say, VF02 GOTO -> HEADER -> OUTPUT (select the output type) -> SAVE - should send an email with PDF attachment.
I have written the code for sending email with PDF attachment. Presently this code is included in the Print program for the sapscript and an email is sent when an output is issued from VF01/02/03 where as the requirement is to send email whenever the document is saved.
Thanks in Advance,
SrinivasHi,
While saving subroutine FORM_OPEN will get triggerred, and this will be included in the Z Program. If it is not contained in the Z program, include this subroutine. This subroutine will have include RVADOPFO.
The above include will have the function module ADDR_GET_NEXT_COMM_TYPE, and the import parameter LVS_COMM_VALUES will contain the address number and email address to whom the pdf needs to be sent.
So here, i.e. In place of standard include RVADOPFO, put custom include ZRVADOPFO, and modify the code as below.
After the function module ADDR_GET_NEXT_COMM_TYPE, read the email address from any custom table based on the various conditions or hard coded value, then move it to the below variable.
LVS_COMM_VALUES-ADSMTP-SMTP_ADDR.
And remaining functionality will be taken care by the standard code. i.e. converting the spool to PDF and attaching it while sending the email etc....
If I am not wrong, the same functionality will work even while saving the sales order etc..
Regards,
Santu. -
How to email oracle reports in pdf as attachments
Hi,
I am dynamically generating pdf files from oracle reports accessed from a web application. I need to email this pdf file as an attachment. I set destype=mail, desformat=pdf or html and desname=to the email address. The email get sent with the file text included in the email, NOT AS AN ATTACHMENT. How can I include the file as an attachment?
Oracle Home is on a UNIX box.
Regards,
MonicaHi Monica,
You could use a feature called distribution. You specify you email-related parameters in an XML file (say distribution.xml), and run the report by adding the following to your command line:
...+distribute=yes+destination=distribution.xml
Inside the XML file you can specify the attachment, eg (this is just a sample, not the complete file):
<mail id="ex2"
to="<email_ID>"
from="<email_ID>"
subject="This mail contains the files for Department 10">
<body srcType="text">
This is the body of the message.
</body>
<attach format="pdf" name="Dept_10.pdf" srcType="report">
<include src="report"/>
</attach>
</mail>
See complete documentation of the distribution file in Publishing Reports (version 10g) chapter 15. You can also see a sample of distribution in Building Reports manual (version 10g) chapter 36.
http://otn.oracle.com/documentation/reports.html
Navneet. -
When sending email PO in a PDF attachment, the attachment can not be openen
Hi all,
We are trying to send an email with the PO in PDF format. We got the email but the attachment can not be opened.
Error reads: Adobe could not open test.pdf because it is either not a supported file type or because the file has been damaged (for example , it was send as a email attachemnet and was not correctly decoded).
Could any body bring some light? We know that everything in SCOT is fine because we can email the PO through configuration to the vendor without problem. It is just these extra copies that do not work.
a) We are modifying our custom Print program to add the code below after closing the form.
in few words:
a) We are getting the OTF from closing the form.
b) Converting the OTF to PDF
c) Sending the PDF as attachment.
data: lt_docs TYPE TABLE OF docs.
data: pdf_bytecount TYPE i.
data: begin of pdfout occurs 0,
tline type tline,
end of pdfout.
Ende Formulardruck --------------------------------------------------*
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
result = result
tables
otfdata = otf.
IF RESULT-TDSPOOLID NE SPACE.
SPOOLID = RESULT-TDSPOOLID.
PERFORM PROTOCOL_UPDATE USING '320' SPOOLID SPACE SPACE SPACE.
ENDIF.
if result-userexit eq 'C' or
result-userexit eq 'E'.
retco = '9'.
endif.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = pdf_bytecount
TABLES
otf = otf
doctab_archive = lt_docs
lines = pdfout
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
Creation of the document to be sent File Name
maildata-obj_name = 'TEST'.
Mail Subject
maildata-obj_descr = 'Subject'.
Mail Contents
append mailtxt.
describe table mailtxt lines tab_lines.
read table mailtxt index tab_lines.
maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
Creation of the entry for the compressed document
clear mailpack-transf_bin.
mailpack-head_start = 1.
mailpack-head_num = 0.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'RAW'.
append mailpack.
Move OTF code to structure SOLI form email
CLEAR solisti1. REFRESH solisti1.
LOOP AT otf.
solisti1-line = otf.
APPEND solisti1.
ENDLOOP.
Move pdf code to structure soli form email
clear solisti1. refresh solisti1.
loop at pdfout.
solisti1-line = pdfout.
append solisti1.
endloop.
loop at solisti1.
move-corresponding solisti1 to mailbin.
append mailbin.
endloop.
describe table mailbin lines tab_lines.
mailhead = 'TEST.OTF'.
mailhead = 'TEST.PDF'.
append mailhead.
Creation of the entry for the compressed attachment
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'OTF'.
mailpack-doc_type = 'PDF'.
mailpack-obj_name = 'TEST'.
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
append mailpack.
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
append mailrec.
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
append mailrec.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = maildata
TABLES
PACKING_LIST = mailpack
OBJECT_HEADER = mailhead
CONTENTS_TXT = mailtxt
RECEIVERS = mailrec
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
ENDFORM.Dear Monica,
You need to configure the system with respect to functional point of view and need to write the following code in print program. i have done this and solution is as follows.
<b> Reward me for this solution.</b>
Process 11 (MM) Sending RFQs and POs to vendors directly from the system instead of sending thru Courier or Fax
Existing Process (AS-IS) Presently system is not supporting this requirement
Business Requirements RFQs to be linked with vendor master with e-mail to send enquiries directly through system instead of courier/fax. Vice versa P.Os. Specifications, drawings should also go to vendor along with mail.
To-Be
Configuration Settings:
1) Spro Materials management Purchasing Messages Output control Message types Define message types for RFQ/ PO
Created ZEK1,ZMI and ZEK2 for RFQs
Created ZIK,ZOC,ZOK,ZOM,ZSI, ZSK2 and ZSM for Pos
The above New output types Included with existing Print Forms and Programs but modified with External send(5) medium, and added companys letter head thru ABAP developments (details provided below)
The above new output types also maintained for Fine- tuned control (thru same navigation) for New(1) and Change(2) operations
2) Spro Materials management Purchasing Messages Output control Message determination schemas Define message schema for RFQ/ PO
Maintained the new output types in the control data
3) Maintain Condition records for the New out put types (copied same document types from the existing old output types)
Easy access Logistics Materials management Purchasing Master data Messages MN01 (for RFQs)/ MN04 (for Pos)
4) Maintain Email id of Vendor in Vendor master.
Developments (ABAP):
1) Copied the existing print programs and forms of the corresponding out types.
2) Addition of header window in each corresponding form (HEADER window). Uploaded the HEADER3 graphics in the header window.
INCLUDE HEADER3 OBJECT GRAPHICS ID BCOL LANGUAGE EN
3) Added the the following code in TOP includes
TYPE-POOLs szadr.
INCLUDE: LMEDRUCKF09.
data: intnast LIKE snast,
lvs_recipient LIKE swotobjid, "Internet
lvs_sender LIKE swotobjid, "Internet
lvs_comm_type TYPE ad_comm,
lvs_comm_values TYPE szadr_comm_values,
p_retco TYPE i.
5) Addition of the perform to SOS include for header window display
PERFORM WRITE_FORM_HEADER.
*& Form WRITE_FORM_HEADER
text
--> p1 text
<-- p2 text
FORM WRITE_FORM_HEADER.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'HE1'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'HEADER'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
ENDFORM.
6) In the corresponding FORM include the following code has been added.
DATA: lvs_comm_type TYPE ad_comm,
lvs_comm_values TYPE szadr_comm_values,
xprogramm type sy-repid.
... use stratagy to get communication type
CALL FUNCTION 'ADDR_GET_NEXT_COMM_TYPE'
EXPORTING
strategy = nast-tcode
address_number = lfa1-adrnr
IMPORTING
comm_type = lvs_comm_type
comm_values = lvs_comm_values
EXCEPTIONS
address_not_exist = 1
person_not_exist = 2
no_comm_type_found = 3
internal_error = 4
parameter_error = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
convert communication data
MOVE-CORRESPONDING nast TO intnast.
MOVE sy-repid TO xprogramm.
7) By using the function module we can get sender and reciepient mail ids to variables lvs_recipient lvs_sender
CALL FUNCTION 'CONVERT_COMM_TYPE_DATA'
EXPORTING
pi_comm_type = lvs_comm_type
pi_comm_values = lvs_comm_values
pi_country = lfa1-land1
pi_repid = xprogramm
pi_snast = intnast
IMPORTING
pe_itcpo = itcpo
pe_device = xdevice
pe_mail_recipient = lvs_recipient
pe_mail_sender = lvs_sender
EXCEPTIONS
comm_type_not_supported = 1
recipient_creation_failed = 2
sender_creation_failed = 3
OTHERS = 4.
IF sy-subrc <> 0.
Avoids cancellation with message TD421
p_retco = '1'. "831984
PERFORM protocol_update USING '740' space space space space.
dummy message to make the message appear in the where-used list
IF 1 = 2.
MESSAGE S740(me).
ENDIF.
EXIT.
ENDIF.
IF xdevice = 'MAIL'. "885787
Check validity of email address to avoid cancellation with TD463
CALL FUNCTION 'SX_ADDRESS_TO_DEVTYPE' "831984
EXPORTING
recipient_id = lvs_recipient
sender_id = lvs_sender
EXCEPTIONS
err_invalid_route = 1
err_system = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
p_retco = '1'.
PERFORM protocol_update USING '740' space space space space.
dummy message to make the message appear in the where-used list
IF 1 = 2.
MESSAGE S740(me).
ENDIF.
EXIT.
ENDIF.
ENDIF.
8) Attaching the new print program and form in NACE transaction.
Steps for End user:
1) Creating the Purchase Order or RFQ with suitable document type through ME21N or ME41 .
2) Executing the transaction ME9F and in selecting the suitable output type.
3) Executing the transaction ZSEND_PDOC using INT as input.
4) With above steps we can able to send purchase order or RFQ to vendor as an attachment through e-mail in PDF format.
Regards
Badari -
Hi,
I am converting a smartform to PDF and then sending it as an attachment to email using FM SO_NEW_DOCUMENT_ATT_SEND_API1.
But I am getting this error. 'Error calling FM <SBCOMS_SEND_REQUEST_CREATE> in <SO_DOCUMENT_SEND_API1> with SY-SUBRC <1>'
I am passing below entries to packaging list table.
Packing list for Email Text
ls_packing_list-head_start = 1.
ls_packing_list-head_num = 1.
ls_packing_list-body_start = 1.
ls_packing_list-doc_type = 'RAW'.
Packing list for PDF
ls_packing_list-transf_bin = 'X'
ls_packing_list-head_start = 1.
ls_packing_list-head_num = 1.
ls_packing_list-body_start = 1.
ls_packing_list-doc_type = 'PDF'.
Please let me know if I am missing anything.
Regards,
NishantHi Nishant,
Please refer my below code last week only i have implemented this logic.
call function 'CONVERT_OTF'
exporting
format = 'PDF'
max_linewidth = 132
importing
bin_filesize = w_bin_filesize
tables
otf = t_otf
lines = t_pdf_tab
exceptions
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4.
pdf_output[] = t_pdf_tab[].
loop at pdf_output.
translate pdf_output using ' ~'.
concatenate gd_buffer 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.
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.
free t_attachment.
t_attachment[] = it_attach[].
clear it_attach[].
refresh it_attach[].
free 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.
free t_receivers.
clear : email.
select single usrid_long into email from pa0105 where pernr = wa_pernr-pernr
and subty = '0010' and seqnr = ''.
t_receivers-receiver = email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
append t_receivers.
ld_sender_address = 'HRD1'.
ld_sender_address_type = 'B'.
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.
check it and Revert back .
Regards,
Thangam.P -
Send email with spool as PDF attachment using class CL_BCS
Hi,
I am converting a spool to PDF using the function module CONVERT_OTFSPOOLJOB_2_PDF. The spool contains graphic images etc just like a script output.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = v_rqident
no_dialog = 'X'
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
TABLES
pdf = pdf
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.
After this I want to attach the pdf as an attachment to an email and send it. For this purpose I am using the code found in the example BCS_EXAMPLE_5.
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'My attachment'
i_att_content_hex = binary_content.
How do I convert the script text into binary content, could you please suggest some help.Old code, but I use:
DATA: lt_pdf TYPE soli_tab,
lt_pdfbin TYPE solix_tab.
* Convert the lines
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src = 134
line_width_dst = 255
transfer_bin = 'X'
TABLES
content_in = i_pdf
content_out = lt_pdf
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
IF sy-subrc NE 0.
RAISE convert_error.
ENDIF.
lt_pdfbin = lt_pdf.
Also, keep in mid that that OTF convert function has a 99 page limit - if you can potentially reach that limit, you need to handle the background job process and retrieval of the RAW data from the spool. -
Sap email address to receive PDF attached
Hello,
I read that you can send an interactive form (in xml or pdf) back to SAP and integrate it directly into SAP.
I saw that you can get the attached file :
[Sample Code for processing Inbound Mail with Adobe Interactive Forms|http://wiki.sdn.sap.com/wiki/display/Snippets/Sample%20Code%20for%20processing%20Inbound%20Mail%20with%20Adobe%20Interactive%20Forms]
But what I don't understand is to what email address it is supposed to be sent, and how check if it is well received in sap.
Is there a "generic" address for sap inbox, and a transaction where I can check this inbox. And how do I write in the program that I want to get email from this address.
Thank you,Hello,
you will have to set up inbound mail in your SAP system. The SAP System will have an own subdomain or own addresses that you mail server will recognize and send it to your SAP system. About setting up inbound mail please read SAP note:
#455140
After the mail arrives into the SAP system you can define which addresses will need special inbound processing. >> This is what you already found.
The inbound mails can be found in Tr. SOIN in the new releases.
Best regards,
Dezso -
Convert SMARTFORM report to PDF and send as an email attachment
Hi
I am using the CONVERT_OTF function module to convert a SMARTFORM report in the "spool" to a PDF file. When I use the DOWNLOAD function module, the resulting file can be opened in acrobat.
I would like to email the report in PDF format as an attachment. I am using the function module SO_NEW_DOCUMENT_ATT_SEND_API1 to create an attachment however the attached file is not being created correctly and When try to open, it gives 'File is damaged and could not be repaired' error message. I believe that somehow I am not using the SO_NEW_DOCUMENT_ATT_SEND_API1 function module correctly.
Please help me to correct this
Thanks
Rohitha
see my code below,
I_OTF[] = W_RETURN-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = V_LEN_IN
TABLES
OTF = I_OTF
LINES = I_TLINE
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
ENDIF.
LOOP AT I_TLINE.
TRANSLATE I_TLINE USING '~'.
CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING '~'.
DO.
I_RECORD = WA_BUFFER.
APPEND I_RECORD.
SHIFT WA_BUFFER LEFT BY 132 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
REFRESH: I_RECLIST,
I_OBJTXT,
I_OBJBIN,
I_OBJPACK.
CLEAR WA_OBJHEAD.
I_OBJBIN[] = I_RECORD[].
I_OBJTXT = '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_to_PDF'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'Smartform to PDF'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = STRLEN( I_OBJTXT ) + ( ( V_LINES_TXT - 1 ) * 255 ) .
CLEAR I_OBJPACK-TRANSF_BIN.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_TXT.
I_OBJPACK-DOC_TYPE = 'RAW'.
APPEND I_OBJPACK.
I_OBJPACK-TRANSF_BIN = 'X'.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 1.
I_OBJPACK-BODY_START = 1.
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 = 'ATTACHMENT'.
I_OBJPACK-OBJ_DESCR = 'test'.
APPEND I_OBJPACK.
CLEAR I_RECLIST.
I_RECLIST-RECEIVER = 'my email address u2019.
I_RECLIST-REC_TYPE = 'U'.
APPEND I_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 = 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 ', SY-SUBRC.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.Hi rohitha.wijewardena ,
Please find the below code which i followed and succeed ,
CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
EXPORTING
pi_nast = nast
pi_country = lv_dlv-land
pi_addr_key = lv_addr_key
pi_repid = sy-repid
pi_screen = lc_x
IMPORTING
pe_returncode = gv_retcode
pe_itcpo = lv_itcpo
pe_device = lv_device
pe_recipient = lv_recipient
pe_sender = lv_sender.
IF gv_retcode = 0.
*moving the data to composer and control parameters for output
MOVE-CORRESPONDING lv_itcpo TO lv_composer_param.
lv_control_param-device = lv_device.
lv_control_param-no_dialog = lc_x.
lv_control_param-preview = lc_x.
lv_control_param-getotf = lv_itcpo-tdgetotf.
lv_control_param-langu = nast-spras.
lv_composer_param-tdnoprint = space.
ENDIF.
*Getting the Smartform Function module using Standard Function module
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lv_formname "Smartform Name
IMPORTING
fm_name = lv_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
IF sy-subrc <> 0.
gv_retcode = sy-subrc.
PERFORM protocol_update.
PERFORM add_smfrm_prot.
ENDIF.
**Smartform function module to get the output
CALL FUNCTION lv_fm_name
EXPORTING
control_parameters = lv_control_param
mail_recipient = lv_recipient
mail_sender = lv_sender
output_options = lv_composer_param
user_settings = ' '
is_bil_invoice = lv_bil_invoice
gt_header = gt_header
IMPORTING
job_output_info = gv_job_output
TABLES
gt_item = gt_item
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
gv_retcode = sy-subrc.
PERFORM protocol_update.
PERFORM add_smfrm_prot.
ENDIF.
IF nast-nacha = lc_mail.
gt_otfdata[] = gv_job_output-otfdata[].
* Converting Smartform to PDF *
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = lc_pdf
max_linewidth = 10
IMPORTING
bin_filesize = gv_binfilesize
bin_file = gv_pdf_xstring
TABLES
otf = gt_otfdata[]
lines = gt_pdftab[]
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.
* Sending PDF to Email using Class *
IF NOT lv_email IS INITIAL .
TRY.
gv_send_request = cl_bcs=>create_persistent( ).
gv_pdf_content = cl_document_bcs=>xstring_to_solix( gv_pdf_xstring ).
gv_document = cl_document_bcs=>create_document(
i_type = lc_pdf
i_hex = gv_pdf_content
i_length = gv_pdf_size
i_subject = lc_subject ). "Subject for Email
gv_send_request->set_document( gv_document ).
gv_recipient = cl_cam_address_bcs=>create_internet_address( lv_email ).
gv_send_request->add_recipient( gv_recipient ).
gv_sent_to_all = gv_send_request->send( i_with_error_screen = lc_x ).
COMMIT WORK.
IF gv_sent_to_all IS INITIAL.
MESSAGE i500(sbcoms) WITH lv_email.
ELSE.
MESSAGE s022(so).
ENDIF.
CATCH cx_bcs INTO gv_bcs_exception.
MESSAGE i865(so) WITH gv_bcs_exception->error_type.
ENDTRY.
ENDIF. -
Printing Emails that have pdf attachment icons
WHen I send an email that has a pdf attachment, I generally make sure that the attachment is "View as Icon". Even so, when I need to print the email for archive purposes, the printout always includes an image of the first page of the pdf, not the icon. This can result in unnecessary page prints.
In Lion, this used to happen only with pdf attachments that had only 1 page. In Mountain Lion, it seems to happen also with multi-page pdf attachments.
Is there a way to force print only the attachment icon in the email, not the full page?To make the icon the default view of attachements, do the following:
Use the Terminal to set the preference.
Terminal is in Applications>Utilities. Open Terminal and type:
defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes
That will make every attachment you send act like an attachment instead of a pretty unusable decoration.
If you decide this isn’t what you’re looking for, to restore inline attachment viewing type:
defaults write com.apple.mail DisableInlineAttachmentViewing -bool false
Restart Mail and you’re back to normal.
Please tell me if that worked for you! -
Problem while emailing after exporting as PDF.
I have this strange problem. Basically, we have this VB6/SQL2005 application that exports crystal report into pdf attaches it to email and then send it in email...now most of the time and i would say about 95% of time, the email goes fine and they receive it fine. But recently it has started where they dont receive email on the other side. No rejection email message. No bounce back message.
Becuase of different email clients on the other side, it is very hard to pin point the problem.
We are using Crstal XI.
Any help would be appreciated..
Thanks
RajIt may be the other mail server is detecting the attachement and blocking it. Check with them first.
Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551 -
STO mail : pdf attachment has an error 'file damage' when try to open it
Dear expert,
I need to send an e-mail to the vendor with the sto list as attachment at the email.
I managed to send email to external addresee and made the pdf attachment, BUT somehow when I open the attachment it has an error says "Adobe Reader could not open xx.pdf because it is either not a supported file type or because the file has been damaged(for axample, it was sent as an email attachment and wasn't corectly decoded)."
Really need your experties to help me. Here is my abap coding to send email and do the pdf attachment at the new ouptput type to send email.
TYPES: BEGIN OF lty_drad,
doknr TYPE drad-doknr,
END OF lty_drad,
BEGIN OF lty_recpt,
smtp_addr TYPE ad_smtpadr,
END OF lty_recpt.
DATA: lt_doc TYPE STANDARD TABLE OF docs,
lt_recpt TYPE STANDARD TABLE OF lty_recpt,
lt_tline LIKE tline OCCURS 0 WITH HEADER LINE,
lt_data TYPE solix_tab,
lt_docu TYPE STANDARD TABLE OF lty_drad,
lt_docfiles TYPE STANDARD TABLE OF bapi_doc_files2,
lw_tline LIKE LINE OF lt_tline,
lw_docu LIKE LINE OF lt_docu,
lw_docfiles LIKE LINE OF lt_docfiles,
lw_objdes TYPE tnati-objdes,
lt_text TYPE bcsy_text,
lw_recpt TYPE adr6-smtp_addr,
lw_adrnr TYPE lfa1-adrnr,
lw_object TYPE drad-objky,
lw_doknr TYPE drad-doknr,
lw_return TYPE bapiret2,
lw_xcontent TYPE xstring,
client TYPE REF TO if_http_client,
url TYPE string,
lw_subrc TYPE sysubrc,
response TYPE REF TO if_http_response,
lw_message1 TYPE string,
sent_to_all TYPE os_boolean,
bin_filesize type i.
CONSTANTS: lc_dokar_srm TYPE drad-dokar VALUE 'SRM',
lc_type TYPE so_obj_tp VALUE 'RAW'.
CLASS-DEFINITIONS
DATA: send_request TYPE REF TO cl_bcs.
DATA: document TYPE REF TO cl_document_bcs.
DATA: sender TYPE REF TO cl_sapuser_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
DATA: exception_info TYPE REF TO if_os_exception_info,
bcs_exception TYPE REF TO cx_bcs.
RANGES: lr_po_pr FOR drad-objky.
DATA: lw_banfn TYPE ekpo-banfn,
lw_bnfpo TYPE ekpo-bnfpo.
IF nast-nacha = '5'. "8
Create recipient and check if exist
Get email ID
start commented by sapnislina 21.12.06
SELECT SINGLE adrnr FROM lfa1 INTO lw_adrnr
WHERE lifnr = p_ekko-lifnr.
IF sy-subrc NE 0.
PERFORM protocol_update
USING '303' 'Address of Vendor:' ekko-lifnr 'not found' space
p_retco = sy-subrc.
EXIT.
ENDIF.
end commented by sapnislina 21.12.06
SELECT smtp_addr INTO CORRESPONDING FIELDS OF TABLE lt_recpt
FROM adr6
WHERE addrnumber = p_ekko-adrnr. "lw_adrnr.
IF lt_recpt[] IS INITIAL.
PERFORM protocol_update
USING '303' 'Email address(es) does not exist for vendor'
p_ekko-lifnr space space.
p_retco = sy-subrc.
EXIT.
ENDIF.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
use_otf_mc_cmd = 'X'
IMPORTING
bin_filesize = bin_filesize
TABLES
otf = otfdata[]
doctab_archive = lt_doc
lines = lt_tline
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
IF sy-subrc <> 0.
PERFORM protocol_update
USING '303' 'PO Convertion from OTF to PDF failed'
space space space.
p_retco = sy-subrc.
EXIT.
ENDIF.
Get object description from mail title of output types
SELECT SINGLE objdes INTO lw_objdes
FROM tnati
WHERE spras = sy-langu
AND kappl = nast-kappl
AND kschl = nast-kschl.
CONCATENATE lw_objdes ekko-ebeln INTO lw_objdes SEPARATED BY
space
DATA L_TXT(255) TYPE C.
DATA L_TXT2(255) TYPE C.
CONCATENATE 'STO' EKPO-EBELN 'Created for' EKPO-WERKS '/'
EKPO-LGORT
'Supply Plant' EKKO-RESWK into l_txt separated by space.
lw_objdes = l_txt.
CONCATENATE 'STO' EKKO-EBELN INTO L_TXT2 SEPARATED BY SPACE.
APPEND L_TXT2 TO LT_TEXT.
APPEND lw_objdes TO lt_text.
Instantiate
CLASS cl_cam_address_bcs DEFINITION LOAD.
CLASS cl_abap_char_utilities DEFINITION LOAD.
insert by sapnislina 22.12.06
DATA : CONTENT_OUT TYPE SOLIX,
LINE_WIDTH_SRC TYPE I,
POS_OUT TYPE I,
POS_IN TYPE I,
LEN_OUT TYPE I.
DATA OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF CONTENT_IN,
LINE TYPE TLINE,
DUMMY TYPE TLINE,
END OF CONTENT_IN.
TYPES PDF_RAW TYPE X LENGTH 268.
FIELD-SYMBOLS <PDF_BIN> TYPE PDF_RAW.
DESCRIBE FIELD CONTENT_IN-LINE LENGTH LINE_WIDTH_SRC IN BYTE MODE.
REFRESH lt_data.
CLEAR CONTENT_OUT.
POS_OUT = 0.
LOOP AT OTFDATA INTO CONTENT_IN-LINE.
ASSIGN CONTENT_IN TO <PDF_BIN> CASTING.
MOVE <PDF_BIN> TO CONTENT_OUT-LINE+POS_OUT.
ADD LINE_WIDTH_SRC TO POS_OUT.
WHILE POS_OUT >= 255.
APPEND CONTENT_OUT TO lt_data.
CLEAR CONTENT_OUT.
SUBTRACT 255 FROM POS_OUT.
IF POS_OUT > 0.
POS_IN = LINE_WIDTH_SRC - POS_OUT.
MOVE <PDF_BIN>+POS_IN TO CONTENT_OUT-LINE.
ENDIF.
ENDWHILE.
ENDLOOP.
IF POS_OUT > 0.
APPEND CONTENT_OUT TO lt_data.
ENDIF.
end inserted by sapnislina 22.12.06
starting to create attachment to mail
TRY.
CLEAR send_request .
Create persistent send request
send_request = cl_bcs=>create_persistent( ).
Build the document
document = cl_document_bcs=>create_document(
i_type = lc_type "RAW
i_text = lt_text "def of output type
i_length = '12'
i_subject = lw_objdes ).
Attached the document object
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = lw_objdes "definition of output
type
i_attachment_size = '12'
i_att_content_hex = lt_data.
completed first part to attached PO (pdf format) as attachment
Now attach the PO related attachments to the mail..
.... need to read from table DRAD and get all the attachment per PO
at run time
REFRESH: lr_po_pr."lt_return.
CLEAR: lr_po_pr,lw_return.
MOVE 'ICP' TO lr_po_pr.
CLEAR: lw_object.
completed second part for PO related attachments
Now prepare to send mail
Add document to send request
CALL METHOD send_request->set_document( document ).
Get sender object
sender = cl_sapuser_bcs=>create( sy-uname ).
Add sender
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
LOOP AT lt_recpt INTO lw_recpt
WHERE NOT smtp_addr IS INITIAL.
recipient = cl_cam_address_bcs=>create_internet_address(
lw_recpt ).
Add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
CLEAR recipient.
ENDLOOP.
Send the document
CALL METHOD send_request->send
RECEIVING
result = sent_to_all.
Catch any exception
CATCH cx_bcs INTO bcs_exception.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = bcs_exception->msgid
msg_nr = bcs_exception->msgno
msg_ty = bcs_exception->msgty
msg_v1 = bcs_exception->msgv1
msg_v2 = bcs_exception->msgv2
msg_v3 = bcs_exception->msgv3
msg_v4 = bcs_exception->msgv4
EXCEPTIONS
OTHERS = 1.
p_retco = sy-subrc.
ENDTRY.
ENDIF.
IF NOT result-tdfaxid IS INITIAL OR " 422131
NOT result-tdmailid IS INITIAL. " 422131
CLEAR syst-msgv1. " 422131
IF NOT result-tdfaxid IS INITIAL. " 422131
syst-msgv1 = result-tdfaxid. " 422131
ELSEIF result-tdmailid IS INITIAL. " 422131
syst-msgv1 = result-tdmailid. " 422131
ENDIF. " 422131
CALL FUNCTION 'NAST_PROTOCOL_UPDATE' " 422131
EXPORTING " 422131
msg_arbgb = 'VN' " 422131
msg_nr = '095' " 422131
msg_ty = 'I' " 422131
msg_v1 = syst-msgv1 " 422131
EXCEPTIONS " 422131
OTHERS = 1. " 422131
ENDIF. " 422131
IF result-userexit EQ 'C' OR
result-userexit EQ 'E'.
p_retco = '9'.
ENDIF.
ENDFORM. " ENDE
end inserted
Regards
NislinaHi Nislina,
Could you please let me know how do you solve this issue.
Code:
if lt_binary[] is not initial.
* add attachment to document
call method document->add_attachment
exporting
i_attachment_type = 'PDF'
i_attachment_subject = 'My Attachment'
i_att_content_hex = lt_binary.
endif.
Thanks & Regard's
Sateesh -
Outlook 2013 will not Quick Print a PDF attachment on a Windows 8.1 computer
LS,
One of my customers has a Windows 8.1 Computer, Internet Explorer, Office 2013 and Acrobat reader XI (all updated, latest version, etc.).
Whenever my customer gets a email in his outlook with a PDF attachment, he cannot use Quick Print in the menu to print the attachment.
When he does this, simply nothing happens, no error, no nothing and the printer doesn't print. Any other type of attachment appears not to be a problem.
If I use a different program to open the PDF than with a little work around I can open the PDF and than print it.
Of course my customer would prefer to use Adobe reader.
Do you have a solution for this problem??
Kind regards,
Clemens LindersI read somewhere that disabling hardware rendering in Internet Explorer could help with a problem like I had with this customer. And also I read somewhere that you can disable some protection security in PDF.
So I did these two things and I thought.... Yes, this is it. I could now print emails that have a PDF attachment.
Unfortunately, my customer called me yesterday and sys he has still got the same problem when trying to print emails that have multiple PDF attachments.
I am running out of ideas, does anybody have an idea how to fix this??
Kind regards,
Clemens Linders -
Email Payment Remittance as PDF
For years we have been emailing and faxing remittances to vendors. As clearly outlined in various posts on SDN, this was accomplished by activating a copy of SAMPLE_PROCESS_00002040. What is unclear to me, however, is how some posts indicate this will output as PDF. This is not the behavior I have experienced. I hope someone can tell me what I am doing wrong.
In configuration "set up payment methods per company code for payment transactions" the SAPScript form is defined (custom form). The email output that is produced is in the body of the email, not as a PDF attachment. How have some of you been getting PDF files attached? Do you have to convert the SAPScript form in the function module? Do you have to change the form name C_FINAA-FORNR to a PDF form created?
Thank you,
CliffHi Cliff,
I think you can do it via SCOT transaction at INT node. Customizing there will allow you to convert list, SAPscript/smart form... to PDF format. For more information, see SAP note 171698 - SAPconnect: Formats, conversion, device type.
BR
Sandra
Maybe you are looking for
-
Charge ipod with mini charger?
hi, i just recived a ipod video, but as you all know there is no mains adapter to charge with, but my sister has an ipod mini wich comes with a power adapter thing. i was wondering if its safe to use that power cable for my ipod video. thanks in adva
-
ITunes wont open after updating to 8.1
Im not having a good night so I hope someone can help Basically my iPhone wont boot up and is asking me to connect it to iTunes to perform a restore, HOWEVER this morning I updated iTunes to 8.1 and now it will not open. When I click the desktop icon
-
When downloading songs from itunes, the first initial synch would be successful and would display the album art in both cover flow and album view. However after the second synch, the album art no longer shows up and is reduced to a black square in th
-
Ipad says need "activation lock" PLEASE HELP
I bought my ipad from a pawn shop last year. I restored it yesterday because I had a lot of storage on it. I'm trying to activate my ipad and it's not letting me. It is saying that I need to use the account that was set up with the ipad. I don't know
-
Hi, I would like to know if i can update the system time/date using java... Thanks, Thiago Nascimento