Error Opening PDFs
Over the last couple of days when I have tried to open PDFs I get a message that says: ' There was an error opening this document. A temporary file could not be created'.
Could anyone shed any light on why this is happening please?
Thankyou
You have a better chance of getting help if you provide more information. Crucially, you didn't even say which version of Acrobat you're using, or which OS version you have.
Similar Messages
-
Error opening PDF downloaded from Interactive Report
hi -- I'm getting an error opening a PDF file downloaded from an interactive report.
I've seen on the forum that this could be related to the size of the file, but I've tried
this out on 10-row results (1k files) and it's still an issue.
I save the file to my file system. If I try to open it in Adobe Reader, I get:
File does not begin with '%PDF-'
and
Adobe Reader could not open <filename>.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).
If I try to open in Internet Explorer, I get:
File does not begin with '%PDF-'
Other users are having the same problem. Download to csv and open in Excel works fine.
Do I need to have special print attributes for this? I didn't think so... I'm just using the defaults
(response header = report settings, content disposition = attachment).
Ideas?
Thanks,
CarolHi,
I'm having the same problem that was described above, and my site does have BI Publisher installed, and it does successfully produce readable pdfs for many reports.
But there are other reports, even reports produced using the Apex Wizard and all defaults, that just keep producing the same Adobe Reader error reported above, ie
"Adobe Reader could not open <filename>.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)."
Any suggestions?
Cheers,
Peter -
Error opening pdf file, but then it still opens
I am having trouble when I open a pdf.I am using the code below to open a pdf.
on mouseUp me
acro = bafindapp("pdf")
if acro = empty then
acrofile = me.pPDF
alert "This program was unable to find a suitable program on your system to open a PDF document. It will open www.adobe.com, where you can download a free viewer"
goToNetPage "http://www.adobe.com"
else
open the moviePath & "Resource\" & me.pPDF with acro
end if
end
When this is on a button, adobe reader will open, but gives an error saying "There was an error opening this document. This file cannot be found."
When I hit the ok button on the error notice, the pdf opens.
Any ideas why I am getting this message even though the pdf opens after dismissing the message would be appreciated.The reason I assumed, or asked, whether it was Windows-only is because of your use of the backslash character as the folder delimiter. To make the script cross-platform try the following:
on mouseUp me
acro = baFindApp("pdf")
if ( acro = EMPTY ) then
alert "This program was unable to find a suitable program on your system to open a PDF document. It will open www.adobe.com, where you can download a free viewer"
goToNetPage "http://www.adobe.com"
else
mPath = _movie.path
tFile = mPath & "Resource" & mPath.char[length(mPath)] & me.pPDF
if baFileExists(tFile) then
OK = baOpenFile(tFile, "normal")
if ( OK < 32 ) then
-- see docs for numbers and their meaning
alert "Error opening file:" && OK
end if
else
alert "File not found:" &RETURN& tFile
end if
end if
end -
Error opening PDF files on the network
I have documents in PDF format on my internal network, but when I open them directly from the network using the Adobe Reader, I get the following message:
"There was an error opening this document. The network path was not found". But this occurs in only a few users, and possibly users who did not have this error, they have. We found that uninstalling and reinstalling the software solves the problem, but then it returns. Is there any explanation?Adobe Reader 11.0.09;
Microsoft Windows 7 Professional;
I'm accessing the file from a local network drive. The file is located in one of our servers. -
Error opening PDF files from search results webpart on anonymous SharePoint 2013SP1 site with IE
Clicking search results, in the strict sense pdf files, using IE on an anonymous SharePint 2013SP1 site, I received the error: There was an error opening this document. The filename, directory name, or volume label syntax is incorrect.
I would like to solve this problem on the server side.
Starting position:
SharePoint 2013 SP1
Web Application:
based on template 'Publishing Portal'
Anonymous Access enabled
Claims based authentication: Integrated Windows Authentication NTLM
Client Integration disabled
Site Collection:
Anonymous Access enabled for 'Entire Web site' => group 'Anonymous Users' was created
added permission to open items: $Web.AnonymousPermMask64 = "ViewListItems, ViewVersions, ViewFormPages, Open, ViewPages, UseClientIntegration, OpenItems"
Client side solutions:
c1) Open Link with “Open in new tab” or “Open in new window” => OK
c2) Disable IE Add-on “Adobe Acrobat Sharepoint OpenDocuments Component” => OK
c3) Set bDisableSharePointFeatures to 1 in regetit => OK
Server side solutions:
S1) Turn off Client Integration => didn't work, still same error
S2) Modify DOCICON.XML => didn't work, still same error
I gave these two options a chance:
first: <Mapping Key="pdf" Value="icpdf.png" OpenControl="SharePoint.OpenDocuments"/>
then: <Mapping Key="pdf" Value="icpdf.png" OpenControl="AdobeAcrobat.OpenDocuments"/>
I modified DOCICON.XML on both hives 14 and 15.
Remarks:
- After changingparameters I allways did an IISreset.
- As far as I understood I can only change bDisableSharePointFeatures on Client Side.
Any help, suggestion, idea wellcome!
Thanks!Hi folks, here's the reason for my problem. I used the oob search result web part. The result items (PDF items) are rendered by the template Item_PDF.html/Item_PDF.js. This template holds a code snippet that assigns a certain OpenControl to the PDF item - that's hard coded. So, no matter what you configure in DOCICON.XML, the PDF item will be opened with the control "PdfFile.OpenDocuments". Solution is e.g. just to leave the OpenControl blank.
template:
/_catalogs/masterpage/Display Templates/Search/Item_PDF.html
/_catalogs/masterpage/Display Templates/Search/Item_PDF.js
code before:
ctx.CurrentItem.csr_OpenControl = "PdfFile.OpenDocuments";
code after:
ctx.CurrentItem.csr_OpenControl = "";
Enjoy
Harry -
Error opening PDF files on anonymous SharePoint 2013SP1 site with IE
Clicking search results, in the strict sense pdf files, using IE on an anonymous SharePint 2013SP1 site, I received the error:
There was an error opening this document. The filename, directory name, or volume label syntax is incorrect.
I would like to solve this problem on the server side.
Starting position:
- SharePoint 2013 SP1
- Web Application:
- based on template 'Publishing Portal'
- Anonymous Access enabled
- Claims based authentication: Integrated Windows Authentication NTLM
- Client Integration disabled
- Site Collection:
- Anonymous Access enabled for 'Entire Web site' => group 'Anonymous Users' was created
- added permission to open items: $Web.AnonymousPermMask64 = "ViewListItems, ViewVersions, ViewFormPages, Open, ViewPages, UseClientIntegration, OpenItems"
- SC-Feature 'Limited-access user permission lockdown mode' disabled
Client side solutions:
c1) Open Link with “Open in new tab” or “Open in new window” => OK
c2) Disable IE Add-on “Adobe Acrobat Sharepoint OpenDocuments Component” => OK
c3) Set bDisableSharePointFeatures to 1 in regetit => OK
Server side solutions:
S1) Turn off Client Integration => didn't work, still same error
S2) Modify DOCICON.XML => didn't work, still same error
I gave these two options a chance:
first: <Mapping Key="pdf" Value="icpdf.png" OpenControl="SharePoint.OpenDocuments"/>
then: <Mapping Key="pdf" Value="icpdf.png" OpenControl="AdobeAcrobat.OpenDocuments"/>
I modified DOCICON.XML on both hives 14 and 15.
Remarks:
- After changingparameters I allways did an IISreset.
- As far as I understood I can only change bDisableSharePointFeatures on Client Side.
Any help, suggestion, idea wellcome!
Thanks!Hi Harry,
From your description, I understand you encountered the issue when open PDF documents from search result page.
Here is a similar thread, please try the piece of code in the page layout for the search results page from Mitch B_83:
https://social.technet.microsoft.com/Forums/appvirtualization/en-US/545efcc6-b748-4df8-aee0-7f57f778ad1e/sharepoint-2010-opening-pdfs-in-search-results-the-filename-directory-name-or-volume-label?forum=sharepointgeneralprevious
You could refer to this for search result page layout: Site settings > Web Designer Galleries > Master pages and page layouts > SearchResults.apsx .
Regards,
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected] .
Rebecca Tu
TechNet Community Support -
Error opening pdf and file can't be found,why
I received an attachment in my BT emails and opened it,then printed it.When I tried to find it so I could copy it to my Outlook emails it had disappeared. Adobe said there had been an error opening it and the file could not be found.What happened and why?
HacienI described what had happened when I tried to view a pdf, and said that when I found the pdf and tried to open it again, all I had was a message telling me there had been “an error” and as a result the file could not be found. I don’t know if it was hidden or deleted and asked “why did it happen”
If Adobe does not give me any more information than that, how am I supposed to give any more information?
It was the first time I had used the Adobe reader, and I was not expecting someone to be so terse in their reply to my query. As the song says, “Everybody’s got to learn some-time.” It would be easier if the ones who DO know could remember the time when they didn’t know.
To avoid further embarrassment, I will withdraw and not attempt to use your forum again. -
I generate PDF documents in code (basically converts TIFF images to PDF, using FOP).
Few of the PDFs can not be viewed on Adobe Reader 9.1.0, and 7.0.9. But, these open fine on 8.0 version.
With 9.1.0 version I get error as "Insufficient Data for image"
With 7.0.9 the error is "A drawing error occured"
8.0 works fine and opens the PDF.
Is there any issue with 9.1.0 for opening PDFs, I got this version installed recently on my system.
Appreciate an early help/views on this issue.
Thanks,
UmakantTry this - from adobe support!
It worked for me and (as it seems) solved a one year long anoying issue.
1. Exit Acrobat.
2. Choose Start > Run, and type: %APPDATA%\Adobe\Acrobat\ into the Open text box. Click OK.
3. Right-click either the 6.0 or 7.0 folder, and choose Delete.
I deleted both folders.
Dont worry these two preferences folders will automatically be renewed by acrobat! -
Error opening PDF on photoshop error code 0X20030055
Hi you all, I desperaly need help.
I've created a pdf file (with illustrator cs3). when I try to open it on photoshop CS3 I receive this message:
"error opening the portable document file (PDF) document. error code = 0X20030055"
I did not find anything helpful online.
I can open this pdf file outside photoshop.
no problem openning other pdf files on photoshop. (i've done it many times before)
help anyone? I'm really stuck..try changing the option while making it (with illustrator cs3)
-
Error opening pdf's from PC stored on Mac
I have been experiencing an error when attempting to open pdf's stored in the public folder on our Mac.
The message reads:
"There was an error opening this document. The file is already open or in use by another application."
It doesn't matter which PC we use to access the pdf's from and happens regardless of which version of Acrobat is being used, the same error occurs.
The public folder on the Mac has no restrictions.
Mac 3.2 GHz Quad-Core Intel
OS 10.9.4
Adobe Creative Suite 2014
*Also discovered none of the InDesign, Photoshop or Illustrator files can opened from PC's can be opened while they are stored on the Mac either.
Thanks,
ChuckThanks for responding. We do not work using a Windows domain.
I can open .txt and Microsoft Publisher files, but I get errors on nearly everything else including any Adobe product files and Word files.
We used to keep files both the PC and Mac had to access on an external network drive, but exporting pdf's from the Mac (as well as opening and saving) took too long. So we moved everything to the Mac. If I have to work on a file I have to drag it to the PC desktop. We can't save directly to the Mac either. Files have to be copied onto the Mac. -
When I click on a PDF link in a website in Internet Explorer 6, I receive the following error: "There was an error opening this document. This file cannot be found." I can choose to save the file to disk and then it opens normally from there. All our computers here should be configured the same and this works properly on another computer.
This originally occurred using Adobe Reader 8.0.0, so I downloaded and installed 8.1.2 and it still is doing the same thing.
I tried right clicking the link to open in a new window but I am receiving the same message either way.
Any help would be appreciated.
Matthew K.Check the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Software\Adobe\Acrobat\Exe
Here check the default value. On an english machine, it has to be set to:
"C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
If you installed Adobe reader to a different directory, enter the path where "AcroRd32.exe" is to be found. -
Error opening PDF using webdynpro
Hello All,
I created a webdynpro application that opens a pdf document using the code described in the following link.
Open PDF in New External Window
I am getting the following error:
"There was an error opening this document. The file is damaged and could not be repaired"
But I am able to open the same file using another ASP application.
Am I missing anything?
Thanks in advance.Nikhil and Vinod,
Thanks for your response. I used this code but it is not working. I am still getting the same error.
In my application, I am not reading the pdf from a file. Instead, it is stored in the database as a blob. I am reading the data using the following code:
Blob pdfBlob = resultSet.getBlob(COLUMNNAME)
byte[] pdf = new byte[1024]
pdf = pdfBlob.getBytes(1,(int)blob.length());
I am storing this value in a context and then displaying it as a pdf. I am using the following code to get bytes
byte[] pdfBytes = wdContext.currentElement().getBLOB(); (BLOB - name of the context attribute where bytes are stored)
and using the following code to open the pdf document (as suggested)
IWDResource pdfResource = WDResourceFactory.createResource(pdfBytes,"test.pdf",WDWebResourceType.PDF);
* wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getUrl(0),"test.pdf").show();*
Am I missing anything here?
How can I force the pdf document to open in a browser window instead of Adobe?
Thanks in advance. -
Hi all,
I'm having problems opening PDF files. I'm using FM CONVERT_OTFSPOOLJOB_2_PDF to generate the file into the server.
Then I'm using class/method VIEWER->VIEW_DOCUMENT_FROM_TABLE to open it. The problem is that some files are opened and others don't.
It appears an error form Adobe Reader 'The file is damaged and can't be repaired ' .All the files are generated in the same way. Any clue what can be?
ThanksYes, they are all the same. I'm using FM 'gv_func_mod_name' to set printer definitions. All outputs have the same.
When I open PDF files directly from the server, there are no errors. It only happens when I use the report. -
Error opening PDF attachment (via email)
Hello,
I've problems to send a PDF file with the function:
'SO_DOCUMENT_SEND_API1'
At first a small overview of my process:
- 'SCMS_DOC_READ' -> to read the file from the archive
- 'SCMS_BINARY_TO_FTEXT' -> to convert from bin. to pdf
- 'SO_DOCUMENT_SEND_API1' -> to send the email
My pdf result:
% P D F - 1 . 4 % â ã Ï Ó 1 0 o b j < < / T y p e
Project scope:
%PDF-1.4%âãÏÓ1 0 obj<</Type
As a result, by opening the PDF file an error occured.
Further information:
objpack-transf_bin = 'X'.
call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data = doc_data
put_in_outbox = ''
commit_work = 'X'
tables
packing_list = objpack
object_header = objhead
contents_bin = data <- PDF content
contents_txt = objtxt
receivers = reclist
exceptionsmost possible reason has been discussed in:
Error in opening PDF attachment -
Error opening PDF file, using Windows Vista
When I first purchased my new pc, regrettably, I was given Windows Vista. There have been a lot of problems. Of late, Adobe Reader gives me an error message when I try to open a downloaded file. I uninstalled and reinstalled Adobe Reader but with no success. Could this be a Vista security issue? I can download and read the file on my work computer which used Windows XP. Also, this problem getting an error message opening and reading a file just recently occurred. I haven't made any changes to my system except automatic program updates. Can you help me?
I stumbled on a solution: Download the PDF file and instead of saying yes to open the file (because you know you'll get the error message), simply go to where you saved the file (i.e. AOL downloads) and open it there. I have no idea why I suddenly cannot open PDF files but at least I found a way to still get my information. Hope this helps.
-
Sending smartform output as PDF attachment, Error opening PDF attachment
Hi Experts,
I am using the code form the following link to send a smartform output as PDF attachment. I can able to see the message, but can not open PDF document.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/convertSmartformtoPDFformat&
The information should be on my smartform are some text, company logo and a barcode.
With all of these received error: "There was an error opening this document. The file is damaged and could not be repaired."
I tried different ways like only text, text with company logo, text with barcode. I got the following errors:
An unrecognized token 'Td0' was found
There was problem reading this document(16).
There was problem reading this document(111).
Does anyone have idea of these ? Your help is greatly appreciated.
Thank you,
Suryaplease see this code ... for sending the Email as PDF attach file,
*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
* Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
* Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
* Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
* Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
* Write statement to represent report output. Spool request is created
* if write statement is executed in background. This could also be an
* ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
*** Alternative way could be to submit another program and store spool
*** id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
* to sap-spool
* spool parameters %_print
* archive parameters %_print
* without spool dynpro
* and return.
* Get spool id from program called above
* IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
* FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
* FORM get_job_details *
FORM get_job_details.
* Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
* FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
* Transfer the 132-long strings to 255-long strings
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.
ENDFORM.
* FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
* perform send_email using p_email2.
ENDFORM.
* FORM send_email *
* --> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
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 .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
* FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
* Send email
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.
reward points if it is usefull ....
Girish
Maybe you are looking for
-
How do I transfer photos from desktop to gmail (compose)?
I can't cut and paste photos from the desktop to gmail (compose) to send them to my family ... Nor can I drag and drop photos or anything else from the desktop to gmail (compose). There must be a simple way to do this because sending photos is a basi
-
ODBC Error while Siebel Server try to connect to Oracle 10G
We have managed to get through with the configuration of siebel server on HP Unix. However before we get to the Database configuration, we are encountering errors with ODBC connection to oracle 10g database. We are able to connect to oracle using sql
-
Any way to stop Update Retriever from downloading Microsoft Updates?
We have roughly 20 different lenovo laptop types in our organization. We would like to have update retriever download all updates for both windows xp and 7 for each laptop into the repository, except windows updates. Since we use WSUS, we do not ne
-
The bottom line to my question is: Can I expect a higher quality, less noise, TV picture from DVD Studio Pro than what I can get using iDVD (BestPerfomance and shorter than 60 minuters)? Considering the encoding bit rates, it looks to me like there s
-
my purchase of symDVR has failed , iam trying to download it again but again i asjed to buy this app your purchase failed