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

system time

Former Member
0 Likes
1,230

Hi All,

I need to get the system (application server) time value in the following format

HHMMSS mmm

(mmm being milliseconds). sy-uzeit is not enough as it does not give me milliseconds.

Is there a function module or another system field for the same ?

regards,

PJ

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,073

Hi,

data time_stamp TYPE timestampl.

GET TIME STAMP FIELD time_stamp.

write time_stamp.

See this weblog.

/people/horst.keller/blog/2004/11/29/abap-geek-8-150-summertime-blues-133

Svetlin

Message was edited by: Svetlin Rusev

5 REPLIES 5
Read only

Former Member
0 Likes
1,073

hi,

RSAP_GET_MILISECS is this FM helpful for you

Cheers,

sasi

Read only

Former Member
0 Likes
1,074

Hi,

data time_stamp TYPE timestampl.

GET TIME STAMP FIELD time_stamp.

write time_stamp.

See this weblog.

/people/horst.keller/blog/2004/11/29/abap-geek-8-150-summertime-blues-133

Svetlin

Message was edited by: Svetlin Rusev

Read only

0 Likes
1,073

Hey SR!!

Yes long timestamp is an option but I am looking for a

3-character value for the fraction part of seconds.

The requirement is to create a file with the timestamp being a part of its name. Using the first 3 of these 7 characters may not always lead to a unique file name.

If i can get the same thing with 3-characters....nothing like it...

regards,

PJ

Read only

0 Likes
1,073

Hi Priyank,

Try calling function module DB_LOCAL_TIME.

This will give you the current time in hours, minutes, seconds, and microseconds. To get milliseconds simply divide the microseconds by 1000. Hopefully this will give you enough digits to create your unique filenames.

Regards,

Tammie

Read only

0 Likes
1,073

Have you tried logical filenames? Define a logical filename and path using tcode FILE. there you can define upto two variables apart from system values to define your filename. This should be enough to provide you the needed uniqueness. We use it here as a standard for all file interfaces.

If these answers helped you, please reward and close the post.

Thanks,

Srinivas