on 11-10-2015 7:55 AM
Hi Guys,
In my Bex query I have got , two input variables for date. User wants to achieve this through the calendar. But currently in Design studio , we have to enter it manually. Is it possible in Design Studio 1.5 , to select date from Calendar ?
I have gone through below scn thread , is this functionality part of Design studio 1.6 release , please suggest :
https://scn.sap.com/thread/3650863
Thanks !
Hello,
I hope this helps you. BTW: I am using Design Studio 1.4
My solution takes a date from the calendar and sends it back to a Universe Prompt (which it acts as a filter for my datasource(s)). This is done through sending the date value in the appropriate format to the filter/prompt. Through this function Application.setVariableValue (or setVariableValueExt for external sources, in my case the Universe) you can send data to a prompt/filter.
The script for the date_conv_prompt can be customized to return other formats by user desire.
Script date_conv_prompt:
-----------------------------------------------------
//date format YYYYMMDD
//target format is DD-Mon-YYYY 00:00:00
var today_int_string = input_date;
var CDyear_full = Convert.subString(today_int_string, 0,4); // get year YYYY
var CDmonth = Convert.subString(today_int_string, 4,6); // get month
var CDday = Convert.subString(today_int_string, 6,8); //get day
//Change from Month integer appearance to Month short string appearance
if (CDmonth == "01") {
CDmonth = "Jan";
}
else
if (CDmonth == "02") {
CDmonth = "Feb";
}
if (CDmonth == "03") {
CDmonth = "Mar";
}
else
if (CDmonth == "04") {
CDmonth = "Apr";
}
else
if (CDmonth == "05") {
CDmonth = "May";
}
else
if (CDmonth == "06") {
CDmonth = "Jun";
}
if (CDmonth == "07") {
CDmonth = "Jul";
}
else
if (CDmonth == "08") {
CDmonth = "Aug";
}
else
if (CDmonth == "09") {
CDmonth = "Sep";
}
else
if (CDmonth == "10") {
CDmonth = "Oct";
}
if (CDmonth == "11") {
CDmonth = "Nov";
}
else
if (CDmonth == "12") {
CDmonth = "Dec";
}
//calculate today's string for SQL server database dataset filtering
var date_prompt = CDday + "-" + CDmonth + "-" + CDyear_full +" "+"00:00:00";
return date_prompt;
--------------------------------------------
The variable date_prompt can be changed or a more complex logic can be added.
PS: The format for the output has to match the Design Studio interpretation of the values. You can do this with select from a list when you get prompted. After you select a particular date you can see the format Design Studio "reads".
Good luck and hope it helps you.
Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.