cancel
Showing results for 
Search instead for 
Did you mean: 

Sysdate On default Prompt Date on SAP Universe

ferchi
Explorer
0 Kudos
263

Hello, 

I would like to have the sysdate by default on my prompt universe filter ?
How do I do for this ?

View Entire Topic
drs_macgyver
Explorer
0 Kudos

Since this will be a very useful prompt for multiple reports, I suggest coding it within the universe.

I am going to assume you are using Information Design Tool (IDT) for your universe development.  If you are still using Universe Design Tool (UDT), you create an object with a prompt and logic that uses the system date if the prompt if empty.  Let me know if more details are needed here.

In IDT, go to Parameters and Lists of Values.  Create a parameter, type in the desired prompt text, set it to a date data type, under Set default values, select a formula and type in the SQL to provide the system date in your database.  If you happen to have a calendar table that contains all valid dates, set that as the Associated List of Values but this is not required.

In your reports, set a condition where the desired date object = this new parameter.  It will prompt you for a date and default to the system date.

ferchi
Explorer
0 Kudos
Hi Macgyver, I would like to know how to do it. I'm still using UDT
ferchi
Explorer
0 Kudos
below my filter:
ferchi
Explorer
0 Kudos

below my filter:

 

SAP.EVENEMENT.DATE_EVT>= (add_months( @Prompt('Date: ', 'D', , mono, free, persistent),-18)+1)

 

Is it possible to add the default sysdate in this prompt ?

drs_macgyver
Explorer
0 Kudos

@ferchi,  Modify your prompt code to use a DECODE or CASE statement.

= (add_months(DECODE(@Prompt('Date: ', 'D', , mono, free, persistent), '', system_date, @Prompt('Date: ', 'D', , mono, free, persistent)),-18)+1)

Where system_date is the SQL based on your database.

In other words, if the value entered for the prompt is empty, use system date, else the value entered.