Skip to Content
Author's profile photo Sriram Vijay R

Passing query parameters in background to a BEx report deployed in Enterprise portal

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”</p><p>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,</p><p> (i)                  A web template with filter option – to give restriction on characteristic so that string can be captured.</p><p> (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.</p><p>  Change the template name to 0ANALYSIS_PATTERN in iView and execute. Give restriction to query as below.   </p><p>!|height=166|alt=|width=458|src=! </p><p>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.</p><p>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.</p><p><br />“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. !|alt=|src=!

iView HTTP Request method should be set to POST method as in the below screen shot. !|alt=|src=!</body>

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Sriram Vijay R
      Sriram Vijay R
      Blog Post Author
      If you feel any complexity with this method, please do comment your queries...
      Author's profile photo Former Member
      Former Member
      IMO restrictions on what a user can see should be handled using authorization. It would be very easy to make an authorization variable on 0sold_to that will restrict using some information stored on the user. Additionally it would be standard and it would be much more transparent. But of cause their could be other cases where the method could be usefull.

      With Kind Regards
      Kristian Appel

      Author's profile photo Sriram Vijay R
      Sriram Vijay R
      Blog Post Author
      Thanks for reading and responding to the blog.

      For the scenario I have explained,we can simply write a Customer exit also.

      I took this scenario as an example to explain the work around.

      The main concept is Passing the parameters only.