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: 

How to show the Current Date in the Screen as default

Former Member
0 Kudos

Hi all,

This is may be simple to u all, but i need the solution for this,

I want to show the Current date in the Screen, i am using the structure. but the calendar control showing when i run the program. But i want to show the current date as default.

Thanks

Shankar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Is this a screen or a report?

If its a report, try assigning DEFAULT sy-datum (to the parameter/select-option name)

If its a screen field, try writing this in the PBO:

IF fieldname IS INITIAL.

fieldname = sy-datum.

ENDIF.

Hope this helps.

Sudha

5 REPLIES 5

Former Member
0 Kudos

parameters: p_date like sy-datum value sy-datum

or

In INITIALIZATION.

p_date = sy-datum.

Former Member
0 Kudos

Is this a screen or a report?

If its a report, try assigning DEFAULT sy-datum (to the parameter/select-option name)

If its a screen field, try writing this in the PBO:

IF fieldname IS INITIAL.

fieldname = sy-datum.

ENDIF.

Hope this helps.

Sudha

0 Kudos

Hi,

if you use class CL_GUI_CALENDAR use methodes:

1) SET_TODAY

or 2) SET_DAY_INFO

Andreas

former_member186741
Active Contributor
0 Kudos

parameters: p_date like sy-datum <b>DEFAULT</b> sy-datum.

Former Member
0 Kudos

Hi MP,

Copy and paste this code

parameters: p_date like sy-datum.

INITIALIZATION.

p_date = sy-datum.

execute your code.