<?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: File reading in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592191#M1082929</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Sukriti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code looks good but there is one question with me suppose if the last 8 characters are repeating then in that case what file will be accepted.&lt;/P&gt;&lt;P&gt;EXample today there is a file JS.......10:20:20&lt;/P&gt;&lt;P&gt;tomorrow at the same time file is savd then JS....10:20:20&lt;/P&gt;&lt;P&gt;in this case which file is read. Just for interest i have asked this have you thought of this too.?If any solutions then that make your code more valuable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Oct 2008 11:16:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-25T11:16:38Z</dc:date>
    <item>
      <title>File reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592184#M1082922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;For example :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a file in 'C:\file\' folder as JN01.BP01.01:02:87&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Except the first 9 chars JN01.BP01 all the other (01:02:87) will vary time by time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how can i set that path for the said above file just by comparing first 9 chars .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : The file type could be excel or text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 07:53:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592184#M1082922</guid>
      <dc:creator>sivaprasad_ml</dc:creator>
      <dc:date>2008-10-25T07:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: File reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592185#M1082923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Siva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are saying that your file will be varying time by time so that case my suggestion is why dont you create a F4 help to read you file and one more requirement you are saying like it may be .xls or .txt so better call F4_FILENAME so that you can call any file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: P_FNAME LIKE RLGRAP-FILENAME OBLIGATORY.&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME .&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;program_name = syst-cprog&lt;/P&gt;&lt;P&gt;dynpro_number = syst-dynnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;file_name = P_FNAME&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;So in this you can able to call type of file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 07:57:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592185#M1082923</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T07:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: File reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592186#M1082924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CONCATENATE 'C:\file\JN01.BP01.' &amp;lt;VAR&amp;gt; INTO &amp;lt;FOLDER&amp;gt;.
CONDENSE &amp;lt;FOLDER&amp;gt; NO-GAPS.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;VAR&amp;gt; contains the '01:02:87'.&lt;/P&gt;&lt;P&gt;now u have to find a way on how to get 01:02:87.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 08:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592186#M1082924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T08:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: File reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592187#M1082925</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;Thansk for the reply. But here in my case the user is not allowed to select the path. This program has a preassigned path where it fetches the flat file from a predefiled location.'C:\file\'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Human intervention is now allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what cani do in this regard ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 08:02:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592187#M1082925</guid>
      <dc:creator>sivaprasad_ml</dc:creator>
      <dc:date>2008-10-25T08:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: File reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592188#M1082926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siva,&lt;/P&gt;&lt;P&gt;I think its pretty tricky requirement as like i am thinking for the logic how could we interpret the file path dynamically my doubt is how to make understand the system that this is my latest file to be uploaded.&lt;/P&gt;&lt;P&gt;According to my thought we have to code such that last 8 charcters i mean time i.e updated time has to be taken into account and put a breakpoint such that once the file is selected it should not select again.&lt;/P&gt;&lt;P&gt;According to idea try to make orelse will try to code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 08:14:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592188#M1082926</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T08:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: File reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592189#M1082927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Reddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are absoultely rite. this is a very tricky requiremnt. If the tme keeps on varying how can we code it ? For date wecan use  system date in the requored format. But for time we cannot assume coz even a minue change can affect the tracking of file name. rite ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now is thre any way to read an existing file on a location without specifying any name and thenfindisng its name to compare the first 9 chars ??&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;sivaprasad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 08:23:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592189#M1082927</guid>
      <dc:creator>sivaprasad_ml</dc:creator>
      <dc:date>2008-10-25T08:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: File reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592190#M1082928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;think of some different logic....i agree with Reddy.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is the file u want to read, the last file in that directory....or something else.???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this little piece of code may help u...&lt;/P&gt;&lt;P&gt;this program retrieves the filed and folders in a folder(desktop)...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT program_to_to_show_desktop_files_and_execute_them.


DATA: desktop TYPE string,     "----&amp;gt;u can pass ur base folder here
      count TYPE i,
      files TYPE STANDARD TABLE OF file_info WITH HEADER LINE,
      path TYPE string.

cl_gui_frontend_services=&amp;gt;get_desktop_directory( CHANGING desktop_directory = desktop ).
cl_gui_cfw=&amp;gt;flush( ).
cl_gui_frontend_services=&amp;gt;directory_list_files( EXPORTING directory = desktop
                                                CHANGING  file_table = files[]
                                                          count = count ).
LOOP AT files.
  WRITE:/ files-filename.
  CLEAR files.
ENDLOOP.

AT LINE-SELECTION.
  CONCATENATE desktop '\' sy-lisel INTO path.
  cl_gui_frontend_services=&amp;gt;execute( EXPORTING application = path )  .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 08:36:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592190#M1082928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T08:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: File reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592191#M1082929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Sukriti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code looks good but there is one question with me suppose if the last 8 characters are repeating then in that case what file will be accepted.&lt;/P&gt;&lt;P&gt;EXample today there is a file JS.......10:20:20&lt;/P&gt;&lt;P&gt;tomorrow at the same time file is savd then JS....10:20:20&lt;/P&gt;&lt;P&gt;in this case which file is read. Just for interest i have asked this have you thought of this too.?If any solutions then that make your code more valuable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 11:16:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592191#M1082929</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-25T11:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: File reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592192#M1082930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Reddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file name wont repeat. The ile name is a combination of date and time. So one day only file will be placed at the interface level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So from the abov code we can get all the files from the given location folder and we can compare the date to sy-date with requored formats and confirm the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks any way for all the supports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Sivaprasad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2008 11:41:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/file-reading/m-p/4592192#M1082930</guid>
      <dc:creator>sivaprasad_ml</dc:creator>
      <dc:date>2008-10-25T11:41:49Z</dc:date>
    </item>
  </channel>
</rss>

