<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem while opening the PDF in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498935#M1257941</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even i had a smilar problem. The reason is perhaps the data in internal table doesnt get converted into PDF corectly. In my case i had to convert into PDF and download on local machine. Attching below code for it.Maybe u can get pointers to your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  REPORT sy-repid
       NO STANDARD PAGE HEADING
       LINE-COUNT 74
       LINE-SIZE  200
       MESSAGE-ID zz.


  PARAMETERS : pcfile LIKE rlgrap-filename LOWER CASE.
  DATA :textlines LIKE tline OCCURS 100 WITH HEADER LINE.

  DATA otf LIKE itcoo OCCURS 1000 WITH HEADER LINE.
  DATA it_lines LIKE tline OCCURS 100 WITH HEADER LINE.
  DATA options LIKE itcpo.
  DATA header LIKE thead.
  DATA result LIKE itcpp.
  DATA: bin_filesize TYPE i.

  DATA: filesize TYPE i,
  convcount TYPE i,
  cancel(1).

************************************************
  AT SELECTION-SCREEN ON VALUE-REQUEST FOR pcfile.
************************************************
    CALL FUNCTION 'WS_FILENAME_GET'
      EXPORTING
        mask     = ',*.*,*.*.'
      IMPORTING
        filename = pcfile
      EXCEPTIONS
        OTHERS   = 1.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  START-OF-SELECTION.
    DATA : BEGIN OF itab OCCURS 0,
            matnr TYPE mara-matnr,
            END OF itab.
    SELECT matnr FROM mara UP TO 10 ROWS INTO TABLE itab.
    LOOP AT itab.
      textlines-tdformat = '*'.
      textlines-tdline = itab-matnr.       APPEND textlines.
    ENDLOOP.

    options-tdgetotf = 'X'.
    options-tdnoprev = 'X'.

    CALL FUNCTION 'PRINT_TEXT'
      EXPORTING
        dialog                   = ' '
        header                   = header
        OPTIONS                  = options
      IMPORTING
        RESULT                   = RESULT
      tables
        lines                    = textlines
        otfdata                  = otf
      EXCEPTIONS
        canceled                 = 1
        device                   = 2
        form                     = 3
        OPTIONS                  = 4
        unclosed                 = 5
        unknown                  = 6
        format                   = 7
        textformat               = 8
        communication            = 9
        bad_pageformat_for_print = 10
        OTHERS                   = 11.
    IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.


    CALL FUNCTION 'CONVERT_OTF'
      EXPORTING
        format                = 'PDF'
      IMPORTING
        bin_filesize          = filesize
      TABLES
        otf                   = otf
        lines                 = it_lines
      EXCEPTIONS
        err_conv_not_possible = 1
        err_bad_otf           = 2.
    DATA : g_file TYPE string.
    g_file = pcfile.

    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        bin_filesize            = bin_filesize
        filename                = g_file
        filetype                = 'BIN'
      TABLES
        data_tab                = it_lines
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mansi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2009 05:06:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-16T05:06:32Z</dc:date>
    <item>
      <title>Problem while opening the PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498934#M1257940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam having an issue while opening the PDF-Attachment in which iam sending it as attachment to the mail.While opening the PDF iam getting the error that "&lt;STRONG&gt;Aodbe Reader could not open the document 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'nt correctly decoded)".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function-module "SO_NEW_DOCUMENT_ATT_SEND_API1" is getting use to send the attachment.&lt;/P&gt;&lt;P&gt;First iam converting the internal table data into PDF and then am sending the mail with PDF-attchment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Asmitha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 04:25:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498934#M1257940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T04:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while opening the PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498935#M1257941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even i had a smilar problem. The reason is perhaps the data in internal table doesnt get converted into PDF corectly. In my case i had to convert into PDF and download on local machine. Attching below code for it.Maybe u can get pointers to your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  REPORT sy-repid
       NO STANDARD PAGE HEADING
       LINE-COUNT 74
       LINE-SIZE  200
       MESSAGE-ID zz.


  PARAMETERS : pcfile LIKE rlgrap-filename LOWER CASE.
  DATA :textlines LIKE tline OCCURS 100 WITH HEADER LINE.

  DATA otf LIKE itcoo OCCURS 1000 WITH HEADER LINE.
  DATA it_lines LIKE tline OCCURS 100 WITH HEADER LINE.
  DATA options LIKE itcpo.
  DATA header LIKE thead.
  DATA result LIKE itcpp.
  DATA: bin_filesize TYPE i.

  DATA: filesize TYPE i,
  convcount TYPE i,
  cancel(1).

************************************************
  AT SELECTION-SCREEN ON VALUE-REQUEST FOR pcfile.
************************************************
    CALL FUNCTION 'WS_FILENAME_GET'
      EXPORTING
        mask     = ',*.*,*.*.'
      IMPORTING
        filename = pcfile
      EXCEPTIONS
        OTHERS   = 1.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  START-OF-SELECTION.
    DATA : BEGIN OF itab OCCURS 0,
            matnr TYPE mara-matnr,
            END OF itab.
    SELECT matnr FROM mara UP TO 10 ROWS INTO TABLE itab.
    LOOP AT itab.
      textlines-tdformat = '*'.
      textlines-tdline = itab-matnr.       APPEND textlines.
    ENDLOOP.

    options-tdgetotf = 'X'.
    options-tdnoprev = 'X'.

    CALL FUNCTION 'PRINT_TEXT'
      EXPORTING
        dialog                   = ' '
        header                   = header
        OPTIONS                  = options
      IMPORTING
        RESULT                   = RESULT
      tables
        lines                    = textlines
        otfdata                  = otf
      EXCEPTIONS
        canceled                 = 1
        device                   = 2
        form                     = 3
        OPTIONS                  = 4
        unclosed                 = 5
        unknown                  = 6
        format                   = 7
        textformat               = 8
        communication            = 9
        bad_pageformat_for_print = 10
        OTHERS                   = 11.
    IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.


    CALL FUNCTION 'CONVERT_OTF'
      EXPORTING
        format                = 'PDF'
      IMPORTING
        bin_filesize          = filesize
      TABLES
        otf                   = otf
        lines                 = it_lines
      EXCEPTIONS
        err_conv_not_possible = 1
        err_bad_otf           = 2.
    DATA : g_file TYPE string.
    g_file = pcfile.

    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        bin_filesize            = bin_filesize
        filename                = g_file
        filetype                = 'BIN'
      TABLES
        data_tab                = it_lines
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mansi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 05:06:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498935#M1257941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T05:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while opening the PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498936#M1257942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might be system related prob not SAP .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because onces its exported then its related to the software which is used to open the PDF &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 05:15:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498936#M1257942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T05:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while opening the PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498937#M1257943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the below link &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/mail" target="test_blank"&gt;https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/mail&lt;/A&gt;&lt;EM&gt;send&lt;/EM&gt;through&lt;EM&gt;output&lt;/EM&gt;controls &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 06:12:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498937#M1257943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-16T06:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while opening the PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498938#M1257944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.........it helped me a lot..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Asmitha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 05:35:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-opening-the-pdf/m-p/5498938#M1257944</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-20T05:35:12Z</dc:date>
    </item>
  </channel>
</rss>

