<?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: Real time file exist check... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373467#M1040600</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;Thanks for all the inputs. BUt what I was asking is real time checking on the local PC drive/directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above suggestions are only can be triggered once. I heard someone...in JAVA, we can use something like LISTENER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this available in ABAP?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Aug 2008 06:51:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-20T06:51:51Z</dc:date>
    <item>
      <title>Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373464#M1040597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would like to ask, is there any way in ABAP to create a real-time file(S) exist check let's say in local PC drive/directory? &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>Wed, 20 Aug 2008 05:46:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373464#M1040597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T05:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373465#M1040598</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;1. TMP_GUI_GET_FILE_EXIST&lt;/P&gt;&lt;P&gt;    We can use the above Fm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If the file does not exist, it will the parameter FILESIZE = -1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  If the file exists, it will return the filesize, and also&lt;/P&gt;&lt;P&gt;  if it is a folder or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 06:20:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373465#M1040598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T06:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373466#M1040599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the class cl_gui_frontend_services. Based on the RESULT parameter you can check if file exists or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPE-POOLS : abap.

DATA : l_result TYPE abap_bool.

CALL METHOD cl_gui_frontend_services=&amp;gt;file_exist
  EXPORTING
    file                 = 'C:\boot.ini'
  RECEIVING
    result               = l_result
  EXCEPTIONS
    cntl_error           = 1
    error_no_gui         = 2
    wrong_parameter      = 3
    not_supported_by_gui = 4
    OTHERS               = 5.

IF l_result = 'X'.
  WRITE : 'File Exists'.
ELSE.  
  WRITE : 'File does not Exists'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajvansh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rajvansh Ravi on Aug 20, 2008 8:31 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 06:24:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373466#M1040599</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T06:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373467#M1040600</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;Thanks for all the inputs. BUt what I was asking is real time checking on the local PC drive/directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above suggestions are only can be triggered once. I heard someone...in JAVA, we can use something like LISTENER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this available in ABAP?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 06:51:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373467#M1040600</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T06:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373468#M1040601</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;1. If you are talking about real time, &lt;/P&gt;&lt;P&gt;  then in that case the z program will continuously run (in foreground ofcourse).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; It will continually check (eg. every 1 second) for the existence of file - using the FM or class method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. In such continous checking, we have to use the timer concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Below is a program which continuosly&lt;/P&gt;&lt;P&gt;   checks for the existence of file&lt;/P&gt;&lt;P&gt;   D:\abc.txt&lt;/P&gt;&lt;P&gt;  (u can change that file in the program)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If the file is not found (continously) it keeps on&lt;/P&gt;&lt;P&gt;   displaying 'File NOT Found'&lt;/P&gt;&lt;P&gt;   if found it displays 'File FOUND'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Just copy paste to get a taste of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


REPORT abc NO STANDARD PAGE HEADING.

DATA : wa(72) TYPE c.


*-------------------------------------

CLASS my DEFINITION.

PUBLIC SECTION.

METHODS : run_handler FOR EVENT finished OF cl_gui_timer.

ENDCLASS. "my DEFINITION

DATA timer TYPE REF TO cl_gui_timer.
DATA myh TYPE REF TO my.


*---------------------------------------------------------------------*
* CLASS my IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS my IMPLEMENTATION.
METHOD run_handler.
CALL METHOD timer-&amp;gt;run.
PERFORM mylist.
ENDMETHOD. "run_handler

ENDCLASS. "my IMPLEMENTATION

*-------------------------------------


*-------------- Init

INITIALIZATION.

CREATE OBJECT timer.
CREATE OBJECT myh.
SET HANDLER myh-&amp;gt;run_handler FOR ALL INSTANCES.


* PARAMETERS : a TYPE c.

*----------- End of selection

START-OF-SELECTION.

WRITE sy-uzeit TO wa.
WRITE wa.
timer-&amp;gt;interval = '0.5'.
CALL METHOD timer-&amp;gt;run.



*---------------------------------
FORM mylist.

*--------------------------
*WRITE sy-uzeit TO wa.

data : filesize type i.

CALL FUNCTION 'TMP_GUI_GET_FILE_EXIST'
  EXPORTING
    FNAME                = 'D:\abc.txt'
 IMPORTING
*   EXIST                =
*   ISDIR                =
   FILESIZE             = filesize
 EXCEPTIONS
   FILEINFO_ERROR       = 1
   OTHERS               = 2
          .

if filesize  = -1.
wa = 'File NOT Found'.
else.
wa = 'File FOUND !!!'.
endif.
MODIFY LINE 1 LINE VALUE FROM wa.

ENDFORM. "MYLIST


&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 07:02:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373468#M1040601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T07:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373469#M1040602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi amit m.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, you have answer what I want accurately. &lt;/P&gt;&lt;P&gt;Really thanks for your sample code. It works at my side :).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a concern, if I write a code to check in file exist every 0.5 second or 1 second. &lt;/P&gt;&lt;P&gt;Will this real time checking affects the whole SAP performance? Will it slow down the application?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 09:05:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373469#M1040602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T09:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373470#M1040603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How could I stop the real- time checking if "File Found"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 09:29:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373470#M1040603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T09:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373471#M1040604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;How could I stop the real- time checking if "File Found"?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Check &lt;STRONG&gt;Sy-subrc&lt;/STRONG&gt; value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 09:30:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373471#M1040604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T09:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373472#M1040605</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;Data : fullpath type string.&lt;/P&gt;&lt;P&gt;data : result type c.&lt;/P&gt;&lt;P&gt;    call method cl_gui_frontend_services=&amp;gt;file_exist&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        file                 = fullpath&lt;/P&gt;&lt;P&gt;      receiving&lt;/P&gt;&lt;P&gt;        result               = result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if result is not initial.&lt;/P&gt;&lt;P&gt;Write :  'File Exit' .&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write 'File Dose Not Exit'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Durai.V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 10:02:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373472#M1040605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T10:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373473#M1040606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. But where should I include this &lt;STRONG&gt;CHECK&lt;/STRONG&gt; at? which line?&lt;/P&gt;&lt;P&gt;I have tried few places...but not successful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 10:05:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373473#M1040606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T10:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373474#M1040607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Don't worry about load on server 0.5 seconds or 1 seconds&lt;/P&gt;&lt;P&gt;    is no big deal for server. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. This is the slightly modified code&lt;/P&gt;&lt;P&gt;    for stopping if the file is found.&lt;/P&gt;&lt;P&gt;   Just copy paste.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  (There is only one line which I added for stopping if file found)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT abc NO STANDARD PAGE HEADING.

DATA : wa(72) TYPE c.


*-------------------------------------

CLASS my DEFINITION.

PUBLIC SECTION.

METHODS : run_handler FOR EVENT finished OF cl_gui_timer.

ENDCLASS. "my DEFINITION

DATA timer TYPE REF TO cl_gui_timer.
DATA myh TYPE REF TO my.


*---------------------------------------------------------------------*
* CLASS my IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS my IMPLEMENTATION.
METHOD run_handler.
CALL METHOD timer-&amp;gt;run.
PERFORM mylist.
ENDMETHOD. "run_handler

ENDCLASS. "my IMPLEMENTATION

*-------------------------------------


*-------------- Init

INITIALIZATION.

CREATE OBJECT timer.
CREATE OBJECT myh.
SET HANDLER myh-&amp;gt;run_handler FOR ALL INSTANCES.


* PARAMETERS : a TYPE c.

*----------- End of selection

START-OF-SELECTION.

WRITE sy-uzeit TO wa.
WRITE wa.
timer-&amp;gt;interval = '0.5'.
CALL METHOD timer-&amp;gt;run.



*---------------------------------
FORM mylist.

*--------------------------
*WRITE sy-uzeit TO wa.

data : filesize type i.

CALL FUNCTION 'TMP_GUI_GET_FILE_EXIST'
  EXPORTING
    FNAME                = 'D:\abc.txt'
 IMPORTING
*   EXIST                =
*   ISDIR                =
   FILESIZE             = filesize
 EXCEPTIONS
   FILEINFO_ERROR       = 1
   OTHERS               = 2
          .

if filesize  = -1.
wa = 'File NOT Found'.
else.
wa = 'File FOUND !!!'.
*---------- Stop timer if file found
timer-&amp;gt;interval = '0'.
endif.

MODIFY LINE 1 LINE VALUE FROM wa.
ENDFORM. "MYLIST

&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;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 10:08:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373474#M1040607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T10:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Real time file exist check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373475#M1040608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excellent work!&lt;/P&gt;&lt;P&gt;You really help me alot on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2008 11:01:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/real-time-file-exist-check/m-p/4373475#M1040608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-20T11:01:37Z</dc:date>
    </item>
  </channel>
</rss>

