cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sysdate On default Prompt Date on SAP Universe

ferchi7
Explorer
0 Kudos
741

Hello, 

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

Accepted Solutions (0)

Answers (3)

Answers (3)

nachtaktiv
Participant

I always recommend using/creating an independent "Dates"-universe, where you can set all the required date-parameters/values for the entire reporting, e.g. "today", "yesterday", "first day of week", "end of month", ... , etc.
You can add this to every WebI-report as a separate query, add all the required date-values to one or multiple prompts and then "filter" your line-items in the second query based on the "Result from another query".

jemstar
Explorer
0 Kudos

Hi there,

assuming you are using the .unx universe, you can create a parameter with a default like the one in the attached picture - my example gives you yesterday's date as the default

jemstar_0-1734289764973.png

 

 

 

 

 

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.

ferchi7
Explorer
0 Kudos
Hi Macgyver, I would like to know how to do it. I'm still using UDT
ferchi7
Explorer
0 Kudos
below my filter:
ferchi7
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

@ferchi7,  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.