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

Former Member
0 Kudos

experts,

if sy-datum = 00000000.

does sy-datum = sy-datum + 1 implie adding 1 day ,

if so the value of sy-datum should be 01.01.0001

but the value of sy-datum is 02.01.0001.

what does it imply?

thanks in advance.

6 REPLIES 6

valter_oliveira
Active Contributor
0 Kudos

Hi there.

Yes, adding 1 to a date field means adding one day to it.

Date '01.01.0001' is like the time limit, so you cannot add 1 day to some date and the result being the fisrt day. Try to add 1 to '31129999' ... it's the same (you'll get all zeros).

Regards,

Valter Oliveira.

0 Kudos

hi valter,

by your means of answer 00000000 does not have any significance, if so adding 1 to sydatum( = 00000000 ) is resulting in 02.01.0001,why is it so.

thanks in advance

0 Kudos

by your means of answer 00000000 does not have any significance

That's correct. '00000000' for a date variable is it's not like initial value '0.00' for currency, because '0.00' is a relevant price (0 euros, is an offer!) but '00000000' is not even a date.

Regards,

Valter Oliveira.

0 Kudos

hi valter,

why is it resulting in 02.01.0001.

thanks in advance

0 Kudos

OK, my last try

This is from sap help (arythmetic operation):


DATA: result TYPE string, 
      date   TYPE d VALUE '20020704'. 
result = + date. 

The assignment is equivalent to a COMPUTE statement and sets result to the value "731036" - that is, the number of days since 01.01.0001.

Regards,

Valter Oliveira.

Former Member
0 Kudos

hi valter,

thank u for replying.