Problem with opening pdf

Hello,
I dont even know if its  right place to ask but I will give it a try , I do apologise if this is not right place to ask ...When I am opening pdf document attached to the mail sent through sap I am getting an error saying
THE ROOT OBJECT IS MISSING OR INVALID. I dont understand if its programming error or file error ..plz advise..
regards...
Edited by: BrightSide on Jan 8, 2010 10:36 AM
Edited by: BrightSide on Jan 8, 2010 10:36 AM

Hello,
Thanks for your reply.
Code:
*Get Function module name for given smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname = 'ZTEST_SMARTFORM'
    IMPORTING
      fm_name  = fm_name.
CALL FUNCTION fm_name
    EXPORTING
      control_parameters = ssfctrlop
      output_options     = ssfcompop
    IMPORTING
      job_output_info    = it_otf_data
    TABLES
      it_kna1            = it_kna1.
  it_otf_final[] = it_otf_data-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
  format                = 'PDF'
IMPORTING
   bin_filesize          = bin_filesize
    bin_file              =
TABLES
   otf                   = it_otf_final
   lines                 = it_pdfdata[]
EXCEPTIONS
  err_max_linewidth     = 1
  err_format            = 2
  err_conv_not_possible = 3
  err_bad_otf           = 4
  OTHERS                = 5.
DATA binary_content TYPE TABLE OF solix.
DATA:it_pdfdata   TYPE TABLE OF tline WITH HEADER LINE.
DATA:it_pdf       TYPE  TABLE OF  solisti1 WITH HEADER LINE.
  CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
    EXPORTING
      line_width_dst              = '255'
    TABLES
      content_in                  = it_pdfdata[]
      content_out                 = it_pdf[]
    EXCEPTIONS
      err_line_width_src_too_long = 1
      err_line_width_dst_too_long = 2
      err_conv_failed             = 3
      OTHERS                      = 4.
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
    EXPORTING
      line_width_dst              = '255'
    TABLES
      content_in                  = it_pdfdata[]
      content_out                 = it_pdf[]
    EXCEPTIONS
      err_line_width_src_too_long = 1
      err_line_width_dst_too_long = 2
      err_conv_failed             = 3
      OTHERS                      = 4.
*convert string to raw.
  CLASS cl_bcs DEFINITION LOAD.
  DATA:
  lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
  lo_send_request = cl_bcs=>create_persistent( ).
Message body and subject
  DATA:
  lt_message_body TYPE bcsy_text VALUE IS INITIAL,
  lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
  DATA: gt_stxftxt TYPE TABLE OF stxftxt,
        gs_stxftxt TYPE stxftxt.
*-Email body
  REFRESH:  gt_stxftxt.
  SELECT *
    FROM stxftxt
    INTO TABLE gt_stxftxt
    WHERE formname = 'ZINVEMAILTXT'.
  IF sy-subrc = 0.
    SORT gt_stxftxt BY linenr ASCENDING.
    LOOP AT gt_stxftxt
      INTO gs_stxftxt.
      APPEND gs_stxftxt-tdline TO lt_message_body.
    ENDLOOP.
  ENDIF.
  lo_document = cl_document_bcs=>create_document(
  i_type = 'RAW'
  i_text = lt_message_body
  i_subject = 'Order Shipment Notification' ).
Add attachment
    CALL METHOD lo_document->add_attachment
    EXPORTING
      i_attachment_type    = 'PDF'
      i_attachment_subject = 'health'
      i_att_content_hex    = conhex.
Pass the document to send request
  lo_send_request->set_document( lo_document ).
Create sender
Create recipient
Send email
  DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
  lo_send_request->send(
  EXPORTING
  i_with_error_screen = 'X'
  RECEIVING
  result = lv_sent_to_all ).
  COMMIT WORK.

Similar Messages

  • Problem with opening pdf files in Explorer

    I'm trying to use a button to open a pdf file. It's always
    worked in the past, but now I'm receiving an "object error" and the
    pdf is not loading. Does anyone know if this is a problem with the
    new version of Internet Explorer? Any work arounds?
    Here's my code:
    on (release) {
    getURL("NameofDoc.pdf", "_blank");
    }

    Hi,
    1. It's Adobe Reader XI, ver 11.0.08
    I guess the version of the plug-in corresponds with the version of the reader itself?
    2. "Page cannot be displayed", mostly
    Some say it takes a while for the (small) pdf to open, but we could no recreate this behavior yet.

  • Does anyone have a problem with opening PDF files in iBook after updating the program recently

    I need to try to open the pdf file a few times before it goes in iBook.
    It is making me look like a fool cos I use iBook for my presentation to my clients

    I'm presumably having a similar problem with pdf's in ibook.  It seemed to work fine until about two updates ago.  We're using ipad II's with ibook (latest version as of today) for our board of director's reports.  These are sometimes several hundred pages and password protected pdf's.  Now the more whiney members of the board are *******' at me, so I need to find a solution relatively quickly.  Is there a way to back off the updates?
    What it does.
    When a PDF is chosen to open from the library, ibook open a "blank" file -- showing only the ibook background.
    One can try closing and re-opening the PDF and after three or four times it'll open -- seems to be random.
    These PDFs are created in Adobe Acrobat 9.

  • Problem with opening PDF files in Google Chrome browser

    We have a web page displaying links to dynamically generated PDF files located on the internal repository. This files are not just text PDF files but PDF forms created using XFA technology. This means that they must be opened and filled only in Adobe Reader and not in Foxit Reader or browser's built-in PDF viewer.
    Now, the problem is that a Google Chrome browser opens any PDF file using its own PDF viewer. And I want to force this browser to open PDF files in Adobe Reader.
    How can I achieve this without disabling 'Chrome PDF Viewer' plugin since I can't do this for all users of our web site?
    Any help or advice would be greatly appreciated.
    P.S. We use LiveCycle ES3.

    Each user would have to set each browser individually.
    Note: I don't think it's possible to set the default PDF viewer with code for every user who visits the site.
    See the following link to enable Adobe Reader as the default PDF viewer in different browsers:
    http://helpx.adobe.com/acrobat/using/display-pdf-browser-acrobat-xi.html
    Note: Not all PDF viewer browser plug-ins support PDF submissions, and most 3rd party viewers may not support forms created with LiveCycle or forms with Extended Reader Rights enabled.

  • Problem with opening PDF files from JSF page using SDO

    Hi all,
    I'm new with JSF and was attempting to read a PDF file from a Database using SDO and JSF. The code below throws an exception when casting from DataObject to Blob. The getLcDoc() method was created by WSAD when I dragged an SDO relational record onto the JSF page. This method returns an DataObject type which I tried casting to a Blob type before using it further. However, an exception is thrown.
    Any feedback is appreciated.
    Arv
    try {
                   FacesContext faces = FacesContext.getCurrentInstance();
                   HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
                   Blob file= (Blob)getLcDoc().get("ATTACH");
                   int iLength = (int)(file.length());
                   response.setHeader("Content-type", "application/pdf");
                   response.setHeader("Content-Disposition", "inline; filename=Attachment");
                   response.setHeader("Expires","0");
                   response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
                   response.setHeader("Pragma","public");
                   response.setContentLength(iLength);
                   ServletOutputStream os = response.getOutputStream();
                   InputStream in = null;
                   in = file.getBinaryStream();
                   byte buff[] = new byte[1024];
                   while (true) {
                   int i = in.read(buff);
                   if (i<0) break;
                   os.write(buff,0,i);
                   os.flush();
                   os.close();
         } catch(Exception ex){
              System.out.println("Error while reading file : " + ex.getMessage());
         }

    Hi...I found out that there is actually no need to use a Blob object at all. You can simply call the OutputStreams write() method and pass the DataObject.getBytes() method that returns a byte[] array. The revised code is shown at the end of this posting.
    However, a few other teething problems exist:
    1. This works well only if I specify the content type in response.setHeader() method. What if my users upload different types of files, is there a way that the browser opens according to the file type without setting the content type?
    2. I still have a problem opening PDF files, even if I specify - response.setHeader("Content-type", "application/pdf");
    I get the message - The file is damaged and could not be repaired
    3. I would also like this to open the attachment in a new window and using target="_blank" doesn't seem to work as seen below:
    <h:commandLink
                                                 styleClass="commandLink" id="link1" action="#{pc_DocumentDetailsRead.doLink1Action}" target="_blank">
                                                 <h:outputText id="text5" styleClass="outputText"
                                                      value="Click Here"></h:outputText>
                                            </h:commandLink>
    ------------------------Revised code-----------------------------------------
    FacesContext faces = FacesContext.getCurrentInstance();
                   HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
                   response.setHeader("Content-type", "application/msword");
                   response.setHeader("Content-Disposition", "inline; filename=Attachment");
                   response.setHeader("Expires","0");
                   response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
                   response.setHeader("Pragma","public");
                   ServletOutputStream os = response.getOutputStream();
                   os.write(getLcDoc().getBytes("ATTACH"));
                   os.flush();
                   os.close();

  • Adobe Reader 10 problem with opening pdf files

    Ever since I downloaded and installed Adobe Reader 10, I have been unable to open .pdf files from the Internet.  When
    I try to download them, I only the get the option of saving the file, not opening it.  Any help would be appreciated.  Thanks!

    We had similar problems with both the upgrade to 9.4.2 and 10.0.1. We would either get the download/save screen or a black screen would appear and eventually error out and freeze up the machine when we tried to hit pages that loaded pdfs stored in Oracle.  We found the pdfs would load when using Chrome or Firefox.
    We're running winXP SP3 and mainly have users using IE 7 and IE 8.  We were eventually able to solve the problem by doing the following:
    Implementing the code fix outlined in this thread (Response.charset = null;) in the page that pulled pdfs from Oracle: http://forums.adobe.com/message/3476821
    Uninstalling and reinstalling the base version of Reader (9.4.0 or X.0) from users' machines that had gone through the update from 9.x to X.x
    Rebooting the machine after each uninstall or install
    Updating the Reader to either 9.4.2 or 10.0.1
    Now we have users who can successfully load the pdfs from Oracle who are running either 9.4.2 or 10.0.1.
    Hope this helps!

  • I have a problem with opening PDF files downloaded from anywhere!

    I can view them ok in Safari, but when I save and download them, they are displayed with the Preview image and will not open.
    When I click them, a message says that 'the file may be damaged or not recognised by Preview'.
    I have cleaned up my computer (apple help ) but still, the problem remains. I downloaded the same file to my MacBook pro, and it saved it in the usual PDF format, (completely different image from above), and opened perfectly well.
    I have checked the settings in Preview and they seem to be set correctly so that Preview will open PDF files.
    What next?
    I am desperate!
    Jennifer

    See if you can delete any Adobe PDF plugins from /Library/Internet Plug-Ins/. Then quit and re-open your web browser and try again.

  • Problem with open PDF files

    update I did, as you've mentioned, and now it works - let's say in 95%  When I receive an e-mail with PDF, I hit "save", and right away I cannot open the file. However, when I will go back to e-mails list, and wiev once again the same e-mail, I can see the PDF directly from the level of mail. Bit strange, however big improvement comparing to the former situation. Perhaps there is some kind of bug in stock e-mail app?

    Hi, I have following problem with my Xperia Z3:- when I receive the e-mail with PDF as attachement, I can just save it, but cannot open it. It says: "you have no application installed, please install one.."- when I save the file, and open it from File Manager, I can easily open it with Acrobat, Foxit or any other. There's no problem- when I try to do the same directly from "Downloaded" apps, again I cannot open it As I receive some part of e-mails with PDF's, the best way would be to open them directly after saving from e-mail client. Saving them, and then going to File Manager to open makes it more complicated.  Do you know, what can be the problem here? It concern stock e-mail client, Android 5.0 Hope you may know some solution

  • Problem with opening pdf in browser

    Hello
    Acrobat X Pro 10.0.0.396 was installed on PC with Adobe Reader 9 (tried with Reader 10). When I open pdf documents from browser IE 8 or FireFox 3.5 i cann't see Tools panel and buttons from quick area (only Comments and Share).
    plugin in browser - Adobe Acrobat 10.0.0.396 but i think document opens with plugin from Reader. But i deleted it from PC
    thank you in advance

    Each user would have to set each browser individually.
    Note: I don't think it's possible to set the default PDF viewer with code for every user who visits the site.
    See the following link to enable Adobe Reader as the default PDF viewer in different browsers:
    http://helpx.adobe.com/acrobat/using/display-pdf-browser-acrobat-xi.html
    Note: Not all PDF viewer browser plug-ins support PDF submissions, and most 3rd party viewers may not support forms created with LiveCycle or forms with Extended Reader Rights enabled.

  • HT5568 problems with opening PDF files on safari

    in Safari i am not able to view pdf pages when i open link through wed pages, i have to first save it to my desktop and then open to see the pdf files. I have another macbook where i do not have this problem. any solution to this would be great help

    If you want to open a PDF file within Safari, you have two choices. You need to place either item 1 or items 2 in your /Library/Internet Plug-Ins folder.
    Apple Quartz Composer.webplugin
    Adobe Acrobat Reader 11 PDFViewer.plugin and AdobePDFViwerNPAPI.plugin
    Your actions are, again either item 1 or item 2:
    Get a copy of the Apple Quartz Composer webplugin from someone else with the same exact OS X version as you (or reinstall OS X).
    Place in /Library/Internet Plug-Ins
    Permission: 755 root:wheel
    Download and install the latest Adobe Acrobat Reader 11 version for OS XThe installation will place the above Adobe PDF plugins in /Library/Internet Plug-Ins
    If the Apple and Adobe plug-ins co-reside, the Adobe PDF plug-in will overide the Apple Quartz Composer plugin.
    The Adobe PDF viewer has more functionality and is compatible with the latest Safari 6 releases.

  • How to fix problem with opening pdfs in Windows 8.1 with Adobe Reader XI?

    Every time I try to open a pdf on my new laptop with Adobe Reader XI, I get a message than either the file is not supported or its damaged. But it still opens fine on my old laptop with Windows 7.
    Any suggestions?@

    Hi. Thanks for taking the time to answer. Upon further investigation, it appears that the original pdfs I was transferring from my old computer to my new one were “grayed out” on the flash drive, so they wouldn’t open on the new laptop. When I went back and reloaded the pdfs again, they weren’t grayed out, and now everything’s working fine. But again, thanks so much for making the effort to help. I really appreciate it.

  • Strange problem with opening PDF's

    Hello,
    We have roughly 80 users at one location that use a terminal server session to access our medical software.  A certain group of four users that share a network printer have issues within the medical software when they try to open a scanned in document in pdf form.  What happens is that the pdf briefly appears, and then closes.  Any re-attempt to open a pdf results in an error.  The only way I have found to band-Aid the issue is deleted the users profile daily, forcing a new one to be created.  I run a script daily that cleans out all the user profiles temp files, but the issue still occurs.  Any help with this would be greatly appreciated.
    We have Adobe Acrobat 7.0 Pro installed on our terminal servers (this is the only version that is compatible with our medical software.)
    Thanks!

    First of all, this forum is about Adobe Reader, not Adobe Acrobat...
    If I had to guess, I would say that your OS (which you didn't specify) is probably not compatible with your antiquated Acrobat version, which is why you're getting these errors.
    Also, I'm not sure the way you're using Acrobat is conforming with the EULA, which stipulates it can't be used as a server application.

  • Issue with opening PDF file link from Safari

    Hi Everyone,
    I got a problem with opening PDF file link from Safari 4.04. Instead of getting a normal pdf content, it shows some weird characters. Not sure it is something wrong with Adobe Reader Plugin or Safari?
    I have uploaded a screenshot of the issue in the adobe forum (http://forums.adobe.com/thread/531870). Please help!
    Many Thanks,
    John

    There's nothing wrong, except the fact that you have Adobe Reader installed. You don't need it, so get rid of it; it will only cause problems with Safari. What you're seeing is the contents of the PDF file, rather than having it displayed.
    If you want to download a PDF file, you can either Control-click on the link and choose "Download Linked File As…", or you can Option-click on the link for the file and it will be downloaded to your Download folder (usually your Desktop).
    If you want to view a PDF file in Safari, you don't need Adobe Reader; Safari is perfectly capable of doing this by itself and has been for years. Adobe Reader will only get in the way and slow everything down.

  • Problem with opening odf document

    Hello,
    I have some problem with opening pdf document (attached image). Any idea why ?
    Regards,

    Any idea why ?

  • Problem with opening of PDF in my webmail application

    I have a problem with opening a pdf file in my webmail application of my internet provider in apple safari since yesterday. When I wanted to open up a pdf file I got a pop up message to allow a connection between adobe and the webmail application which I did. Since then I can not open up a pdf file. If I go to another browser or if I use email from another internet provider I use too it works and I can open up. It seems to be a blockage of the specific combination of this webmail application and safari.
    What can I do ?

    Hi,
    I have same requirement.
    I need to cnvert smartform->pdf->send mail.
    The mail is send but the attachment is corrupted.
    Can you tell me what code you have written so its working in developement?

Maybe you are looking for

  • Request - EFI/GOP VBIOS - N660 TF 2GD5/OC

    Hello this is my config! Here is the original bios=>N660 TF 2GD5/OC N660 TF 2GD5/OC S/N:602-V287-04SB1210112187 NVIDIA Firmware Update Utility (Version 5.142) Adapter: GeForce GTX 660      (10DE,11C0,1462,2871) H:--:NRM B:01,PCI,D:00,F:00 The display

  • Red Hat 6.2/8i Minium Requirements

    The 8i preinstallation guide talks about setting the kernel, shared memory, and semaphore parameters (SHMMIN, SHMMNI, SHMMAX, etc.). Can't I just leave the default values and just proceed with the install? Did everyone else mess with theirs? I only h

  • Modules fail to load

    Hi there I've been away for some time and for some reason i can't get the installation to work . When arch boots i get the message that modules fail to load , and afterwards when i try to startx , i get a black screen and nothing happens. Also i reme

  • Long posts in I.E. 8 refresh issue

    Recently I've had to upgrade to I.E. 8 on some PCs I work with, and posting from them, I've noted the that editing long posts have refresh issues. I type and the cursor returns to the beginning of the post, and I have to keep scrolling back down. Is

  • Interactive Page Curl - But printing?

    My client is insistent on having an interactive PDF (with mousover zooms, hyperlinks and so on) including a page turn. This is fine, I have read and done the tutorials on iPDFs (exporting as SWF, importing to Acrobat etc). However, the client wants h