<?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: Program for uploading file on application server... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-uploading-file-on-application-server/m-p/2177169#M462512</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;you can do it using SE37 function test with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION 'ARCHIVFILE_CLIENT_TO_SERVER'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can handle anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Apr 2007 22:35:51 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2007-04-26T22:35:51Z</dc:date>
    <item>
      <title>Program for uploading file on application server...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-uploading-file-on-application-server/m-p/2177167#M462510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created a program to upload a file from presentation server (local desktop) to application server. But in this program I have to specify the file length. What should I do in given program so that I can upload file of any length on application server ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  Z_FILE_DOWNLOAD_TO_APP_SERVER                               *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*


* This Program can be used to move flat files to application server from presentation server.

REPORT  Z_FILE_DOWNLOAD_TO_APP_SERVER.


PARAMETERS: P_FILE       LIKE IBIPPARMS-PATH,
           P_FILE1(20000) default 'E:CONVERSIONFLAT' lower case.

DATA: WS_FILE TYPE STRING.

DATA: BEGIN OF T_DATA OCCURS 0,
       RECORD(20000),
     END OF T_DATA.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'F4_FILENAME'
 EXPORTING
  PROGRAM_NAME        = SYST-CPROG
  DYNPRO_NUMBER       = SYST-DYNNR
  FIELD_NAME          = ' '
 IMPORTING
  FILE_NAME           = P_FILE
         .

START-OF-SELECTION.

WS_FILE = P_FILE.

CALL FUNCTION 'GUI_UPLOAD'
 EXPORTING
   FILENAME                      = WS_FILE
  FILETYPE                      = 'ASC'
 TABLES
   DATA_TAB                      = T_DATA
 EXCEPTIONS
  FILE_OPEN_ERROR               = 1
  FILE_READ_ERROR               = 2
  NO_BATCH                      = 3
  GUI_REFUSE_FILETRANSFER       = 4
  INVALID_TYPE                  = 5
  NO_AUTHORITY                  = 6
  UNKNOWN_ERROR                 = 7
  BAD_DATA_FORMAT               = 8
  HEADER_NOT_ALLOWED            = 9
  SEPARATOR_NOT_ALLOWED         = 10
  HEADER_TOO_LONG               = 11
  UNKNOWN_DP_ERROR              = 12
  ACCESS_DENIED                 = 13
  DP_OUT_OF_MEMORY              = 14
  DISK_FULL                     = 15
  DP_TIMEOUT                    = 16
  OTHERS                        = 17
         .
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.

* Creating the file at Appl server............................
OPEN DATASET P_FILE1 FOR OUTPUT IN TEXT MODE encoding utf-8.
if sy-subrc ne 0.
 message e000(--) with 'Error in opening file'.
endif.

* Trasfer the records to file.............
loop at t_data.
 transfer t_data to p_file1.

endloop.

close dataset p_file1.
if sy-subrc eq 0.
 write: / 'Written the files at ', p_file1.
 write:/ 'Goto AL11 Transaction and then click on SAP Directory DIR_SAPUSERS to look for the file'.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 20:43:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-uploading-file-on-application-server/m-p/2177167#M462510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T20:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Program for uploading file on application server...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-uploading-file-on-application-server/m-p/2177168#M462511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try declaring it as TYPE STRING. Not sure though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two predefined types in ABAP with variable length:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;STRING for character strings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;XSTRING for byte strings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SKJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 20:55:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-uploading-file-on-application-server/m-p/2177168#M462511</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-26T20:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Program for uploading file on application server...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-uploading-file-on-application-server/m-p/2177169#M462512</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;you can do it using SE37 function test with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION 'ARCHIVFILE_SERVER_TO_CLIENT'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION 'ARCHIVFILE_CLIENT_TO_SERVER'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can handle anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2007 22:35:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-uploading-file-on-application-server/m-p/2177169#M462512</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-04-26T22:35:51Z</dc:date>
    </item>
  </channel>
</rss>

