Skip to Content

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.

 !https://weblogs.sdn.sap.com/weblogs/images/252153066/ep2.JPG|alt=|src=https://weblogs.sdn.sap.com/weblogs/images/252153066/ep2.JPG!

 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>!https://weblogs.sdn.sap.com/weblogs/images/252153066/EP4.JPG|height=166|alt=|width=458|src=https://weblogs.sdn.sap.com/weblogs/images/252153066/EP4.JPG! </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. !https://weblogs.sdn.sap.com/weblogs/images/252153066/EP1.JPG|alt=|src=https://weblogs.sdn.sap.com/weblogs/images/252153066/EP1.JPG!

iView HTTP Request method should be set to POST method as in the below screen shot. !https://weblogs.sdn.sap.com/weblogs/images/252153066/ep3.JPG|alt=|src=https://weblogs.sdn.sap.com/weblogs/images/252153066/ep3.JPG!</body>

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Kristian Appel
    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

    (0) 
  2. Sriram Vijay R 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.

    regards,
    Sriramvijay.R

    (0) 

Leave a Reply