Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos
190

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos
111

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

4 REPLIES 4

Former Member
0 Kudos
112

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

0 Kudos
111

Hi Christian,

thanks for your answer.

I have check the method via se24 and i get only the filename.

i tried it also in abap. I have problems with the declaration of

tab_file. can you show, how do you declare it?

thanks.

regards, Dieter

0 Kudos
111

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

Former Member
0 Kudos
111

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..