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

what is SY-DATUM

Former Member
0 Likes
50,371

what is all about sy-datum system variable...explain with simple example

8 REPLIES 8
Read only

Former Member
0 Likes
15,918

It gives the current date.

Read only

Former Member
0 Likes
15,918

Hi Balaji,

SY-DATUM is the system variable that holds the value of current date at runtime

WRITE : sy-datum.

It will give you 03.09.2007 for today

Thanks and Best Regards,

Vikas Bittera.

Read only

VXLozano
Active Contributor
0 Likes
15,918

sy-datum contains the <u><b>SERVER</b></u> system date.

You can get more information about the system values if you go to SE11 and put SYST in the structures field.

The SYST structure has a lot of useful information related with the server, the environment and the application running, check it, you will learn a lot

BTW: in debugging mode, check for sy-datum to get that date, but if you want to get all the system fields, you must check SYST and not SY 😛

Read only

Former Member
0 Likes
15,918

Hi,

Sy-datum contains today's date.

*Example1

data: v_date type sy-datum.

v_date = sy-datum.

write:/5 v_date.

*Example2

write:/5 sy-datum.

Read only

Former Member
0 Likes
15,918

SY-DATUM : Local date of the SAP system. Can be set using GET TIME.

write SY-DATUM4(2) to datechar0(2).

write '/' datechar+2(1).

write SY-DATUM6(2) to datechar3(2).

write '/' TO datechar+5(1).

write SY-DATUM0(4) to datechar6(4).

Value of SY-DATUM 20010616

Here's how the field changes with the execution of each line.

06________

06/_______

06/16_____

06/16/____

06/16/2001

Read only

Former Member
0 Likes
15,918

Hi,

It is the System field which stores Current Date. All the system fields are stored in table SYST. Check it.

SY-DATUM - System Date

SY-UZEIT - System Time

Read only

Former Member
0 Likes
15,918

It will store the current date .You can get this value globally.It is stored in the SYST table , which the table for all system variables.

Kindly reward if it helps.

Thanks and Regards,

Anoop

Read only

Former Member
0 Likes
15,918

hi balaji

Sy-Datum is nothing but pre-defined system variable,which gives you the current system date.

for eg...

REPORT ZPROG.

write : 'current system date :' ,sy-datum.

output:

current system date : 03.09.2007

REWARD IF USEFUL.........!!