Application Development and Automation 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: 
Read only

FM for getting file creation date

Former Member
0 Likes
1,179

hi,

can anyone tell me how do i get creation date and time of a file (not modified date) ?

Thanks

Tomer

hi,

can anyone tell me how do i get creation date and time of a file (not modified date) ?

Thanks

Tomer

4 REPLIES 4
Read only

bpawanchand
Active Contributor
0 Likes
896

Hi

you can check TRDIR table

Regards

Pavan

Read only

karol_seman
Active Participant
0 Likes
896

Hi Tomer,

please check following link.

[url]http://sap.ittoolbox.com/groups/technical-functional/sap-dev/function-module-to-get-data-and-time-of-file-576751[url]

Regards,

Karol

Read only

anversha_s
Active Contributor
0 Likes
896

Hi,

Please try thie code.

REPORT ztest.

TABLES epsf.

PARAMETERS dir  LIKE epsf-epsdirnam DEFAULT '/home/user1/'.
PARAMETERS file LIKE epsf-epsfilnam DEFAULT 'file001.dat'.
DATA : mtime TYPE p DECIMALS 0,
            time(10),
           date LIKE sy-datum.
 
CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
     EXPORTING
          file_name              = file
          dir_name               = dir
     IMPORTING
          file_size              = epsf-epsfilsiz
          file_owner             = epsf-epsfilown
          file_mode              = epsf-epsfilmod
          file_type              = epsf-epsfiltyp
          file_mtime             = mtime
     EXCEPTIONS
          read_directory_failed  = 1
          read_attributes_failed = 2
          OTHERS                 = 3.
 
*The subroutine p6_to_date_time_tz is sap std present in rstr0400.

PERFORM p6_to_date_time_tz(rstr0400) USING mtime
                                           time
                                           date.
WRITE: / mtime,
            / date, time.

Regards,

Anversha

Read only

0 Likes
896

Hi Gurus Thanks for ur reply,

I have same problem to get creation date of files in Application server

what u send code i tried but it shows date is"01/01/1970" but actual creation date is "04/14/2008" could u tel me how to get actual date of the files in APP.Server.

Thanks in Advance.

sivakumar