How to integrate BW query iViews with a WebDynpro application

Learn how to integrate BW query iViews with a WebDynpro application in this user-submitted tip for SAP Enterprise Portal.

By adding a few lines of JavaScript code to your BW Web template, you can integrate BW query iViews with your WebDynpro application in your SAP Enterprise Portal. Raising portal events is also shown in the code so you can pass data between the different iViews. See the code below.
<!--BW HTML data source object tags: --> >object>
         <param name="OWNER" value="SAP_BW"/>
         <param name="CMD" value="SET_PROPERTIES"/>
         <param name="TEMPLATE_ID" value="ZZ_WEB_PREFS_COMP_CODE"/>
         <param name="USE_PERSONALIZATION" value="X"/>
         <param name="VARIABLE_SCREEN" value="X"/>
         <param name="MENU_BOOKMARK" value=""/>
         <param name="MENU_PERSONALIZE" value="X"/>
         TEMPLATE PROPERTIES
</object>

<object>
         <param name="OWNER" value="SAP_BW"/>
         <param name="CMD" value="SET_DATA_PROVIDER"/>
         <param name="NAME" value="DATAPROVIDER_1"/>
         <param name="QUERY" value="ZZ_WEBP_PREFS_COMP_CODE"/>
         <param name="INFOCUBE" value="ZCOMPCODE"/>
         DATA_PROVIDER:             DATAPROVIDER_1
</object>

<html>
  <head>
  <style>
        a.button:hover {
                 background-color : FF9900;
        }     
       a.button {   
                display : block;
                width : 53px;
                height : 20px;
                text-align : center;
                font-family : Arial;
                font-style : normal ;
                font-size : 8pt;
                font-weight : normal;
                color : black;    
                text-decoration : none;
                background-color : FFCC66;   
                padding : 1px;
                border-top : solid #000000 1px; border-right : solid #000000 1px; border-left : solid #000000 1px; border-bottom : solid #000000 1px
         }
  </style>
    <SCRIPT>
      function doEventing() 
       {
            {
//          var l_length = document.forms[0].elements.length;
//          alert("l_length=" + l_length);
          var l_num_recs = (document.forms[0].elements.length-3/2)+1;
//          alert("l_num_recs=" + l_num_recs);
          var l_start_element = document.forms[0].elements.length - l_num_recs;
//          alert("l_start_element=" + l_start_element);
          var l_list = "";
          for(jj= l_start_element; jj<= l_num_recs; ++jj)
          {
                if(document.forms[0].elements[jj].checked)
                {
                    var l_value = document.forms[0].elements[jj].value;
                    l_list =  l_list + l_value + ",";
                 }
           }
           var value = l_list;
//           alert("value=" + value);
           if (top.opener) {
              top.opener.EPCM.raiseEvent("urn:com.chep.portfolio.plus:BWEvents", "CCDEVENT",value, null);
              top.close();
           } else {
              EPCMPROXY.raiseEvent("urn:com.chep.portfolio.plus:BWEvents", "CCDEVENT",value, null);
           }
//           alert("Event raised");
         }
     }
    </SCRIPT>
    <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control">
    <title>BW Web Application</title>
    <link href="/sap/bw/Mime/Customer/StyleSheets/BIReports30_ie6.css" type="text/css" rel="stylesheet"/>
  </head>
  <body>
<!--BW HTML items object tags: -->
<P>
<object>
         <param name="OWNER" value="SAP_BW"/>
         <param name="CMD" value="GET_ITEM"/>
         <param name="NAME" value="CHECKBOXES_1"/>
         <param name="ITEM_ID" value="ZZ_WEB_CHECKBOXES_ITEM"/>
         <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
         <param name="CAPTION" value="Selection for Company Code:"/>
         <param name="IOBJNM" value="ZCOMPCODE"/>
         <param name="TARGET_DATA_PROVIDER_1" value="DATAPROVIDER_1"/>
         ITEM:            CHECKBOXES_1
</object>  
<tr>
<A class=button href="Javascript:doEventing()"<Submit</A>
</tr></P>
  </body>
</html>
This was first published in April 2006

Dig deeper on SAP NetWeaver Enterprise Portal

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close