<?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: transfer PDF to application server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-pdf-to-application-server/m-p/4153337#M993060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use OPEN DATASET... CLOSE DATASET instead of GUI_DOWNLOAD. Look up ABAP Help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2008 21:16:50 GMT</pubDate>
    <dc:creator>Jelena_Perfiljeva</dc:creator>
    <dc:date>2008-07-23T21:16:50Z</dc:date>
    <item>
      <title>transfer PDF to application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-pdf-to-application-server/m-p/4153336#M993059</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;i'm trying to save a pdf of a smartform to the application server(unix). i'm using the function  C13Z_RAWDATA_WRITE, but when opening the pdf from the application server it is blank or can't be opened. the pdf schould be transfered from the application server to an external DMS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i use GUI_DOWNLOAD and save it locally the PDF is ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;has anybody an idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;coding:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* generated result: PDF format
    DATA: l_pdf_xstring  TYPE xstring,
          lt_lines       TYPE TABLE OF tline,
          ls_line        TYPE tline,
          l_pdf_len      TYPE i,
          h_file LIKE rcgiedial-iefile,
          h_file_size TYPE i,
          i_rcgrepfile_tab TYPE rcgrepfile OCCURS 0 WITH HEADER LINE,
          i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
          h_gui_file TYPE string,
          h_gui_len TYPE i.


    ls_control_param-getotf      = 'X'.
* call smartform
    CALL FUNCTION lf_fm_name
      EXPORTING
        archive_index      = toa_dara
        archive_parameters = arc_params
        control_parameters = ls_control_param
        mail_recipient     = ls_recipient
        mail_sender        = ls_sender
        output_options     = ls_composer_param
        zxekko             = l_doc-xekko  " user_settings = ' '
        zxpekko            = l_doc-xpekko
        nast               = nast
      IMPORTING
        job_output_info    = w_return
      TABLES
        l_xekpo            = l_doc-xekpo[]
        l_xekpa            = l_doc-xekpa[]
        l_xpekpo           = l_doc-xpekpo[]
        l_xeket            = l_doc-xeket[]
        l_xtkomv           = l_doc-xtkomv[]
        l_xekkn            = l_doc-xekkn[]
        l_xekek            = l_doc-xekek[]
        l_xkomk            = l_xkomk
      EXCEPTIONS
        formatting_error   = 1
        internal_error     = 2
        send_error         = 3
        user_canceled      = 4
        OTHERS             = 5.

* get pdf data
    i_otf[] =  w_return-otfdata[].

*now convert the final document (OTF format) into PDF format
    CALL FUNCTION 'CONVERT_OTF'
         EXPORTING
           format                      = 'PDF'
          max_linewidth               = 132
*        ARCHIVE_INDEX               = ' '
*        COPYNUMBER                  = 0
         IMPORTING
           bin_filesize                = l_pdf_len
         TABLES
           otf                         = i_otf
           lines                       = lt_lines
         EXCEPTIONS
           err_max_linewidth           = 1
           err_format                  = 2
           err_conv_not_possible       = 3
           err_bad_otf                 = 4
           OTHERS                      = 5.


    h_file_size = l_pdf_len.
    i_rcgrepfile_tab[] = lt_lines[].
* transfer to application server
    CALL FUNCTION 'C13Z_RAWDATA_WRITE'
      EXPORTING
        i_file                 = h_file
        i_file_size            = h_file_size
*   I_LINES                = 0
*   I_FILE_OVERWRITE       = ESP1_TRUE
      TABLES
        i_rcgrepfile_tab       = i_rcgrepfile_tab
     EXCEPTIONS
       no_permission          = 1
       open_failed            = 2
       ap_file_exists         = 3
       OTHERS                 = 4
              .
    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.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 12:50:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-pdf-to-application-server/m-p/4153336#M993059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T12:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: transfer PDF to application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-pdf-to-application-server/m-p/4153337#M993060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use OPEN DATASET... CLOSE DATASET instead of GUI_DOWNLOAD. Look up ABAP Help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 21:16:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-pdf-to-application-server/m-p/4153337#M993060</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2008-07-23T21:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: transfer PDF to application server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-pdf-to-application-server/m-p/4153338#M993061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i had to use the binary pdf data (bin_file). then the upload with "open dataset" to the application server works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greetz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'CONVERT_OTF'
         EXPORTING
           format                      = 'PDF'
          max_linewidth               = 132
*        ARCHIVE_INDEX               = ' '
*        COPYNUMBER                  = 0
         IMPORTING
           bin_filesize                = l_pdf_len
           bin_file                    = l_pdf_xstring       " binary file
         TABLES
           otf                         = i_otf
           lines                       = lt_lines
         EXCEPTIONS
           err_max_linewidth           = 1
           err_format                  = 2
           err_conv_not_possible       = 3
           err_bad_otf                 = 4
           OTHERS                      = 5.


    CONCATENATE '/PO/BIN_' l_doc-xekko-ebeln '.PDF' INTO h_file.


    OPEN DATASET h_file FOR OUTPUT IN BINARY MODE.
    CHECK sy-subrc EQ 0.
    TRANSFER l_pdf_xstring  TO h_file.
    CLOSE DATASET h_file.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2008 12:00:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-pdf-to-application-server/m-p/4153338#M993061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-30T12:00:33Z</dc:date>
    </item>
  </channel>
</rss>

