Skip to Content
Author's profile photo Arjun K T

Passing Date Range to a WebI report from Design Studio via Opendoc with BW data

This blog explains how to pass Date Range from Design Studio to a Web Intelligence  Report via Open document with BW data.

Using a Bex query  in Design studio which contains an Optional Date Prompt

DS_Dateprompt.PNG

So when user selects a date range from Design Studio via Calendar component



DS_Calender Component.PNG

Passing the selected date to  this optional prompt and returning the results in Design Studio .

Here user wanted to open a Web Intelligence report from Design Studio for detailed analysis with date range parameter. Below steps will explain how to manage it.


Create a Web Intelligence Report


First of all create a Web Intelligence report with the same Bex query , when WebI is refreshed then the Optional date prompt appears 

Webi-Daterange.PNG

the User response of the Date range  is as follows

WebI-User response.PNG

as per the below thread , I found the Open doc syntax for the Date Time range and the URL for open doc .

http://scn.sap.com/message/15593928#15593928

Now we need to create DateTime  format in Design Studio .

Create Date Time Range format in Design Studio


Create below  DateTime format in Design studio to pass the selected date from the calendar component  to a Webi Report


Date-Time Format.PNG

Finding the Start Date and End Date from the Calendar Component


Create 6 Global variables in Design Studio for Start and End dates,


1.Start Month

2.Start Day

3.Start Year

4.End Month

5.End Day

6.End Year


There are two calendar components

  1. From
  2. To

Two Calender components.PNG


1.From Calendar Component (named as DEMO_FROM)

When a Date is selected in “From Calendar component ”

From-Calendar.PNG

then we will take the output via following script

(DEMO_FROM.getDate());

From_Date.PNG


Now we need to find Day,Month and Year for Starting date from the above calender component



a) Script for Start  Month from the calendar component

Start Month=Convert.subString(DEMO_FROM.getDate().substring(6,2),2);



Start Month.PNG


b) Script for Start Day  from the calendar component

Start Day=DEMO_FROM.getDate().substring(6);


Start Day.PNG

c) Script for Start Year  from the calendar component

Start Year=DEMO_FROM.getDate().substring(0,4);


Start Year.PNG


1.To Calendar Component (named as DEMO_TO)


When a Date selected in “To Calendar component “

To Date.PNG

then we will take the output via following script

(DEMO_TO.getDate())

To-date output.PNG


a)  Script for End  Month from the To Calendar component

End Month=Convert.subString(DEMO_TO.getDate().substring(6,2),2);

End Month.PNG


b)  Script for End Day from the To Calendar component

End Day=DEMO_TO.getDate().substring(6);

End Day.PNG

c)  Script for End Year from the To Calendar component


End Year=DEMO_TO.getDate().substring(0,4);


End Year.PNG


Building the Open Document URL


Currently  with the above steps we have Start and End  Year, Month and Day values .

  Now we  need to built the Date Time syntax as below


Date-Time Format.PNG



Creating some of the variables

var comma =”,“;

Now appending the Start and End Year, Month and Day variable in the final Date Time Variable

var datetime=”[DateTime(“+Start Year+ comma+ Start Month +comma + StartDay + comma +”12“+ comma +”0“+ comma +”0+”)”+”..”+”DateTime(“+End Year+ comma+ End Month +comma + End Day  + comma +”12“+ comma +”0“+ comma +”0+”)]”

Above the time is given as yellow color.

After the above step the result will look like this

Datetime _output.PNG

var u_datetime= Convert.urlEncode(datetime);

Finally Open Document URL is


       APPLICATION.openNewWindow(http://boserver/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&sType=wid&sRefresh=Y&iDocID=AQqHNJjiKkR_ZGlk25nJ6oc8g+ “&lsRZTM_EVT_RANGE=”+ u_datetime);

where ZTM_EVT_RANGE= this is the prompt text of the Date range in Webi Report



Now we successfully Opened the Web Intelligence report by passing Date Range from Design Studio .!!



Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jayakumar K B
      Jayakumar K B

      Very helpfull

      Author's profile photo Tanush Dey
      Tanush Dey

      Hi Arjun how could i use this variable in DS to visualise a crosstab.