cancel
Showing results for 
Search instead for 
Did you mean: 

Need to pass Dynamic Date range in @prompt function Default parameter

amitkumar_dey
Explorer
0 Kudos

I am using SAP BO 4.2 UDT and backend is Oracle. My requirement is to pass the Dynamic date value in the @prompt() default parameter section" {} " for e.g in the From clause 1st Day of the Current Year Trunc(Sysdate,'Year' ) in the to clause current Date Trunc(sysdate). But @prompt() is treating the above function as text and it is showing the same in the Prompt selection screen. Even I tried to pass it inside the Case When statement but that also not replacing the String(default value) with date function.

I am using the following syntax in the universe (UDT )

to_date(to_char( XXX.ENDDT,'dd-Mon-yyyy')) BETWEEN (case When to_date(@Prompt('1. Begin Date Range (dd-Mmm-yyyy) [Enter ''None'' to ignore prompt]','D','Std. Reports\XX LOV',mono,free,not_persistent,{'default'}),'dd-Mon-yyyy')='default' then trunc(sysdate,'Year') End) AND (Case When to_date(@Prompt('2. End Date Range (dd-Mmm-yyyy) [Enter ''None'' to ignore prompt]','D','Std. Reports\Completion Date LOV',mono,free,,{'default'}),'dd-Mon-yyyy')='default' then Sysdate End) OR ‘default’ In (Case When @Prompt('1. Begin Date Range (dd-Mmm-yyyy) [Enter ''None'' to ignore prompt]','D','XX\XX LOV',mono,free,not_persistent,{'default'}) = 'default' then trunc(sysdate,'year') End) OR 'default' In (Case When @Prompt('2. End Date Range (dd-Mmm-yyyy) [Enter ''None'' to ignore prompt]','D','XX\XX LOV',mono,free,not_persistent,{'default'}) ='default' then sysdate end)

I think this is a tool limitation. If yes then any workaround will it be possible to achieve the same.

Please Suggest..

Thanks in advance for your valuable suggestion.

Thanks

Amit

Accepted Solutions (0)

Answers (4)

Answers (4)

amitkumar_dey
Explorer
0 Kudos
I have gone through the link and i observe the solution is implemented in the IDT. But my universe is in UDT. In UDT for the condition filter for the default value can not calculated using a formula. Hence my issue is still unresolved and is open for further solutions if possible.. Thanks Mahboob for sharing me the link and for your precious time.
mhmohammed
Active Contributor
0 Kudos

Ok, then you'll have to use this idea to create a pre-defined filter. I'm swamped, with hard deadline this week, let the other gurus help you.

https://blogs.sap.com/2016/03/10/custom-predefined-date-range-filters-wtdmtdqtdytd-in-bo/

amitkumar_dey
Explorer
0 Kudos
Thanks Mahboob Mohammed. My requirement is - I need a date range prompt for eg "begin date & End Date" in the Webi report . Here the funstionality of the prompt is like If user didn't select any date value for "begin date & End date" then by default the report will return the record for the current year means 1st Jan 2018 to current date for eg 12-Oct-2018. And if user select any date period then report will display the record for only that period. For eg one month,Two month , One Week etc as per user wish. To implement it I have defined the @prompt systax at the universe level and I faced the challenge as "Default Section" of the @Prompt parameter is accepting only the text for e.g "to_date(@Prompt('2. Begin Date Range (dd-Mmm-yyyy) [Enter ''None'' to ignore prompt]','D','Std. Reports\Completion Date LOV',mono,free,not_persistent,{sysdate}) Here I want in the webi report Prompt selection screen , beside the "Begin Date Range" the default value should display as 12-Oct-2018 (the date which sysdate function returns) and not as static text as "Sysdate". I hope i am able to clear my requirement.. Thanks Amit
mhmohammed
Active Contributor
0 Kudos

Hi Amit,

Can you follow this blog to create a Business filter, by using Trunc(Sysdate,'YEAR') as default value in Begin Date, and Sysdate as default value in End Date prompts? You'll have to create 2 prompts.

https://blogs.sap.com/2013/05/24/optional-prompt-in-bo40/

Thanks,
Mahboob Mohammed

mhmohammed
Active Contributor
0 Kudos

Hi Amit,

Can you describe your requirement clearly, specifically, how many prompts are those, like Start Date and End Date? How many of them are optional and mandatory? What value should we fill in by default if a user leaves a prompt as optional?

Don't worry about prompt the sysdate as text, you don't have to specify sysdate or whatever in the default value parameter on the prompt.

Thanks,
Mahboob Mohammed

amitkumar_dey
Explorer
0 Kudos

Any early update on this will be very usefull.