<?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 in upload in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975050#M70657</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh yes,  sorry.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0002
       no standard page heading.
 
tables: rlgrap.
 
data: begin of t_itab occurs 0,
      file(1000) type c,
      end of t_itab.
 
data: in_file type localfile value  '/usr/sap/TST/SYS/'.
data: stripped type rlgrap-filename.
data: file_path type rlgrap-filename.
&amp;lt;b&amp;gt;data: new_file_name type rlgrap-filename.&amp;lt;/b&amp;gt;
 
select-options l_file for rlgrap-filename no intervals.
 
loop at l_file.
 
  call function 'WS_UPLOAD'
       exporting
            codepage     = ' '
            filename     = l_file-low
            filetype     = 'ASC'
            headlen      = ' '
            line_exit    = ' '
            trunclen     = ' '
            user_form    = ' '
            user_prog    = ' '
            dat_d_format = ' '
       tables
            data_tab     = t_itab.
  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.
 
 
* Here get the file name from the file path/name
  call function 'SO_SPLIT_FILE_AND_PATH'
       exporting
            full_name     = l_file-low
       importing
            stripped_name = stripped
            file_path     = file_path.
 
* Use the file name as your file name on the app server
* I am assuming that in_File already has the file path to
* the app server here,  just take the file path of app
* server and the file name from presentation and
* put them together.
&amp;lt;b&amp;gt;clear new_file_name.
  concatenate in_file stripped into new_file_name.
 
  open dataset new_file_name for output in text mode.&amp;lt;/b&amp;gt;
  loop at t_itab.
 
    transfer t_itab to in_file .
  endloop.
  if sy-subrc eq 0.
    write:/ 'success'.
  endif.
 
  close dataset in_file.
endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Sep 2005 14:08:56 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2005-09-23T14:08:56Z</dc:date>
    <item>
      <title>Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975044#M70651</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 am stucked at one point while uploading file from desktop to application server.&lt;/P&gt;&lt;P&gt;I have uploaded multiple files  but not able to save them with different names. when i upload files i have to save them dynamically with their names.for ex:&lt;/P&gt;&lt;P&gt;if i have uploaded 3 files together..abc.txt,,abc1.txt,,abc2.txt...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then they should save at server with their names...but &lt;/P&gt;&lt;P&gt;the logic that i have built is appending all the data in one file..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the logic of my code is::;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF t_itab OCCURS 0,&lt;/P&gt;&lt;P&gt; file(1000) type c,&lt;/P&gt;&lt;P&gt;      END OF t_itab.&lt;/P&gt;&lt;P&gt;select-options l_file for rlgrap-filename no intervals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at l_file.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   CODEPAGE                      = ' '&lt;/P&gt;&lt;P&gt;   FILENAME                       = l_file-low&lt;/P&gt;&lt;P&gt;   FILETYPE                      = 'ASC'&lt;/P&gt;&lt;P&gt;   HEADLEN                       = ' '&lt;/P&gt;&lt;P&gt;   LINE_EXIT                     = ' '&lt;/P&gt;&lt;P&gt;   TRUNCLEN                      = ' '&lt;/P&gt;&lt;P&gt;   USER_FORM                     = ' '&lt;/P&gt;&lt;P&gt;   USER_PROG                     = ' '&lt;/P&gt;&lt;P&gt;   DAT_D_FORMAT                  = ' '&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    data_tab                      = t_itab&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; open dataset in_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;LOOP AT t_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANSFER t_itab  TO in_file .&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;write:/ 'success'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET in_file.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the logic that i have built. its working good but appending the data into one file...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz can anyone should suggest the corrections for that..means to say the logic..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 13:37:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975044#M70651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-23T13:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975045#M70652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Everytime thru the loop you will need to set the file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Loop at l_file.
....
in_file  =  'the file path/name'.

open dataset &amp;lt;b&amp;gt;in_file&amp;lt;/b&amp;gt; FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.


....

Endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 13:43:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975045#M70652</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-23T13:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975046#M70653</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 have to change "in_file" also inside the loop every time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  you have to fill "in_file" at the very end with l_file-low for each loop pass..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 13:43:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975046#M70653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-23T13:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975047#M70654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are missing one line I guess&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;in_file = i_file-low.&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;open dataset in_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 13:45:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975047#M70654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-23T13:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975048#M70655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this out.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0002
       no standard page heading.

tables: rlgrap.

data: begin of t_itab occurs 0,
      file(1000) type c,
      end of t_itab.

data: in_file type localfile value  '/usr/sap/TST/SYS/'.
data: stripped type rlgrap-filename.
data: file_path type rlgrap-filename.

select-options l_file for rlgrap-filename no intervals.

loop at l_file.

  call function 'WS_UPLOAD'
       exporting
            codepage     = ' '
            filename     = l_file-low
            filetype     = 'ASC'
            headlen      = ' '
            line_exit    = ' '
            trunclen     = ' '
            user_form    = ' '
            user_prog    = ' '
            dat_d_format = ' '
       tables
            data_tab     = t_itab.
  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.


* Here get the file name from the file path/name
  call function 'SO_SPLIT_FILE_AND_PATH'
       exporting
            full_name     = l_file-low
       importing
            stripped_name = stripped
            file_path     = file_path.

* Use the file name as your file name on the app server
* I am assuming that in_File already has the file path to
* the app server here,  just take the file path of app
* server and the file name from presentation and
* put them together.
  concatenate in_file stripped into in_file.

  open dataset in_file for output in text mode.
  loop at t_itab.

    transfer t_itab to in_file .
  endloop.
  if sy-subrc eq 0.
    write:/ 'success'.
  endif.

  close dataset in_file.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I updated the code a bit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 13:47:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975048#M70655</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-23T13:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975049#M70656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello rich&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have tried the logic that u have forwared it working but i am still facing problem while upload...&lt;/P&gt;&lt;P&gt;Problem that facing now is::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i am uploading single file its working good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if i am uploading 2 or 3 files together then all the file names are conactenating together and that data is coming in one file..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have to write the each upload file independently...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please help in this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will be great help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as its my urgent requierment&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 14:01:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975049#M70656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-23T14:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975050#M70657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh yes,  sorry.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0002
       no standard page heading.
 
tables: rlgrap.
 
data: begin of t_itab occurs 0,
      file(1000) type c,
      end of t_itab.
 
data: in_file type localfile value  '/usr/sap/TST/SYS/'.
data: stripped type rlgrap-filename.
data: file_path type rlgrap-filename.
&amp;lt;b&amp;gt;data: new_file_name type rlgrap-filename.&amp;lt;/b&amp;gt;
 
select-options l_file for rlgrap-filename no intervals.
 
loop at l_file.
 
  call function 'WS_UPLOAD'
       exporting
            codepage     = ' '
            filename     = l_file-low
            filetype     = 'ASC'
            headlen      = ' '
            line_exit    = ' '
            trunclen     = ' '
            user_form    = ' '
            user_prog    = ' '
            dat_d_format = ' '
       tables
            data_tab     = t_itab.
  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.
 
 
* Here get the file name from the file path/name
  call function 'SO_SPLIT_FILE_AND_PATH'
       exporting
            full_name     = l_file-low
       importing
            stripped_name = stripped
            file_path     = file_path.
 
* Use the file name as your file name on the app server
* I am assuming that in_File already has the file path to
* the app server here,  just take the file path of app
* server and the file name from presentation and
* put them together.
&amp;lt;b&amp;gt;clear new_file_name.
  concatenate in_file stripped into new_file_name.
 
  open dataset new_file_name for output in text mode.&amp;lt;/b&amp;gt;
  loop at t_itab.
 
    transfer t_itab to in_file .
  endloop.
  if sy-subrc eq 0.
    write:/ 'success'.
  endif.
 
  close dataset in_file.
endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 14:08:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975050#M70657</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-23T14:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975051#M70658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLear In_file .&lt;/P&gt;&lt;P&gt;concatenate in_file stripped into in_file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 14:09:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975051#M70658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-23T14:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975052#M70659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nop,  don't clear IN_FILE.  its holding our file path.&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 14:11:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975052#M70659</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-23T14:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975053#M70660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Here get the file name from the file path/name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'SO_SPLIT_FILE_AND_PATH'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            full_name     = l_file-low&lt;/P&gt;&lt;P&gt;       importing&lt;/P&gt;&lt;P&gt;            stripped_name = stripped&lt;/P&gt;&lt;P&gt;            file_path     = file_path.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Use the file name as your file name on the app server&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I am assuming that in_File already has the file path to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the app server here,  just take the file path of app&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;server and the file name from presentation and&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;put them together.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;lt;b&amp;gt;clear in_file.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;clear new_file_name.&lt;/P&gt;&lt;P&gt;  concatenate in_file stripped into new_file_name.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  open dataset new_file_name for output in text mode.&lt;/P&gt;&lt;P&gt;  loop at t_itab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    transfer t_itab to &amp;lt;b&amp;gt;new_file_name&amp;lt;/b&amp;gt; .&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;    write:/ 'success'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  close dataset in_file.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 14:12:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975053#M70660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-23T14:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975054#M70661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi rich&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that was really great...thanks for all support...that really solved my query...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if possible just one help more...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i have to check ..that if file exsits then i have to append date with the file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;canu help on this also..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will be great ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 14:42:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975054#M70661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-23T14:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975055#M70662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure, try something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0002
no standard page heading.

tables: rlgrap.

data: begin of t_itab occurs 0,
      file(1000) type c,
      end of t_itab.

data: in_file type localfile value  '/usr/sap/TST/SYS/'.
data: stripped type rlgrap-filename.
data: file_path type rlgrap-filename.
data: new_file_name type rlgrap-filename.

select-options l_file for rlgrap-filename no intervals.

loop at l_file.

  call function 'WS_UPLOAD'
       exporting
            codepage     = ' '
            filename     = l_file-low
            filetype     = 'ASC'
            headlen      = ' '
            line_exit    = ' '
            trunclen     = ' '
            user_form    = ' '
            user_prog    = ' '
            dat_d_format = ' '
       tables
            data_tab     = t_itab.
  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.


* Here get the file name from the file path/name
  call function 'SO_SPLIT_FILE_AND_PATH'
       exporting
            full_name     = l_file-low
       importing
            stripped_name = stripped
            file_path     = file_path.

* Use the file name as your file name on the app server
* I am assuming that in_File already has the file path to
* the app server here,  just take the file path of app
* server and the file name from presentation and
* put them together.
  clear new_file_name.
  concatenate in_file stripped into new_file_name.


* Here we are checking for the file existance, if it has
* been opened sucessfully, then close it, and add the 
* date to the file name and open that file.

 &amp;lt;b&amp;gt; open dataset new_file_name.
  if sy-subrc = 0.
    close dataset new_file_name.
  endif.
  concatenate new_file_name sy-datum into new_file_name.&amp;lt;/b&amp;gt;

  open dataset new_file_name for output in text mode.
  loop at t_itab.

    transfer t_itab to new_file_name .
  endloop.
  if sy-subrc eq 0.
    write:/ 'success'.
  endif.

  close dataset new_file_name.
endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 14:50:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975055#M70662</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-23T14:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975056#M70663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;thats really great of u...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for all ur support..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks ..thanks sir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 14:55:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975056#M70663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-23T14:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975057#M70664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to help,  I've never done this before so it was kind of fun.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2005 14:59:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975057#M70664</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-23T14:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in upload</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975058#M70665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi rich&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please help in this open dataset...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i have to upload same file name 2 times i am able to do that. But if i have to upload same file name 4 0r 5 times i am not able to built a code for that.&lt;/P&gt;&lt;P&gt;User can upload ame file name 10 or 12 times together. And i have to save the file in application server in this format.._2 _2 _2 _2 for all file name that are having same name...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so plz can u suggest the logic for that...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*check for exsistency of file&lt;/P&gt;&lt;P&gt;  open dataset new_file_name for update IN TEXT MODE encoding default.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*if exists then append 2 again with the new filename&lt;/P&gt;&lt;P&gt;concatenate new_file_name '2' into new_file_name&lt;/P&gt;&lt;P&gt;                                                separated by '_'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   close dataset new_file_name.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  open dataset new_file_name for output in text mode encoding default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*looping on Internal table to write all data&lt;/P&gt;&lt;P&gt;  loop at t_itab.&lt;/P&gt;&lt;P&gt;    transfer t_itab to new_file_name .&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above logic is working for two but not for multiples file that have same file name..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so plz can u suggest&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2005 05:17:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-upload/m-p/975058#M70665</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-04T05:17:24Z</dc:date>
    </item>
  </channel>
</rss>

