Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Arjun_KT
Participant

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

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



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 

the User response of the Date range  is as follows

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


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


1.From Calendar Component (named as DEMO_FROM)

When a Date is selected in "From Calendar component "

then we will take the output via following script

(DEMO_FROM.getDate());


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);




b) Script for Start Day  from the calendar component

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


c) Script for Start Year  from the calendar component

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



1.To Calendar Component (named as DEMO_TO)


When a Date selected in "To Calendar component "

then we will take the output via following script

(DEMO_TO.getDate())


a)  Script for End  Month from the To Calendar component

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


b)  Script for End Day from the To Calendar component

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

c)  Script for End Year from the To Calendar component


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



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





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

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=A..."+ "&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 .!!



2 Comments
Labels in this area