Skip to Content
author's profile photo Former Member
Former Member

Need creation- and changing-date of a PC-File

Hi all,

is it possible to get the creation- and changing-date of a file

which is stored on PC or presentation-server?

I will upload the file and avoid, that the entries are inserted in

SAP more than one time.

Perhaps anyone knows a better way?

Thanks

Regards, Dieter

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 08:26 AM

    Hi,

    may be by using cl_gui_frontend_services? For example

    CALL METHOD cl_gui_frontend_services=>directory_list_files

    EXPORTING

    directory = l_temp_dir

    CHANGING

    file_table = tab_file

    count = count.

    LOOP AT tab_file INTO wa_file_table.

    WRITE:/ wa_file_table-filename.

    ENDLOOP.

    In table tab_file there is access time/date and write time/date.

    Regards,

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Christian,

      i solve it in this way:

      DATA: COUNT TYPE I.

      *

      DATA: WA_FILE_TABLE TYPE FILE_INFO,

      TAB_FILE TYPE STANDARD TABLE OF FILE_INFO.

      *

      CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES

      EXPORTING

      DIRECTORY = 'D:\sap\daten'

      FILTER = 'lv.xls' "The file i need Information

      CHANGING

      FILE_TABLE = TAB_FILE

      COUNT = COUNT.

      *

      IF COUNT = 1.

      *

      LOOP AT TAB_FILE INTO WA_FILE_TABLE.

      WRITE:/ WA_FILE_TABLE-FILENAME(20),

      WA_FILE_TABLE-WRITEDATE,

      WA_FILE_TABLE-WRITETIME.

      ENDLOOP.

      *

      ENDIF.

      Thanks for your help

      Regards, Dieter

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 08:36 AM

    1)if file is on PC u can just right click and check the properties to know whn it was created or updated..

    2) u can use methods of class cl_gui_frontend_services.

    3) if u r having some primary key in tha file then u can simply update the data from fiel data.

    4)otherwise u can make use of field last chnage if it exists in ur table to be updated..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.