cancel
Showing results for 
Search instead for 
Did you mean: 

Current date as default

Former Member
0 Kudos

Hi All,

I have a report having date prompt.

So when I run the report it should show current date in date text box.

I unchecked save data with report and also I checked  discard data when open .But when I run the report it is showing empty text box .But I want current date in that.

Please suggest

Now it is showing like this.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Divya,

This is 'By Design' with the 'legacy versions of CR'. You cannot set the default value to currentdate or some dynamic value.

The feature is only available in the new CR for Enterprise tool.

P.S: If you always wish to pass 'currentdate' as the value and are OK with Not displaying that prompt to the users then you have two choices:

- Get rid of that prompt and use 'currentdate' in the record selection formula

- If this prompt is part of a Stored Proc, insert this report as a Subreport > Create a formula with the 'currentdate' and link it to the Date prompt in the Stored Proc

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

I tried this from this thread

http://scn.sap.com/thread/1088581

but still I am not getting.Can you please suggest

    To set the default date for a date parameter please follow the below steps.

1) Set the default value in the date or datetime parameters to a date that will never appear in the data (for example, 1900-01-01).

2) Enter in the Record Selection Formula field a formula similar to the following:

DateVar DateParamValue;

If {?DateParam} = Date(1900,1,1) Then

    DateParamValue := CurrentDate

Else

    DateParamValue := {?DateParam};

{Table.DateField} = DateParamValue;

The date parameters will now default to the current date.

abhilash_kumar
Active Contributor
0 Kudos

Hi Divya,

That workaround will still not show 'current date' in the text box. It sets a default value to a date from the year 1900 which you then have to handle in the record selection formula.

-Abhilash

Former Member
0 Kudos

Yes Abhilash,

I tried and it was showing 1990 only.So there will not be any work around to get the current date ?

Please suggest

abhilash_kumar
Active Contributor
0 Kudos

Only CR for Enterprise has this feature at the moment, the legacy CR Designers (like CR 2008, CR 2011 etc) don't.

-Abhilash

Answers (0)