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: 

SY-DATUM & SY-UZEIT

Former Member
0 Kudos
17,308

Hi ALL,

Is there any conditions of when to use the global or local time in the programs?

i.e. SY-DATUM(global date) instead of SY-DATLO(local date) and SY-UZEIT(global time) instead of SY-TIMLO(local time) in the programs.

Regards,

Anil

1 ACCEPTED SOLUTION

Former Member
0 Kudos
2,672

hi

it does depend on ur requiremnet..

bt it is still better to use global time coz it is the time by which ur database is working.. and sometimes when u use local time it doesnt match with ur database time which can lead to wrong judgement.. bt if u r not dealing with database at dat time u can also use local time depending on ur requiremnet

regards

palak

9 REPLIES 9

Former Member
0 Kudos
2,672

no, all depends on your requirements

amit_khare
Active Contributor
0 Kudos
2,672

The only difference is local and global applicability.

The ABAP runtime environment clock is synchronized with the database server clock at regular intervals in order to calculate the local time of the SAP system. During the synchronization process, the ABAP runtime environment clock is set to the database server clock. Because this happens on all application servers in an SAP system, the ABAP runtime environment clock is synchronous with the clocks on all other application servers and with the database system clock, and thus shows the local time of the entire SAP system. The time zone on which the local time of an SAP system is based is the only entry in the database table TTZCU

~As found in forum.

Former Member
0 Kudos
2,672

Hi,

The following system fields are always set automatically. The GET TIME statement synchronizes the time on the application server with the time on the database server and writes it to the field SY-UZEIT. SY-DATUM and the system fields for the local timezone (SY-TIMLO,SY-DATLO, and SY-ZONLO) are also reset.

SY-DATLO

Useru2019s local date, for example 19981129, 19990628, u2026

SY-DATUM

Current application server date, for example 19981130, 19990627, u2026

SY-TIMLO

Useru2019s local time, for example 154353, 225312, u2026

SY-UZEIT

Current application server time. for example 164353, 215312, u2026

Regards,

Saba

Former Member
0 Kudos
2,673

hi

it does depend on ur requiremnet..

bt it is still better to use global time coz it is the time by which ur database is working.. and sometimes when u use local time it doesnt match with ur database time which can lead to wrong judgement.. bt if u r not dealing with database at dat time u can also use local time depending on ur requiremnet

regards

palak

0 Kudos
2,672

Hi Palak,

can you explain me by giving some examples for "bt if u r not dealing with database at dat time u can also use local time depending on ur requirement".

Regards,

Anil

0 Kudos
2,672

with ref to the above "bt if u r not dealing with database at dat time u can also use local time depending on ur requirement".

I mean example like any database tables ref:CDHDR (change document header) .

Regards,

Anil

Former Member
0 Kudos
2,672

Hi anil,

SY-DATUM, SY-DATLO,SY-UZEIT,SY-TIMLO are system fields which gets filled automatically when a program is executed.It completely depends what is the requirement of your program and what data you want..Generally we go for global dates and time.

-Luck,

Bhumika

0 Kudos
2,672

closing thread.

Refer u201COSS notes 551368 - FAQ: Time zones in FI documentsu201D

Former Member
0 Kudos
2,672

refer 'OSS notes 551368 - FAQ: Time zones in FI documentsu201D