cancel
Showing results for 
Search instead for 
Did you mean: 

Entry for Date through Calendar

former_member344586
Participant
0 Kudos

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 !

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

bhavinvyas
Active Contributor
0 Kudos

Hi Raju,

You can try to work with the SDK for Calendar,

Please go through following SCN document,

Hope it helps!!!!

Thanks,

Bhavin Vyas

former_member344586
Participant
0 Kudos

Hi Bhavin,

I have gone through this . But this will be in Design Studio I suppose and not when the variable is prompted from Bex Side in design studio.

please suggest.

Thanks !

bhavinvyas
Active Contributor
0 Kudos

Yes this is for search options within design studio.

Thanks,

Bhavin Vyas