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

selection screen default value for previous date range

Former Member
0 Likes
1,892

Hi Chakradhar here,

one doubt,

How to set the default vaue for the date fields in the selection screen exactly 30 days before from today. ie last month this day

4 REPLIES 4
Read only

Former Member
0 Likes
985

hi,

patameters

p_date like sy-datum.

initialization.

p_date = sy-datum.

if p_date+4(2) ne 12.

p_date4(2) = p_date4(2) -1.

else.

p_date+4(2) = 1.

p_date0(4) = p_date0(4) - 1.

endif.

regards,

ananth

Read only

Former Member
0 Likes
985

Hi

There is a function module CCM_GO_BACK_MONTHS, you can specify month parameter as 1.

Call this FM in INITIALISATION event & assigned the date from a variable to screen parameter

Thanks

Sandeep

Reward if helpful

Read only

Former Member
0 Likes
985

even after giving Defalut days also user can change , so better options will be like this

1.report running date will be only for last 30 days if not raise error.

2.dont maintain date as input , in the program do calculations on its own.

Regards

Prabhu

Read only

Former Member
0 Likes
985

Hi Chakradhar,

Parameters: P_DATE type SY_DATUM.

initialization.
P_Date = SY-DATUM.

P_DATE = P_DATE - 30.   " This will give you the 30 days before date

Regards

Sudheer