Email PDF attachements
email PDF attachements that are open in ibooks will not close , and cant return to mail box in box
This has happened to other users too. There seems to no solution to prevent it from happening. You can restore you iPad to service by either resetting your iPad:
Press and hold both the Sleep/Wake button and the
Home button for at least ten seconds, until the Apple logo appears.
Or for some people turning of and then back on the specific Mail account in Setting does the trick.
Similar Messages
-
In my Mac Mail Version 4.5, I am not received email pdf attachement. It is shown in some html like form in message content. Please help
Erdygirl please be aware you are posting to a public forum. I have removed your personal information from your previous post.
Please check your account at http://www.adobe.com/ to locate your serial number. You can find more information on how to locate your serial number at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html. -
Email PDF attachment not opening error
Hi All,
I am sending the PDF attachment through email when i get the mail and opening the attachment the PDF says "A drawing error occurred'. Can any one tell me how to solve this problem.
i am doing otf to pdf conversion and the populate all the field related to the email.
Is there any specific solution for this error.
Regards,
LakshmikanthHi All,
I am sending the PDF attachment through email when i get the mail and opening the attachment the PDF says "A drawing error occurred'. Can any one tell me how to solve this problem.
i am doing otf to pdf conversion and the populate all the field related to the email.
Is there any specific solution for this error.
Regards,
Lakshmikanth -
Dunning letter (email) PDF attachment or body of email
Hi experts,
What is the industry practice for dunning letters when sent via email? Attach them as a pdf to the email, or add all the content of the dunning letter to the body of the email to make it easier for the customer to receive the message?
Thanks,
MarioHi Mario,
It all depends on the functionality that and payment option that are provided.
If the dunning letters contains and payment/remittance slip(through which customer can make payment in bank, outlet or post office) than the letter should go as PDF attached to mail with body saying that its the reminder for payment being missed,
But if the payment option is not like as described above than you can send the the letter in html body mail.
Regards -
Can no longer open email PDF attachment in iBooks
Just discovered can no longer open on iPad mini any email attachment PDF file in iBooks. Cannot tap attachment and select open in iBooks. PDF attachment opens itself automatically on the body of the email. Is this a PDF problem or iPad problem or iBooks problem.
It's not a problem with either app. Just hold down on the open PDF to bring up the "open in" window. If hold down on the open PDF and select "Quick Look" , that will give you the full screen file and you will see the share icon in the upper right corner.
-
External Email (PDF Attachment) while PO is created or Changed
Hi All,
I have a requirement as below.
1. When a PO is created / changed then saved, the PO Form is to be sent to the respective vendor through External Email along with the PO Form printout generated.
2. The PO Form is to be attached in the Email (PDF Document).
Please write to me if you have a suitable solution for this requirement.
I have created the PO Form in SAPScript. Is it possible to develop the above requirement in SmarForm? Please suggest me.
Thanks in Advance,
Kannan.Since you are using SAPScript I thought this solution would be simpler. We are also using SAPScript and email all document types when necessary.
1. As suggested before: create an output type as an email type (Same as mornal output just the value 8 for transmission medium).
2. For ease of maintainance I copied the associated printing program to a new program and link this new program to the output type as normal.
3. In your print program make the following changes.
(a) include code below just before your open form. You can read the email address from whereever you have them. In this example they are read from a custom z* table ZEMAIL_TEMP . Sometimes we read them from customer master, vendor master etc.
(b) make sure you have the folowing export parameter in your "START_FORM" Function module
MAIL_RECIPIENT = RECIPIENT_OBJ
4. Make sure your conversion rules are set properly. Transaction code SCOT Setting-->Conversion Rules
SAPScript text is an OTF type. We are converting our forms to PDF so we have the following entry:
Format = OTF
Format to = PDF
Ranking = 1
Function Module = SX_OBJECT_CONVERT_OTF_PDF</b>
5. The are other bells and whistles (like changing the email header) that I can happily share once/if you are happy with your solution.
Hope I am not missing any vital info.
Good Luck -
Emailing PDF attachment. Context is lost...
Hi Folks
In a previous post a asked about how to attach and send a dynamic PDF form.
In the following code I determine the Form Name, get the FORMOUTPUT and add it to an email attachment.
My problem now is that when I look in transaction SOST the attachment doesn't display any of the dynamic info supplied from the context.
Could someone please help to tell me how I need to include this.
<br>
Thanks
<br>
* First get name of the generated function module<br>
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'<br>
EXPORTING<br>
i_name ='ZSFPFLS_EX_WDA_CON'<br>
IMPORTING<br>
e_funcname = fm_name.<br>
<br>
* Set output parameters and open spool job<br>
fp_outputparams-nodialog = 'X'. " suppress printer dialog popup<br>
fp_outputparams-getpdf = 'X'. " launch print preview<br>
fp_outputparams-PDFCHANGESRESTRICTED = 'N'. "Form can be filled out and signed and you can also create comments<br>
<br>
CALL FUNCTION 'FP_JOB_OPEN'<br>
CHANGING<br>
ie_outputparams = fp_outputparams<br>
EXCEPTIONS<br>
cancel = 1<br>
usage_error = 2<br>
system_error = 3<br>
internal_error = 4<br>
OTHERS = 5.<br>
<br>
* Set form language and country (->form locale)<br>
*fp_docparams-fillable = 'X'. "Only set this if the form must be interactive<br>
fp_docparams-dynamic = 'X'. "Only set this if the form must be interactive and dynamic<br>
<br>
* Now call the generated function module<br>
CALL FUNCTION fm_name<br>
EXPORTING<br>
/1bcdwb/docparams = fp_docparams<br>
/1bcdwb/docxml = fp_docxml<br>
IMPORTING<br>
/1bcdwb/formoutput = fp_formoutput<br>
EXCEPTIONS<br>
usage_error = 1<br>
system_error = 2<br>
internal_error = 3<br>
OTHERS = 4.<br>
<br>
* Close spool job<br>
CALL FUNCTION 'FP_JOB_CLOSE'<br>
EXCEPTIONS<br>
usage_error = 1<br>
system_error = 2<br>
internal_error = 3<br>
OTHERS = 4.<br>
<br>
* Now you have the PDF form in xstring format inside the field fp_formoutput-pdf<br>
<br>
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'<br>
EXPORTING<br>
buffer = fp_formoutput-pdf<br>
TABLES<br>
binary_tab = itab.<br>
<br>
TRY.<br>
* " create email objects<br>
l_o_send_request = cl_bcs=>create_persistent( ).<br>
<br>
<br>
* " sender<br>
l_o_sender = cl_cam_address_bcs=>create_internet_address( REPLY_ADDRESS ).<br>
l_o_send_request->set_sender( i_sender = l_o_sender ).<br>
<br>
<br>
* " recipient TO<br>
l_o_recipient = cl_cam_address_bcs=>create_internet_address( ADDRESS).<br>
l_o_send_request->add_recipient(<br>
i_recipient = l_o_recipient<br>
).<br>
<br>
* " create documents<br>
l_o_document = cl_document_bcs=>create_document(<br>
i_type = 'RAW' " RAW document format<br>
i_text = l_it_contents<br>
i_subject = SUBJECT<br>
).<br>
* l_o_send_request->set_document( l_o_document ).<br>
<br>
* " add attachment<br>
l_o_document->add_attachment( EXPORTING i_attachment_type = 'PDF'<br>
i_attachment_subject = SUBJECT<br>
i_att_content_hex = itab ).<br>
l_o_send_request->set_document( l_o_document ).<br>
<br>
* " send email<br>
l_v_ret = l_o_send_request->send( ).<br>
<br>
CATCH cx_bcs INTO bcs_exception.<br>
* exceptions, do something<br>
ENDTRY.<br>
<br>
* never forget this one<br>
COMMIT WORK.
<br>/1BCDWB/DOCPARAMS and /1BCDWB/DOCXML are both generated by default when I create a form from within SE80 in a Web Dynpro View. The Interface gets generated automatically when linking the form to my context on the Web Dynpro View.
fp_docparams-... gets filled:
fp_docparams-langu = 'E'.
fp_docparams-country = 'ZA'.
fp_docxml is of type xstring and is now being filled by the PDFSource binary in my context. (Although this isn't yet producing results)
I still don't see where I can add more parameters to the Interface in Tx SFP. I am in Change Mode, but find no option to add Parameters.
If I do manage to add more parameters, how will I link these in my Form because I can't see the Parameters when in the Layout view of the form in Tx SFP..
Thanks again. Do you have any other suggestions? -
All,
I'm using the following code in a zprogram/FM that will be called in a method to create an attachment to the workflow and then send the attachment through mail. But this is not working.
1) I trigger the wf thru idoc posting - works fine
2) The image is read successfully in the xstring format
3) When the background step is called that in turn calls this FM and supplies the WID of the wf (not the task), no image gets attached. But if i supply the wid of the wf directly and execute this FM in foreground, it attaches. in the background it gives this error "unable to attach the document"
4) in the next mailing step, I've bound the attachments container element = mail step's container element. The mail also doesnt come with the attachments.
Please help.
Thanks,
Sam
Edited by: Rock on Jul 21, 2009 1:26 AMREPORT ysam_im_test_wf.
INCLUDE <cntn01>.
TYPE-POOLS: swlc.
INCLUDE <symbol>.
DATA :
lv_header TYPE swr_att_header,
lv_objsofm TYPE swotobjid-objtype,
lv_objtkey TYPE swotobjid-objkey.
* ls_fitment TYPE r_fitment_mstr,
DATA : lv_xstring TYPE xstring,
att_id TYPE swr_att_id,
lv_return TYPE sy-subrc.
DATA : bo_sofm TYPE swc_object .
DATA: l_docwrapper1 TYPE xstring,
l_existence(1) TYPE c.
DATA: t_message_lines TYPE swr_messag OCCURS 0 WITH HEADER LINE.
PARAMETERS: p_wid TYPE swr_struct-workitemid.
START-OF-SELECTION .
CALL FUNCTION 'ZGEN_IMAGE_DATA_GET'
EXPORTING
i_zuonr = '100028'
IMPORTING
l_docwrapper1 = l_docwrapper1
existence = l_existence
EXCEPTIONS
service_call_error = 1
file_download_error = 2
browser_invoke_error = 3
OTHERS = 4.
lv_xstring = l_docwrapper1.
IF lv_xstring IS NOT INITIAL.
UPDATE tvarv SET low = 'XSTRING'
WHERE name = 'ZSAMTEST1'.
lv_header-file_type = 'B'.
lv_header-file_name = 'Invoice Attachment'.
lv_header-file_extension = 'PDF'.
lv_header-language = 'EN'.
CALL FUNCTION 'SAP_WAPI_ATTACHMENT_ADD'
EXPORTING
workitem_id = p_wid
att_header = lv_header
att_bin = lv_xstring
IMPORTING
return_code = lv_return
att_id = att_id
TABLES
message_lines = t_message_lines.
IF lv_return = 0.
lv_objtkey = att_id-doc_id.
lv_objsofm = 'SOFM'.
swc_create_object bo_sofm lv_objsofm lv_objtkey.
ENDIF. " IF lv_return = 0
ELSE.
att_id = 0.
lv_objtkey = att_id-doc_id.
swc_create_object bo_sofm lv_objsofm lv_objtkey.
ENDIF. -
It used to "open" but somehow must have flipped over to "save as"
Hi Susan,
Welcome to forums.
As you mentioned that you received an email from Adobe. That is a auto generated email by the systems, so you don't need to worry about it, If you download the product today, according to system it starts from today however pratically, trial starts after you installed and first launch it. So please ignore that email
You can install the FM in your desktop and laptop and activate it on both the machines however cannot use it at the same time as per User License Agreement. As Harpeet mentioned the email for support team, you can post your question on forums or to that email.
Hope this answers your query.
Thanks
Priyank -
I have tried a lot to find an app or some way in email to attach multiple of pdf files in one email. I could not find anything that sends multiple pdf file in one email and still keeping the file in simple pdf format for the recipient.
I am not aware of a way except for photos that allows you to select multiple files in an email. I even checked settings in the Adobe Reader app, and it does not show that ability.
-
Want to Send smartform as pdf attachment with a Email to some mail id
Hi ,
I want to send a smartform as a PDF attachment with a mail to a mail id. And I can send a mail with the PDF attachment.
But I am not able to open the PDF. It is throwing some error (Adobe reader could not open u2018fileu2019 because it is either not a supported file type or because the file has been damaged (for example , it was sent as an email attachment and was not correctly decoded)).
By debugging I come to know that the file which is generating is in some encoding format.
Please help me regard this. This is very urgent.
here is the code,
Main Program :
REPORT Ztest_report.
*--Top Include for Global Data Declarations.
INCLUDE ztest_report_top.
*--Form Include for Form Routines.
INCLUDE ztest_report_form.
START-OF-SELECTION.
START-OF-SELECTION.
*--Display data
Perform display_data.
END-OF-SELECTION.
Top declaration :
Internal table
DATA : i_otfdata TYPE tsfotf, " Smart Forms: Table OTF
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
w_mailaddr TYPE ppfdmailad,
w_mailtype TYPE so_escape,
w_mailrecipient TYPE swotobjid,
w_control TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string, "To convert from 132 to 255
wa_objhead TYPE soli_tab,
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-009.
PARAMETER: p_bukrs TYPE bukrs OBLIGATORY, "Company Code
p_belnr TYPE belnr_d OBLIGATORY, "Document No
p_gjahr TYPE gjahr OBLIGATORY, "document type
p_mailid(50) TYPE c OBLIGATORY.
"Mail Id
SELECTION-SCREEN END OF BLOCK blk1.
Form Logic :
FORM display_data.
*Local Variable declaration
DATA: lc_fm TYPE rs38l_fnam, "local variable to store the
l_i_document_output_info TYPE ssfcrespd,
l_i_struc_job_output_info TYPE ssfcrescl,
l_i_struc_job_output_options TYPE ssfcrescl,
i_lines TYPE TABLE OF tline WITH HEADER LINE,
lv_job_output_info TYPE ssfcrescl,
lv_document_output_info TYPE ssfcrespd,
lv_job_output_options TYPE ssfcresop,
lv_bin_filesize LIKE sood-objlen.
Determine the smartform name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTEST_SMARTFORM'
IMPORTING
fm_name = lc_fm
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_control-getotf = 'X'.
w_control-no_dialog = 'X'.
w_control-preview = space.
w_control-device = 'MAIL'.
Call the smartform and pass the selection screen parameter
CALL FUNCTION lc_fm
EXPORTING
control_parameters = w_control
output_options = w_compop
user_settings = 'X'
t_bukrs = p_bukrs
t_belnr = p_belnr
t_gjahr = p_gjahr
IMPORTING
job_output_info = l_i_struc_job_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Moving the Smart Forms: Table OTF into an internal table
i_otfdata[] = l_i_struc_job_output_info-otfdata[].
CONVERT TO OTF TO PDF.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = lv_bin_filesize
TABLES
otf = i_otfdata
lines = i_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-batch EQ l_c_no.
To directly view the print-preview in PDF format
CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
EXPORTING
i_otf = i_otfdata
EXCEPTIONS
convert_otf_to_pdf_error = 1
cntl_error = 2
OTHERS = 3.
For Sending the PDF file to a Mail ID.
LOOP AT i_lines.
TRANSLATE i_lines USING '~'.
CONCATENATE wa_buffer i_lines INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
i_record = wa_buffer.
APPEND i_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
DATA: BEGIN OF zlines OCCURS 0,
tline TYPE char255,
END OF zlines.
*Change the PDF format from 132 to 255.
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
transfer_bin = 'X'
TABLES
content_in = i_lines
content_out = zlines
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Attachment
REFRESH: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
i_objbin[] = zlines[].
Create Message Body Title and Description
i_objtxt = 'test with pdf-Attachment!'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 2.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Attachment (pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 2.
I_OBJPACK-DOC_TYPE = 'RAW'.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = p_mailid.
i_reclist-rec_type = 'U'.
APPEND i_reclist.
Send new document with attachments via RFC
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
WRITE:/ 'Error When Sending the File', sy-subrc.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
ENDFORM. " display_datahi,
i wrote a programm.for me it is working.i think it will help for u.
DATA: t_otfdata TYPE ssfcrescl,
t_lines LIKE tline OCCURS 0 WITH HEADER LINE,
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
t_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
Objects to send mail.
DATA:T_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
T_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.
DATA: w_filesize TYPE i,
w_bin_filesize TYPE i,
wa_ctrlop TYPE ssfctrlop,
wa_outopt TYPE ssfcompop,
WA_BUFFER TYPE STRING, "To convert from 132 to 255
WA_OBJHEAD TYPE SOLI_TAB,
WA_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1.
DATA: form_name TYPE rs38l_fnam,
V_LINES_TXT TYPE I,
V_LINES_BIN TYPE I,
nast-spras type sy-langu value 'DE'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSR_DEMO1'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = form_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
wa_ctrlop-LANGU = nast-spras.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_outopt-tdnoprev = 'X'.
CALL FUNCTION form_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = wa_ctrlop
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = wa_outopt
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = t_otfdata
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
t_otf[] = t_otfdata-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = w_bin_filesize
BIN_FILE =
TABLES
OTF = t_otf
LINES = t_lines
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at t_lines.
TRANSLATE t_lines USING '~'.
CONCATENATE WA_BUFFER T_LINES INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING '~'.
DO.
t_RECORD = WA_BUFFER.
APPEND t_RECORD.
SHIFT WA_BUFFER LEFT BY 255 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH: T_RECLIST,
T_OBJTXT,
T_OBJBIN,
T_OBJPACK.
CLEAR WA_OBJHEAD.
T_OBJBIN[] = T_RECORD[].
Create Message Body Title and Description
T_OBJTXT = 'test with pdf-Attachment!'.
APPEND T_OBJTXT.
DESCRIBE TABLE T_OBJTXT LINES V_LINES_TXT.
READ TABLE T_OBJTXT INDEX V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = 'smartform'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
Main Text
CLEAR T_OBJPACK-TRANSF_BIN.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 0.
T_OBJPACK-BODY_START = 1.
T_OBJPACK-BODY_NUM = V_LINES_TXT.
T_OBJPACK-DOC_TYPE = 'RAW'.
APPEND T_OBJPACK.
Attachment (pdf-Attachment)
T_OBJPACK-TRANSF_BIN = 'X'.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 0.
T_OBJPACK-BODY_START = 1.
DESCRIBE TABLE T_OBJBIN LINES V_LINES_BIN.
READ TABLE T_OBJBIN INDEX V_LINES_BIN.
T_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
T_OBJPACK-BODY_NUM = V_LINES_BIN.
T_OBJPACK-DOC_TYPE = 'PDF'.
T_OBJPACK-OBJ_NAME = 'smart'.
T_OBJPACK-OBJ_DESCR = 'test'.
APPEND T_OBJPACK.
CLEAR T_RECLIST.
T_RECLIST-RECEIVER = 'mail id'.
T_RECLIST-REC_TYPE = 'U'.
APPEND T_RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = T_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = T_OBJBIN
CONTENTS_TXT = T_OBJTXT
RECEIVERS = T_RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
IF SY-SUBRC <> 0.
WRITE:/ 'Error When Sending the File', SY-SUBRC.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
please reward me if helpful. -
Email Invoices to customer as a PDF attachment
Hi,
I have a requirement as follows:-
SAP will get multiple invoice numbers from an external system. I need to send all the invoices(for a given customer) in one pdf and email it to the customer as an attachment.
Please provide your expert and detailed advice.
Thanks,
AniHi Ani,
Go through this u definetly got ur solution.
Here is the code to send the Smartform to mail as PDF attachment.
*& Report ZTEST_NREDDY_PDF_MAIL
REPORT ZTEST_NREDDY_PDF_MAIL.
Internal Table declarations
DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
WA_OBJHEAD TYPE SOLI_TAB,
W_CTRLOP TYPE SSFCTRLOP,
W_COMPOP TYPE SSFCOMPOP,
W_RETURN TYPE SSFCRESCL,
WA_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1,
WA_BUFFER TYPE STRING, "To convert from 132 to 255
Variables declarations
V_FORM_NAME TYPE RS38L_FNAM,
V_LEN_IN LIKE SOOD-OBJLEN,
V_LEN_OUT LIKE SOOD-OBJLEN,
V_LEN_OUTN TYPE I,
V_LINES_TXT TYPE I,
V_LINES_BIN TYPE I.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST'
IMPORTING
FM_NAME = V_FORM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
W_CTRLOP-GETOTF = 'X'.
W_CTRLOP-NO_DIALOG = 'X'.
W_COMPOP-TDNOPREV = 'X'.
CALL FUNCTION V_FORM_NAME
EXPORTING
CONTROL_PARAMETERS = W_CTRLOP
OUTPUT_OPTIONS = W_COMPOP
USER_SETTINGS = 'X'
IMPORTING
JOB_OUTPUT_INFO = W_RETURN
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
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 255 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH: I_RECLIST,
I_OBJTXT,
I_OBJBIN,
I_OBJPACK.
CLEAR WA_OBJHEAD.
I_OBJBIN[] = I_RECORD[].
Create Message Body Title and Description
I_OBJTXT = 'test with pdf-Attachment!'.
APPEND I_OBJTXT.
DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
READ TABLE I_OBJTXT INDEX V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = 'smartform'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
Main Text
CLEAR I_OBJPACK-TRANSF_BIN.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_TXT.
I_OBJPACK-DOC_TYPE = 'RAW'.
APPEND I_OBJPACK.
Attachment (pdf-Attachment)
I_OBJPACK-TRANSF_BIN = 'X'.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
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 = 'smart'.
I_OBJPACK-OBJ_DESCR = 'test'.
APPEND I_OBJPACK.
CLEAR I_RECLIST.
I_RECLIST-RECEIVER = '[email protected]'.
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 When Sending the File', SY-SUBRC.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
If you want to send some text as Body of the Mail then follow this once
when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
I_OBJPACK-TRANSF_BIN = ' '.
I_OBJPACK-HEAD_START = 000000000000001.
I_OBJPACK-HEAD_NUM = 000000000000001.
I_OBJPACK-BODY_START = 000000000000002
I_OBJPACK-BODY_NUM = 000000000000010.
I_OBJPACK-DOC_TYPE = 'RAW'.
append I_OBJPACK-.
by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = '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.
Reward points if helpful.
Thanks
Naveen khan -
Sending an email of the layout in PDF attachement
Hello All,
I have written a program to send the layout in PDF format to send in a mail to the customer.
The email is going fne with the PDF attachement in the development box, but it is not working in Quality box.
In the Quality box the email is going but the attachement is not opening.
I have used CONVERT_OTF function module for converting OTF format to PDF format. As per my analysis it is returning the PDF format properly in Developement box but not the same in Quality. In Quality the the data returning in PDF format is not in proper manner. It is giving some junk data with symbols like traingle, rectange..etc..
I am using FM SO_OBJECT_SEND for sending an email.
Can you please suggest me what may be problem?
Valuable answers will be rewarded.
Thanks & Regards,
Satish.Hi,
you need to save the File in PDF format not in the text format.
check whether the file is saved in pdf format or not.
Regards,
Raj. -
Smartform to OTF to PDF attached to an email ERROR
Hi everyone... I have this problem... I need to send a smartform attached to an email... I'm doing the following:
- Create the OTF using the smartform function importing job_output_info.
- Convert the OTF (job_output_info-otfdata) to PDF using CONVERT_OTF_2_PDF.
- Change the table line's width using SX_TABLE_LINE_WIDTH_CHANGE.
- Send the email using SO_NEW_DOCUMENT_ATT_SEND_API1.
Everything seems to be OK. But When I check the PDF file attached in the email and open it, everything there is a mess. The letters are superimposed over each other and the grills are not painted (instead it shows a black block).
Any ideas how to solve this???
Thanks a lot!!!Try this out..!
<removed by moderator>
To convert the script out put to PDF.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF' u201C FOR out put format
max_linewidth = 132 u201CFor ASCII format: Number of lines in LINES-TDLINE
IMPORTING
bin_filesize = gv_bin_filesize u201CFile size reference
TABLES
otf = gt_otf u201CInput table with OTF format
lines = gt_pdf_tab " Output table with target format
To mail Order in PDF format:
Data declaration part :
DATA: gt_reclist TYPE TABLE OF somlreci1, " SAPoffice: Structure of the API Recipient List
gt_pdf_tab TYPE TABLE OF tline, " SAPscript: Text Lines
gt_otf TYPE TABLE OF itcoo, " OTF Structure
gt_objbin TYPE TABLE OF solisti1, " SAPoffice: Single List with Column Length 255
gt_objpack TYPE TABLE OF sopcklsti1. " SAPoffice: Description of Imported Object Components
DATA: gv_form_name TYPE rs38l_fnam, " Used to store the function module generated by Smartform
gv_bin_filesize TYPE i, " Store the file size
gv_pos TYPE i,
gv_len TYPE i,
gv_tab_lines TYPE i.
DATA : gc_text(11) TYPE c VALUE 'Form Output',
gc_tst(3) TYPE c VALUE 'TST',
gc_testing(30) TYPE c VALUE 'Zellar Sales Document'.
1. Assigning the Description of the object sent in the mail
CLEAR gs_docdata.
gs_docdata-obj_name = gc_tst.
gs_docdata-obj_descr = gc_testing.
Assigning the email id to Structure of the API Recipient List table
CLEAR : gt_reclist, gs_reclist. u201C variables used
gs_reclist-receiver = mail address'. u201CTo whom this mail should go
GS_RECLIST-REC_TYPE = 'U'.
APPEND gs_reclist TO gt_reclist. u201C Internal table for storing mail address
2.Passing the Smart form text lines to SAP office: Single List with Column Length 255 table ,this logic is used to get all the data into PDF file while you send an attachment through mail..
CLEAR: gs_objbin, gs_pdf_tab.
LOOP AT gt_pdf_tab INTO gs_pdf_tab. u201CLoop the content of PDF table
gv_pos = 255 - gv_len.
IF gv_pos > 134. "length of pdf_table
gv_pos = 134.
ENDIF.
gs_objbin+gv_len = gs_pdf_tab(gv_pos).
gv_len = gv_len + gv_pos.
IF gv_len = 255. "length of out (contents_bin)
APPEND gs_objbin TO gt_objbin.
CLEAR: gs_objbin, gv_len.
IF gv_pos < 134.
gs_objbin = gs_pdf_tab+gv_pos.
gv_len = 134 - gv_pos.
ENDIF.
ENDIF.
ENDLOOP.
IF gv_len > 0.
APPEND gs_objbin TO gt_objbin. u201CTable contains Single List with Column Length 255 table
ENDIF.
3. Filling the details in SAPoffice: Description of Imported Object Components table
DESCRIBE TABLE gt_objbin LINES gv_tab_lines.
CLEAR gs_objbin.
READ TABLE gt_objbin INTO gs_objbin INDEX gv_tab_lines.
IF sy-subrc = 0.
gs_objpack-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objbin ).
gs_objpack-transf_bin = 'X'.
gs_objpack-head_start = 1.
gs_objpack-head_num = 0.
gs_objpack-body_start = 1.
gs_objpack-body_num = gv_tab_lines.
gs_objpack-doc_type = 'PDF'.
gs_objpack-obj_name = 'ATTACHMENT'.
gs_objpack-obj_descr = 'test'.
APPEND gs_objpack TO gt_objpack.
ENDIF.
4. Sending the Form Output in the PDF format to email
data: WK_OBJHEAD TYPE SOLI_TAB.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' u201Cfunction module used for sending mail
EXPORTING
document_data = gs_docdata u201CAttributes of new document
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = gt_objpack u201CInformation about structure of data tables
OBJECT_HEADER = WK_OBJHEAD u201CHeader data for document (spec.header)
contents_bin = gt_objbin u201CData which is to be sent as pdf attachment
receivers = gt_reclist u201Cmailing list
EXCEPTIONS u201CException Handling
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.
ELSE.
WRITE 'Sent Successfully'.
ENDIF.
Edited by: Thomas Zloch on Jul 16, 2010 10:38 PM -
Please, I have a PDF attachment in an email on Russian language, how can I open it and convert to WORD (doc.) on Russian?
Hi Senior gal,
If you have purchased the ExportPDF subscription, then just save the PDF to your desktop and follow any of the two mathod mentioned in the article below to convert the PDF to word
http://forums.adobe.com/docs/DOC-2412
~Pranav
Maybe you are looking for
-
Hello All, I would like to increase the Item overview screen in the PO. Currently, I can enter 17 items at one go, if I change the screen resolution the same will increased to 22 line items. My requirement is to enter >100 line items in the PO. Is th
-
Hello, We use Siteminder for authentication to our Portal. When a user is sent a link to a document in KM they are prompted by Siteminder and then they are prompted again by KM. Does anyone know how to remove the second prompt? If the user logs int
-
Replacing in rule file,Essbase
Hi all , I have strings in the source data file as below ABC ABC -0.5 ABC -1..etc Basically this is a smart list .. I am trying to write a rule file for this as below to load to essbase If ABC replace with 0 If ABC -0.5 replace with 1 If ABC -1 repla
-
After substitution of VO, which VO to get in CO ?
I created a substitution, deployed jpx to server, all this works fine. I have a conceptual question : In controller when i try to access the VO, then which one should i grab ? OAViewObject PosViewLinesVO = (OAViewObject)am.findViewObject("EXTENDED_VO
-
Where can I find the Copy-ItemFromAz​ureVM runbook?
Hi, I would like to copy a file from my PC to a VM. I have found the Copy-ItemToAzureVM runbook in the script center, but I can not found the companion runbook Copy-ItemFromAzureVM that is referenced in the Q&A to this runbook. Does anybody know wher