on 12-09-2009 7:36 AM
Hi All,
In smartform i am sending a mail with attachemnt as PDF file,there is one more option like preview of smartform .
issue is like i am able to see the preview of the same record but when it is sent in mail attachement,and while opening PDF its showing error that file can not be open it is corrupted.
Please help.
Mona Singh.
Hello. I have exactly the same problem. I return the OTF data from the Smartform and call the function CONVERT_OTF.
If I now do a GUI_DOWNLOAD, I can open the PDF file as expected, but when I send the file as an attachment in an e-mail (using f.m. SO_NEW_DOCUMENT_ATT_SEND_API1) I cannot open the PDF file. Instead it gives an error message, " cannot open file, file is damaged". I have attached the function module that I call directly after calling the smartform. Can anybody help? I am using a ECC 6.0 System, Basis SP level 19 but had the same problem on v 4.7.
I tried to attach the code (I have tried with several sample programs provided on this forum), but it doesn't format correctly. Can someone give me a tip how to stop program code displaying in continuous text.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Prefer to use CL_BCS instead of function module, because this last is rather complex to use (when you don't know how it works you may easily get this kind of error).
The most frequent errors are the transmission of an incorrect binary length, or binary data was incorrectly converted (often because of Unicode systems).
You may generate manually the right PDF (smart form print preview, use PDF! in okcode field to display the PDF), and compare its binary content (bytes) with the PDF you currently generate (by comparing automatically or manually with any external softwares).
Dear Sandra
That was my problem: binary data was incorrectly converted (often because of Unicode systems).
I returned
bin_filesize = v_len_in
bin_file = l_binfile
from the function module CONVERT_OTF, then converted the xstring data (l_binfile) into an internal table (t_objbin) to send to the mail send function with the following function module:
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = l_binfile
IMPORTING
output_length = v_lines_bin
TABLES
binary_tab = t_objbin.
Many thanks for your help.
Best regards
Patricia
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.