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

Reg:system dates

Former Member
0 Likes
939

Hi Experts,

Is it possible to decrement the sy-datum value?

Regards,

Keerthi vasan.M

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
912

HI,

u have to change the server date then it will be changed.

if u want to change programatically use as below.

data:dat type sy-datum.

dat = sy-datum - 1.

write:/ dat.

rgds,

bharat.

9 REPLIES 9
Read only

Former Member
0 Likes
912

Hi,

In your program yes you can do that but it is not recommended to change the value of SYST fields.

Regards,

Atish

Read only

Former Member
0 Likes
913

HI,

u have to change the server date then it will be changed.

if u want to change programatically use as below.

data:dat type sy-datum.

dat = sy-datum - 1.

write:/ dat.

rgds,

bharat.

Read only

Former Member
0 Likes
912

hi,

You can move sy-datum value to a variable and then decrement it.

Reward points if useful.

Thanks and Regards,

Litta

Read only

Former Member
0 Likes
912

No, you can not change system field value. Instead get SY_DATUM into a DATE variable and perform your operation.

ashish

Read only

Former Member
0 Likes
912

HI Keerthi,

Move sy-datum value to variable type date and then decrement it by 1.

data : d_date type date.

d_date = sy-datum.

d_date = d_date - 1.

Regards,

Hemant

Read only

Former Member
0 Likes
912

Hi,

You can change it in program

just try this

data date type d.

sy-datum = sy-datum - 1.

MOVE sy-datum TO date.

WRITE / date.

Regards,

Atish

Read only

Former Member
0 Likes
912

The sy_datum can be decremented usign the following piece of code.

DATA date TYPE d.

[

date = sy_datum - 1.

]

or

[

sy-datum = sy-datum - 1.

MOVE sy-datum TO date.

]

WRITE ' The modified date is : ' , date.

Both the way will take you to the final desired result.

Read only

Former Member
0 Likes
912

Hi Keerthi,

you can do like

ws_date = sy-datum - 1.

Reward if Useful.

Regards,

Chitra

Read only

Former Member
0 Likes
912

This message was moderated.