Technique/SAP BW2011. 11. 29. 13:34

Passing query parameters in background to a BEx report deployed in Enterprise portal
Sriramvijay.R 
Business Card
Company: L&T Infotech
Posted on Nov. 27, 2011 06:49 AM in Enterprise Data Warehousing/Business Warehouse, Enterprise Portal (EP)

 
 

This blog is a work around to pass query parameters in background to a BEx report deployed in Enterprise portal. 

To explain this work around simply, the below scenario is taken as example.

Consider a scenario where there are many customers (Info object 0SOLD_TO). Customer will log into Enterprise portal and run their Account statement Report. The customer’s Login ID (Should be same as customer Key) will be passed as filter value to 0SOLD_TO automatically in background. This will prevent customer from accessing others data.  

The following are the step by step instruction to do this work around. 

Create the necessary report in BW with 0SOLD_TO in free characteristics.  

Create a Web template. For creating Web templates use Web application designer. There will be standard web templates like 0ANALYSIS_PATTERN. Remove unnecessary buttons like filter, Navigation pane, New analysis from that template and save as a new template with a name 0ANALYSIS_PATTERN_1. 

Next create an iView of type "BEx Web Application iView" in Enterprise portal.  

In the iView give query technical name, Web template technical name as shown in the below screen shot.

 

 To restrict report in background we need a string like the one below.

“BI_COMMAND=&BI_COMMAND-BI_COMMAND_TYPE=SET_SELECTION_STATE&BI_COMMAND-TARGET_DATA_PROVIDER_REF_LIST-TARGET_DATA_PROVIDER_REF=DP_1&BI_COMMAND-CHARACTERISTICS_SELECTIONS=&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1=&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1-SELECTIONS=&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1-SELECTIONS-ELECTION_1=SELECTION_INPUT_STRING&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1-SELECTIONS-SELECTION_1-SELECTION_INPUT_STRING=05A05325&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1CHARACTERISTIC=0SOLD_TO&PAGE_ID=1_elZDdTRmeUY4TUtTc21FQm1GUHhjQS0tMFlHQ01IaTZuczd1bWRTQVZsUks5QS0t&REQUEST_ID=7”

Whenever we restrict a query with a parameter, this kind of string passed in background. There is a work around to get this string. For that you need the following things,

 (i)                  A web template with filter option – to give restriction on characteristic so that string can be captured.

 (ii)                A Web Debugging Proxy - which logs all HTTP(S) traffic between your computer and the Internet. This will capture the required string in text view.

  Change the template name to 0ANALYSIS_PATTERN in iView and execute. Give restriction to query as below.   

 

For this purpose only 0SOLD_TO was kept in free characteristic. After getting the restricted output, go to Web debugging proxy. There you get the string.

Once the string is captured, that can be modified to meet our requirement. The user login ID can be obtained from the command <User.LogonUid>. Replace Restriction parameter value with the command as shown below and remove the PAGE_ID at the end of the string. So the result string will look like this.


“BI_COMMAND=&BI_COMMAND-BI_COMMAND_TYPE=SET_SELECTION_STATE&BI_COMMAND-TARGET_DATA_PROVIDER_REF_LIST-TARGET_DATA_PROVIDER_REF=DP_1&BI_COMMAND-CHARACTERISTICS_SELECTIONS=&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1=&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1-SELECTIONS=&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1-SELECTIONS-ELECTION_1=SELECTION_INPUT_STRING&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1-SELECTIONS-SELECTION_1-SELECTION_INPUT_STRING=<User.LogonUid>&BI_COMMAND-CHARACTERISTICS_SELECTIONS-CHARACTERISTIC_SELECTIONS_1CHARACTERISTIC=0SOLD_TO"

This modified string should be added to iView Application parameter as in the below screen shot. 

iView HTTP Request method should be set to POST method as in the below screen shot. 

Again change the iView name into 0ANALYSIS_PATTERN_1.

Now, when a customer opens the report it will be restricted to his account only.

 

 

Sriramvijay.R   is a BI/BO Consultant working in L&T Infotech, India


http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/27503%3Futm_source%3Dtwitterfeed%26utm_medium%3Dtwitter%26utm_campaign%3DFeed%253A+SAPNetworkWeblogs+%2528SAP+Network+Weblogs%2529
Posted by AgnesKim
Technique/SAP BW2010. 7. 25. 00:16