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

Default date and year

Former Member
0 Likes
1,888

Hi Guru's,

Can you please give your suggestions for following requirement..

On selection screen for parameter_period...

( which is in format --- mm-dd-yyyy)

I want default value for

mm-dd as ( 01-01)..

and yyyy as current year ..

For eg ::if execte the program today ,on selection screen in parameter_period field it should dispaly 01-01-2008..

Your suggestions will be rewarded..

Thanks

Parnith,..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,349

Initialization.

concatenate '01-01-' sy-datum+0(4) into parameter_period.

Hi Guru's,

Can you please give your suggestions for following requirement..

On selection screen for parameter_period...

( which is in format --- mm-dd-yyyy)

I want default value for

mm-dd as ( 01-01)..

and yyyy as current year ..

For eg ::if execte the program today ,on selection screen in parameter_period field it should dispaly 01-01-2008..

Your suggestions will be rewarded..

Thanks

Parnith,..

5 REPLIES 5
Read only

Former Member
0 Likes
1,350

Initialization.

concatenate '01-01-' sy-datum+0(4) into parameter_period.

Read only

Former Member
0 Likes
1,349

Hi Parnith,

You can give sy-datum as default value to this parameter.

And then in the Initialization event change the first four digits to 0101.

date+0(4) = 0101.

Hope it helps.

Regards

Hemant Khemani

Read only

Former Member
0 Likes
1,349

Make mm and day as '01' by deafult, by ititializing them to 1.

from sy-subrc, take year value(string concept, taking last 4 digits of sy-subrc), and append these and display as select options default value.

Read only

Former Member
0 Likes
1,349

Hi,

Try this..

INITIALIZATION.

concatenate '01-01-' sy-datum(4) into parameter_period.

Regards,

Sai

Read only

Former Member
0 Likes
1,349

Hi ,

Below code solved my requirement..

parameters: P_date like sy-datum default sy-datum.

initialization.

p_date+4(04) = 0101.

Thnaks ,

Parnith..