how to… integrate sap netweaver 7.0 bi …...1 scenario in this scenario, we will integrate ui...

91
How-to Guide How-to Guide SAP NetWeaver 7.0 (2004s) SAP NetWeaver 7.0 (2004s) How To… How To… Integrate SAP NetWeaver 7.0 BI Application UI Elements and Visual Composer UI Elements by service- enabling UI Elements Version 4.03 – June 2007 Applicable Releases: SAP NetWeaver 7.0 (2004s)

Upload: others

Post on 26-Apr-2020

20 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

How-to Guide How-to Guide SAP NetWeaver 7.0 (2004s) SAP NetWeaver 7.0 (2004s)

How To…

How To… Integrate SAP NetWeaver 7.0 BI Application UI Elementsand Visual Composer UI Elements by service-enabling UI Elements Version 4.03 – June 2007 Applicable Releases: SAP NetWeaver 7.0 (2004s)

Page 2: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

© Copyright 2005 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data

contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. SAP NetWeaver “How-to” Guides are intended to simplify the product implementation. While specific product features and procedures typically are explained in a practical business context, it is not implied that those features and procedures are the only approach in solving a specific business problem using SAP NetWeaver. Should you wish to receive additional information, clarification or support, please refer to SAP Consulting. Any software coding and/or code lines / strings (“Code”) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent.

Page 3: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

Index

1. Scenario

2. Version History

3. Introduction

4. Data Provider Information

5. Step by Step Solution

4.1 Build the Outbound Service Template Web Application

4.2 Build the Inbound Service Template Web Application

6. Scenarios

5.1 Hierarchy Dialog within VC

5.2 Hierarchical Filter within VC

5.3 Listbox within VC using 2 separate iViews.

5.4 Use Visual Composer Slider Element to update BI Web Application

7. Guidelines

8. Troubleshooting

9. Appendix

- 1 -

Page 4: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

1 Scenario

In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs with UI Elements from Visual Composer such as tables and and other UI elements. Most of the scenarios are built off SAP DEMO content just to show examples.

2 Version History

Version 3.0 – Originally released for customers Version 4.00 – Added support for master data values that have spaces – The Outbound script did not send the code in the correct form for elements that are not <CHARACTERISTICS>. This has been corrected. - Added support for objects in customer namespaces on outbound template. - Added clarification for webapi commands for different hierarchy types - Added troubleshooting section - Changed "inbound" logic to skip filtering of null values passed from VC - Added support for variables of type characteristic. Previously, only formula variables were supported. Version 4.01

- Added support for customer namespaces on inbound template. Version 4.02 - Added support for variables with multiple values or selection option variables Version 4.03 - Added support for structures with GUIDs starting with numerics other than “0”

3 Introduction

The paper will show how to integrate UI Elements between Visual Composer and Web Application Designer. This concept can be extended to any SAP toolset, such as Webdynpro for ABAP, BSPs, WebDynpro for Java, etc… The goal of this solution is to make every UI element a service. This service will utilize portal eventing capabilities to send and receive XML documents to integrate these applications. In this scenario, we will create a service out template and a service in template which will send and receive XML documents in this format: <Params version=”2”><Row F0CALMONTH=”200407”/> <Row F0CALMONTH=”200408”/></Params>

- 2 -

Page 5: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

- 3 -

Page 6: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

4 Overview of “Data Provider – Information” Web Item

The Data Provider – Information Web Item returns an XML tree in your web application. This xml tree isn’t displayed in the web application but is available in the source code for use. This paper makes use of this XML Tree. This xml tree has the following format: <xml id="DATA_PROVIDER_INFO_ITEM_1">

<BICS_VIEW> <RESULT_SET>

<AXES> <AXIS name="ROWS">

... </AXIS>

<AXIS name="COLUMNS"> ... </AXIS>

</AXES> <DATA_CELLS> ... </DATA_CELLS>

</RESULT_SET> </BICS_VIEW>

</xml> This is only a subset of the tree. Check the source of your web applications for an example of a full tree. This solution is primarily driven off this XML dataset. An XSL transform is converting this XML format to a format understood by Visual Composer.

5 The Step By Step Solution

5.1 Build the Outbound Service Template Web Application In this step, we will build a web template that has our logic to send out the selection state of your web application as an xml document. This template can be embedded as a nested web template in any web application. This is a one time event and typically should be done by someone from IT or development at customer sites. The web application designer end user won’t have to code to build their template. They will just use this service template and nest it in their applications!

- 4 -

Page 7: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

1. Login to the SAP NetWeaver 7.0 (2004s) BI Web Application Designer

2. Create a new Web Template.

3. Double Click on “New Data Provider” to create a new data provider.

- 5 -

Page 8: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

4. Specify DP_1 as the data provider and leave the query, query view, and InfoProvider fields blank. Choose OK.

5. Add the “Data Provider – Information” web item to the web application specify the web item parameters as “Output Navigation Status=On” and “Output Result Data=Off”

6. Drag and drop the “Script” Web Item into your web application.

- 6 -

Page 9: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

7. Choose the help selector for “Script” in the “SCRIPT_ITEM_1” web item.

8. Add the scripting code specified in the Appendix.

9. Go to the XHTML tab and ensure the

script loads in the body: <script type="text/javascript" language="JavaScript" >loadIt();</script>

See the appendix for full XHTML source code.

- 7 -

Page 10: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

10. Save the web template.

11. Name the web template “Z_SERVICEOUTBOUND” with description “Outbound Service Template”

5.2 Build the Inbound Service Template Web Application In this step, we will build a web template that has our logic to receive variable values or filter values as an xml document. If you need to cover other inbound items other than filter values and variable values, you can update this inbound service template. This template can be embedded as a nested web template in any web application. This is a one time event and typically should be done by someone from IT or development at customer sites. The web application designer end user won’t have to code to build their template. They will just use this service template and nest it in their applications!

- 8 -

Page 11: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

1. Login to the SAP NetWeaver 7.0 (2004s) BI Web Application Designer

2. Create a new Web Template.

3. Double Click on “New Data Provider” to create a new data provider.

- 9 -

Page 12: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

4. Specify DP_1 as the data provider and leave the query, query view, and InfoProvider fields blank. Choose OK.

5. Drag and drop the “Script” Web Item into your web application.

6. Choose the help selector for “Script” in the “SCRIPT_ITEM_1” web item.

- 10 -

Page 13: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

7. Add the scripting code specified in the Appendix for the inbound service web template.

8. Save the web template.

9. Add the Data Provider – Information Web Item to your Web Template.

- 11 -

Page 14: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

10. Name the web template “Z_SERVICEINBOUND” with description “Inbound Service Template”

6 Scenarios to use Service Template

6.1 Hierarchy Dialog within VC In this scenario, we want to use our service template we created to integrate a hierarchy popup filter dialog within a Visual Composer Application. The output of the scenario as follows:

The query to use for this example is "0D_DX_M01_Q0003” as this includes a hierarchy. You can use your own query as well. The webAPI sequence we will use to submit the hierarchy filter to BI from Visual Composer is listed below. Keep in mind that the API command is different for hierarchies based with nodes that are characteristic values versus nodes that are based off 0HIER_NODE WebAPI for Hierarchy based off characteristic values:

- 12 -

Page 15: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

WEBAPI = 'FILTER_IOBJNM=0D_DBSIC1;FILTER_NODE_IOBJNM=0D_DBSIC1;FILTER_VALUE=' & @F0D_DBSIC1 WebAPI for Hierarchy based off 0HIER_NODE:

WEBAPI = 'FILTER_IOBJNM=0COUNTRY;FILTER_NODE_IOBJNM=0HIER_NODE;FILTER_VALUE=' & @F0COUNTRY NOTE: This web api is deprecated with the next release of SAP NetWeaver and is subject to change. 1. Login to the SAP NetWeaver 7.0

(2004s) BI Web Application Designer

- 13 -

Page 16: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

2. Create a new Web Template.

3. Insert a new data provider in your template.

4. Choose demo content query

“0D_DX_M01_Q0003” or your own query that you want to send out values from.

- 14 -

Page 17: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

5. Drag and drop the “Button Group” web item into your web application.

6. Choose the help selector to create a button.

7. Specify caption “Industry Value

Help” and quick info “Industry Value Help”. Choose the help selector for the command.

- 15 -

Page 18: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

8. Choose the “OPEN_SELECTOR_DIALOG” command and choose Next.

9. Choose Data Provider Affected as

“DP_1” and choose Next.

- 16 -

Page 19: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

10. Choose characteristic “0D_DBSIC1” and choose OK.

11. Choose OK to finish the creation of

the button.

12. Drag and drop the “Web Template”

Item into your web application.

- 17 -

Page 20: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

13. Specify your service web template “Z_SERVICEOUTBOUND” as the nested web template.

14. Save your web application.

15. Save your web template with description “Hierarchy Button” and technical name “Z_HIER_BUTTON”.

- 18 -

Page 21: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

16. Make sure you save this URL as you’ll need it in your Visual Composer model.

17. Launch Visual Composer using url: http://<server>:<port>/VC

Create a new model.

18. Name your model.

- 19 -

Page 22: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

19. Drag and drop an iView into your storyboard. Double click on the iView to enter the iView.

20. Go to Find Data and drag and drop

21. Drag and drop a table view from the output port.

- 20 -

Page 23: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

22. Choose the following fields and click OK.

23. Drag and drop a start point from the

input port of the dataservice.

24. Choose OK.

- 21 -

Page 24: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

25. Drag and drop a “Signal In” element into your storyboard.

26. Rename the “in1” event to “Filter”.

27. Add a field to your “Filter” event.

- 22 -

Page 25: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

28. Name the field 0D_DBSIC1 and choose OK.

29. Connect the “Filter” event to the input port.

30. Specify a formula for the web api on the line connecting the “Filter” event into the data service.

- 23 -

Page 26: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

31. Specify the following mapping for the web api and choose OK. NOTE: This web api is deprecated with the next release of SAP NetWeaver and is subject to change.

32. Drag and drop an HTML View into your model and name it “Hierarchy”.

33. Connect the HTML View to the start point.

- 24 -

Page 27: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

34. Specify a formula for the URL.

35. Enter the formula for your web application which has the hierarchy button.

36. For the HTML View, set the display as transparent.

- 25 -

Page 28: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

37. Go to the layout tab and update the layout such that the button is displayed at the top of the page.

38. Deploy your model.

- 26 -

Page 29: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

39. Run your model. You now have a hierarchy value help available for VC filtering…

6.2 Hierarchical Filter within VC In this scenario, we want to use our service template we created to integrate a hierarchical filter web item into a Visual Composer Application. WebAPI for Hierarchy based off characteristic values:

WEBAPI = 'FILTER_IOBJNM=0D_DBSIC1;FILTER_NODE_IOBJNM=0D_DBSIC1;FILTER_VALUE=' & @F0D_DBSIC1 WebAPI for Hierarchy based off 0HIER_NODE:

- 27 -

Page 30: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

WEBAPI = 'FILTER_IOBJNM=0COUNTRY;FILTER_NODE_IOBJNM=0HIER_NODE;FILTER_VALUE=' & @F0COUNTRY NOTE: This web api is deprecated with the next release of SAP NetWeaver and is subject to change. The output of this scenario looks as follows:

1. Login to the SAP NetWeaver 7.0

(2004s) BI Web Application Designer

- 28 -

Page 31: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

2. Create a new Web Template.

3. Insert a new data provider in your template.

4. Choose demo content query

“0D_DX_M01_Q0003” or your own query that you want to send out values from.

- 29 -

Page 32: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

5. Drag and drop the “Hierarchical Filter” web item into your web application.

6. Set the characteristic “0D_DBSIC1”

as the source for the hierarchy.

- 30 -

Page 33: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

7. Drag and drop the “Web Template” Item into your web application.

8. Specify your service web template “Z_SERVICEOUTBOUND” as the nested web template.

9. Save your web application.

- 31 -

Page 34: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

10. Save your web template with description “Hierarchy FILTER” and technical name “Z_HIER_FILTER”.

11. Make sure you save this URL as you’ll need it in your Visual Composer model.

12. Launch Visual Composer using url: http://<server>:<port>/VC

Create a new model.

- 32 -

Page 35: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

13. Name your model.

14. Drag and drop an iView into your storyboard. Double click on the iView to enter the iView.

15. Go to Find Data and drag and drop

- 33 -

Page 36: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

16. Drag and drop a table view from the output port.

17. Choose the following fields and click

OK.

18. Drag and drop a start point from the

input port of the dataservice.

- 34 -

Page 37: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

19. Choose OK.

20. Drag and drop a “Signal In” element

into your storyboard.

21. Rename the “in1” event to “Filter”.

- 35 -

Page 38: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

22. Add a field to your “Filter” event.

23. Name the field 0D_DBSIC1 and

choose OK.

- 36 -

Page 39: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

24. Connect the “Filter” event to the input port.

25. Specify a formula for the web api on the line connecting the “Filter” event into the data service.

26. Specify the following mapping for the web api and choose OK.

NOTE: This web api is deprecated with the next release of SAP NetWeaver and is subject to change.

- 37 -

Page 40: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

27. Drag and drop an HTML View into your model and name it “Hierarchy”.

28. Connect the HTML View to the start point.

29. Specify a formula for the URL.

- 38 -

Page 41: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

30. Enter the formula for your web application which has the hierarchy button.

31. For the HTML View, set the display as transparent.

32. Go to the layout tab and update the layout such that the button is displayed at the top of the page.

- 39 -

Page 42: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

33. Deploy your model.

34. Run your model. You now have

hierarchy filtering available for VC filtering…

6.3 Listbox within VC using 2 separate iViews. In this scenario, we want to use our service template we created to integrate a listbox web item with a Visual Composer Application that are located in 2 separate Portal iViews. The output of this scenario looks as follows:

- 40 -

Page 43: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

- 41 -

Page 44: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

1. Launch the Web Application

Designer.

2. Create a new web application.

3. Double Click on “New Data Provider” to create a new data provider.

- 42 -

Page 45: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

4. Specify query “0D_DX_M01_Q0006” for DP1 and choose OK.

5. Drag and drop the “Listbox” web item into your web application.

6. Go to the Web Item Parameters of the “LISTBOX_ITEM_1” web item and specify the “Affected Data Provider” as “DP1”, and the “Characteristic” as “0CALMONTH”. Also, make sure “Label Visible” is checked “On”

- 43 -

Page 46: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

7. Drag and drop the “Web Template” Item into your web application.

8. Specify your service web template “Z_SERVICEOUTBOUND” as the nested web template.

9. Save the web application

- 44 -

Page 47: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

10. Save with description “GR00 Send WAD Listbox to VC” and technical name “Z_GR00_LISTBOXOUT”.

11. Choose “Web Template -> Publish -> to Portal”

12. Choose the help selector for the

“Folder Name”

- 45 -

Page 48: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

13. Choose “Portal Content/Workshop/GR00”. If this folder doesn’t exist, create it in the PCD.

14. Choose “Execute” to save this in the

PCD.

15. Login to Visual Composer at

http://<host>:<port>/VC/

- 46 -

Page 49: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

16. Choose “Model -> New Model”

17. Specify the name “GR00_RECV_FROM_WAD_LISTBOX”

18. Add an iView to the model and name is “GR00 Recv from WAD Listbox” where ## is your group number.

- 47 -

Page 50: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

19. Double click on the iView to enter the contents of this iView.

20. Choose “Find Data”

21. Choose your BW System and query

“0D_DX_M01_Q0006”.

- 48 -

Page 51: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

22. Drag and drop this query into your iView.

23. From the input port, drag and drop out a “Singal In”

24. Choose OK.

- 49 -

Page 52: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

25. Rename the “in1” object to “Filter”

26. Choose “Add” to add a field to your filter.

- 50 -

Page 53: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

27. Specify Field name “0CALMONTH”

28. Drag and drop a start point from the Input port.

29. Choose OK.

- 51 -

Page 54: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

30. Click on the line “Filter” line to the input port and map “Calendar Year Month” to “F0CALMONTH”

31. Drag and drop a “table” from the output port.

32. Choose the following fields and click OK.

- 52 -

Page 55: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

33. Go to deploy.

34. Choose Deploy.

35. Go to the portal.

- 53 -

Page 56: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

36. Navigate to “Content Administration -> Portal Content -> Visual Composer -> Models -> GR00_RECV_FROM_WAD_LISTBOX -> iviews -> GR00 Recv From WAD Listbox” and right click and choose “Copy”

37. Navigate to “Portal Content -> Workshop -> GR00” and right click on this folder and choose “Paste as Delta Link”

38. Right click on folder “Portal Content/Workshop/GR00” and create a new page.

- 54 -

Page 57: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

39. Enter page name “GR00 Listbox WAD to VC” and page ID “GR00_LBOX_WAD_TO_VC” and choose next.

40. Choose the “Default Page Template” and click Next.

41. Choose “2 Columns (Narrow:Wide) and click Add.

- 55 -

Page 58: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

42. Click Next.

43. Choose Finish.

44. Choose “Open the object for editing” and click OK.

- 56 -

Page 59: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

45. Right click on iView “GR00 Send WAD Listbox to VC” and click “Open -> Object”

46. Choose “Appearance -> Size”

47. Specify the following parameters and

save.

- 57 -

Page 60: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

48. Close this iView

49. Right click on “GR00 Send WAD

Listbox to VC” and choose “Add iView to Page -> Delta Link”

50. Right click on “GR00 Recv from WAD Listbox” and choose “Add iView to Page -> Delta Link”

- 58 -

Page 61: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

51. Go to the page layout

52. Ensure the layout is specified as

below and save the page.

53. Choose Preview.

- 59 -

Page 62: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

54. You should now be able to apply filters from the WAD Listbox that will affect VC.

6.4 Use Visual Composer Slider Element to update BI Web Application In this scenario, we want to use our service template we created to integrate a slider from Visual Composer with an analysis web item in a BI Web Application. The example here will be updating a variable value that is set from a VC slider and will update a filter value with Calendar Year/Month. The output of this scenario looks as follows:

- 60 -

Page 63: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

1. Login to the SAP NetWeaver 7.0

(2004s) BI Web Application Designer

2. Create a new Web Template.

3. Insert a new data provider in your template.

- 61 -

Page 64: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

4. Choose a query to use as your data provider. In this case, we are using a copy of 0D_DX_M01_Q0006 which has a Top N Condition on Net Sales. The Top N Condition is filled by variable Z_ENTRYTOP which is a user entry, mandatory variable with default value 10.

5. Drag and drop the “Analysis” web item into your web application.

6. Drag and drop the “Web Template”

Item into your web application.

- 62 -

Page 65: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

7. Specify your service web template “Z_SERVICEINBOUND” as the nested web template.

8. Save your web application.

9. Save your web template with description “Analysis Inbound” and technical name “Z_ANALYSIS_IN”.

- 63 -

Page 66: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

10. Make sure you save this URL as you’ll need it in your Visual Composer model.

11. Launch Visual Composer using url: http://<server>:<port>/VC

Create a new model.

12. Name your model.

- 64 -

Page 67: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

13. Name the model “Slider_Integration”

14. Drag and drop an iView in your model and name it “Slider_Integration”

15. Double click on the “Slider_Integration” iView.

- 65 -

Page 68: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

16. Drag and drop an HTML View in your model and name it “Analysis”.

17. Drag and drop a Start Point from the in port on the HTML View.

18. Choose “url” and click OK.

- 66 -

Page 69: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

19. Double click on the line connecting the start point and the in port.

20. Double click on the url field to enter a formula.

21. Paste the URL for your BI Web Application and click OK.

- 67 -

Page 70: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

22. Drag and drop a “Form view” element into your model and name it “Filter”.

23. Go to the Field area of the form and click Add.

24. Choose the control type “HSlider”

and name the field “Z_ENTRYTOP.

- 68 -

Page 71: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

25. Choose “Properties” for your field “Z_ENTRYTOP”.

26. Specify the following Display.

27. Specify the following properties for

Range.

- 69 -

Page 72: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

28. Specify the custom action “Variable” and choose Close.

29. Drag and drop a “Signal Out”

element from the out port of the Filter Form.

30. Choose the field “Z_ENTRYTOP” and click OK.

- 70 -

Page 73: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

31. Double click on the line connecting the form and output signal and name this event “Variable”

32. Double click on the output signal and name the output signal “Variable”.

33. Double click on your Filter Form.

- 71 -

Page 74: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

34. Add a Field to your form.

35. Choose “Drop-down List” and

specify Field “0CALMONTH”.

- 72 -

Page 75: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

36. Go to the properties of your “F0CALMONTH” field.

37. Specify the following properties for

the “Display” tab.

38. Choose “Dynamic” for the Entry List.

- 73 -

Page 76: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

39. Choose a query with “0CALMONTH” in it and choose this field.

40. Specify the following properties for

the “Entry List” Tab.

- 74 -

Page 77: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

41. Specify Action “Filter” and click Close.

42. Drag and drop a “Signal Out” from

the out port of the Filter.

- 75 -

Page 78: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

43. Choose field “F0CALMONTH” and click OK.

44. Double click on the line between the

out port and the signal out and name the event “Filter”.

45. Double click on the signal out and name the output “Filter”.

- 76 -

Page 79: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

46. Go to the Layout and redraw the layout as displayed here:

47. Save the model.

48. Deploy the model.

- 77 -

Page 80: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

49. Run the model. The slider will set the top N Condition for Net Sales. The dropdown for Cal Year/Month will filter to an individual Calendar Year/Month.

7 Guidelines for Solution

For these solutions to work, you must follow these guidelines: • Always name all filter fields within Visual Composer based off the InfoObject

technical name (must be capitalized as fields is case sensitive) • Always name all variable fields within Visual Composer based off the Variable

technical name (must be capitalized as fields are case sensitive) • Always name the signal in for a Visual Composer model “Filter” • Always name the signal out for fields to filter as “Filter” • Always name the signal out for variable values to set as “Variable”

8 Troubleshooting

8.1 Flash Debugger Visual Composer allows you to use the flash debugger. This will expose all actions and events within an individual Visual Composer application.

- 78 -

Page 81: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

1. Within Visual Composer, go to Tools -> Options.

2. Go to the Compiler tab. Choose the “Add Flash debugging console” option and choose OK.

3. Deploy your Visual Composer

application.

- 79 -

Page 82: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

Run your VC Application. You will now see the Flash Debug Logger which will show you all events taking place at runtime!!!

4.

8.2 Alerts within Javascript Because we are working with multiple applications, as we broadcast or send out events, to ensure this occurs properly, you can use alerts within javascript

1. Within your Z_SERVICEOUTBOUND web template, you can add an alert to show the parameters you are passing out to Visual Composer.

function loadIt() { DATA_PROVIDER_INFO_ITEM_1.async = false; var sendout; sendout = DATA_PROVIDER_INFO_ITEM_1.firstChild.childNodes[5].transformNode(xsl_transform_0.documentElement); // To debug, comment the line below back in. // alert(sendout); EPCMPROXY.raiseEvent( "urn:com.sap.vc:epcm", "Filter", sendout , null ); } </script>

- 80 -

Page 83: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

2.

1.

Within your Z_SERVICEINBOUND web template, you can add an alert to show the parameters you are receiving from Visual Composer. Comment back in the alert(unesc_val.xml) to view the object.

function setSequence(action, eventObj) { //Create a new object of type sapbi_CommandSequence var commandSequence = new sapbi_CommandSequence(); xml_in = eventObj.dataObject; unesc_val = unescape(xml_in); // alert(unesc_val.xml);

8.3 Common Errors – EPCMPROXY undefined Ensure you use the fully qualified domain name when accessing your portal and when asking Visual Composer. Also, ensure that the fully qualified domain name is the same between VC and WAD.

8.4 HttpWatch HttpWatch allows you to track html calls. This requires that this software is installed. Also, keep in mind that this doesn’t offer you internal commands to flash and will help with eventing between portal iViews, but not off much assistance within the flash runtime. The Flash Debugger should be used for the flash runtime. HttpWatch will help immensely for web application designer dashboards.

Run your web application and turn on the HTTPWATCH with the icon on your toolbar.

- 81 -

Page 84: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

Choose Start to log http calls.

2.

3. Trigger an event that will update other iViews.

4. All URL calls are logged and you can use this to ensure that filter values are passed properly… Also, ensure epfcproxy.js is loaded when the iviews load.

- 82 -

Page 85: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

9 Appendix

9.1 Source Code for Script Web Item in Service Out Template: function loadIt() { DATA_PROVIDER_INFO_ITEM_1.async = false; var sendout; // debugger; sendout = DATA_PROVIDER_INFO_ITEM_1.firstChild.childNodes[5].transformNode(xsl_transform_0.documentElement); To debug, comment the line below back in. alert(sendout); EPCMPROXY.raiseEvent( "urn:com.sap.vc:epcm", "Filter", sendout , null ); } </script> <!-- #========================================================================== # XSL Transformation that displays Filter Values #========================================================================== --> <xml id="xsl_transform_0"> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl"> <xsl:template match="text() | @* "> <!-- Skip output of tags, which are not CHARACTERISTICS --> </xsl:template> <xsl:template match="CHARACTERISTICS"> <xsl:element name="Params"> <xsl:attribute name="version">2</xsl:attribute> <xsl:element name="Row"> <xsl:for-each select="//CHARACTERISTIC"> <xsl:variable name="var1"> <!-- Attributname for row-tag is created here --> <xsl:choose> <xsl:when test="substring(@name,1,1)='0'"> <!-- A number is not allowed as first char of a xml element, so a F is concatenated --> <xsl:value-of select="concat('F',@name)"/> </xsl:when> <xsl:when test="number(substring(@name,1,1))"> <!-- A number is not allowed as first char of a xml element, so a F is concatenated --> <xsl:value-of select="concat('F',@name)"/> </xsl:when> <xsl:when test="contains(@name,'/')"> <!-- Custom namespace compatibility: A / is not allowed as first char of a xml element, so a F is concatenated and slashes are transformed into underscores --> <xsl:value-of select="concat('F', translate(@name, '/', '_'))"/> </xsl:when> <xsl:otherwise> <!-- All other elements are fine, just take their name --> <xsl:value-of select="@name"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:for-each select="SELECTIONS"> <xsl:for-each select="SELECTION"> <xsl:variable name="var2"> <!-- Value of new attribute --> <xsl:choose> <xsl:when test="@type = 'SINGLE_MEMBER'"> <xsl:value-of select="MEMBER/@name"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="VALUE/MEMBER/@name"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <!-- Creation of row-tag --> <xsl:attribute name="{$var1}"> <!-- Adding attribute with the name of var1 --> <xsl:value-of select="$var2"/> <!-- Set value to var2 -->

- 83 -

Page 86: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

</xsl:attribute> </xsl:for-each> </xsl:for-each> </xsl:for-each> </xsl:element> </xsl:element> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> </xml> <script language="JavaScript">

9.2 Source Code for Service Out Web Template: <bi:bisp xmlns="http://www.w3.org/TR/REC-html40" xmlns:bi="http://xml.sap.com/2005/01/bi/wad/bisp" xmlns:jsp="http://java.sun.com/JSP/Page" > <html > <head > <title >Netweaver BI Web Application</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body > <bi:QUERY_VIEW_DATA_PROVIDER name="DP_1" > <bi:INITIAL_STATE type="CHOICE" value="QUERY" > <bi:QUERY value="" /> </bi:INITIAL_STATE> </bi:QUERY_VIEW_DATA_PROVIDER> <bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" /> <!-- insert data providers, items and other template content here --> <bi:DATA_PROVIDER_INFO_ITEM name="DATA_PROVIDER_INFO_ITEM_1" designheight="120" designwidth="300" > <bi:DATA_PROVIDER_REF value="DP_1" /> </bi:DATA_PROVIDER_INFO_ITEM> <bi:SCRIPT_ITEM name="SCRIPT_ITEM_1" designwidth="300" designheight="70" > <bi:SCRIPT value="biLargeData:B0V1N4ARH3IKX18V29K7AT45Z" /> </bi:SCRIPT_ITEM> <script type="text/javascript" language="JavaScript" >loadIt();</script> </body> </html> </bi:bisp>

9.3 Source Code for Script Web Item in Service In Template: EPCMPROXY.subscribeEvent( "urn:com.sap.vc:epcm", "Variable", window, "setVarSequence"); EPCMPROXY.subscribeEvent( "urn:com.sap.vc:epcm", "Filter", window, "setFilterSequence"); function load(xmlFile) { // code for IE if (window.ActiveXObject) { xmldoc = new ActiveXObject("Msxml2.DOMDocument.3.0"); xmldoc.loadXML(xmlFile); } else { alert('Your browser cannot handle this script'); } } function loadVar(xmlFile) { // code for IE if (window.ActiveXObject) { vardoc = new ActiveXObject("Msxml2.DOMDocument.3.0");

- 84 -

Page 87: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

vardoc.loadXML(xmlFile); } else { alert('Your browser cannot handle this script'); } } function getVarType(varname) { DATA_PROVIDER_INFO_ITEM_1.async = false; var sendout; sendout = DATA_PROVIDER_INFO_ITEM_1.firstChild.childNodes[3]; loadVar(sendout.xml); var variables = vardoc.getElementsByTagName('VARIABLE'); for(i=0; i < variables.length; i++) { if(variables.item(i).getAttribute("name") == varname) { return variables.item(i).getAttribute("type"); } } } function setVarSequence(eventObj) { setSequence('Variable', eventObj); } function setFilterSequence(eventObj) { setSequence('Filter', eventObj); } function setSequence(action, eventObj) { // debugger; //Create a new object of type sapbi_CommandSequence var commandSequence = new sapbi_CommandSequence(); xml_in = eventObj.dataObject; unesc_val = unescape(xml_in); //alert(unesc_val); load(unesc_val); // Get parameter version vers = xmldoc.getElementsByTagName("Params").item(0).getAttribute("version"); if (vers == null) { vers = 0; alert('SP7 not supported'); } // This is for SP8 and above if (vers == 2) { len_val = xmldoc.getElementsByTagName("Row").item(0).attributes.length; for(i = 0; i < len_val; i++) { IOBJ = xmldoc.getElementsByTagName("Row").item(0).attributes[i].name; VAL = xmldoc.getElementsByTagName("Row").item(0).attributes[i].value; // Added this to support values with spaces... VAL = unescape(VAL); if(VAL == null || VAL == undefined || VAL =='') { // Don't filter on values that are null }

- 85 -

Page 88: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

else { // Namespace compatibility if (IOBJ.substring(0, 2) == 'F_') { IOBJ = IOBJ.replace(/^F_(.*)_/i, '/$1/'); } //Strip of leading 'F' (primarily due to VC naming due to XML attributes not starting with "0") if (IOBJ.charAt(0) == 'F') { IOBJ = IOBJ.substring(1, IOBJ.length); } if(action=='Variable') { commandSequence = setVariableValue(commandSequence, IOBJ, VAL); } if(action=='Filter') { commandSequence = setFilterValue(commandSequence, IOBJ, VAL); } } } } //Send the command sequence to the server sapbi_page.sendCommand( commandSequence ); if(!(typeof (event) == "undefined")) { event.returnValue = false; event.cancelBubble = true; } } function setFilterValue(commandSequence, IOBJ, VAL) { //Create a new object of type sapbi_Command with the command named "SET_SELECTION_STATE_SIMPLE" var commandSET_SELECTION_STATE_SIMPLE_1 = new sapbi_Command( "SET_SELECTION_STATE_SIMPLE" ); //Create parameter TARGET_DATA_PROVIDER_REF_LIST var paramTARGET_DATA_PROVIDER_REF_LIST = new sapbi_Parameter( "TARGET_DATA_PROVIDER_REF_LIST", "" ); var paramListTARGET_DATA_PROVIDER_REF_LIST = new sapbi_ParameterList(); //Create parameter TARGET_DATA_PROVIDER_REF var paramTARGET_DATA_PROVIDER_REF1 = new sapbi_Parameter( "TARGET_DATA_PROVIDER_REF", "DP_1" ); paramListTARGET_DATA_PROVIDER_REF_LIST.addParameter( paramTARGET_DATA_PROVIDER_REF1 ); //End parameter TARGET_DATA_PROVIDER_REF! paramTARGET_DATA_PROVIDER_REF_LIST.setChildList( paramListTARGET_DATA_PROVIDER_REF_LIST ); commandSET_SELECTION_STATE_SIMPLE_1.addParameter( paramTARGET_DATA_PROVIDER_REF_LIST ); //End parameter TARGET_DATA_PROVIDER_REF_LIST! //Create parameter CHARACTERISTIC var paramCHARACTERISTIC = new sapbi_Parameter( "CHARACTERISTIC", IOBJ ); commandSET_SELECTION_STATE_SIMPLE_1.addParameter( paramCHARACTERISTIC ); //End parameter CHARACTERISTIC! //Create parameter RANGE_SELECTION_OPERATOR var paramRANGE_SELECTION_OPERATOR = new sapbi_Parameter( "RANGE_SELECTION_OPERATOR", "EQUAL_SELECTION" ); var paramListRANGE_SELECTION_OPERATOR = new sapbi_ParameterList(); //Create parameter EQUAL_SELECTION var paramEQUAL_SELECTION = new sapbi_Parameter( "EQUAL_SELECTION", "MEMBER_NAME" ); var paramListEQUAL_SELECTION = new sapbi_ParameterList(); //Create parameter MEMBER_NAME var paramMEMBER_NAME = new sapbi_Parameter( "MEMBER_NAME", VAL ); paramListEQUAL_SELECTION.addParameter( paramMEMBER_NAME ); //End parameter MEMBER_NAME! paramEQUAL_SELECTION.setChildList( paramListEQUAL_SELECTION ); paramListRANGE_SELECTION_OPERATOR.addParameter( paramEQUAL_SELECTION ); //End parameter EQUAL_SELECTION! paramRANGE_SELECTION_OPERATOR.setChildList( paramListRANGE_SELECTION_OPERATOR );

- 86 -

Page 89: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

commandSET_SELECTION_STATE_SIMPLE_1.addParameter( paramRANGE_SELECTION_OPERATOR ); //End parameter RANGE_SELECTION_OPERATOR! //End command commandSET_SELECTION_STATE_SIMPLE_1 //Add the command to the sequence commandSequence.addCommand( commandSET_SELECTION_STATE_SIMPLE_1 ); return commandSequence; } function setVariableValue(commandSequence, VAR, VAL) { // Define the Variable Type variabletype = getVarType(VAR); alert(variabletype); if(variabletype == 'DOUBLE') { variabletype = 'FORMULA_VARIABLE'; } if(variabletype =='INFO_OBJECT_MEMBER') { variabletype = 'VARIABLE_INPUT_STRING'; } if(variabletype == null || variabletype == undefined || variabletype =='') { variabletype = 'VARIABLE_INPUT_STRING'; } //Create a new object of type sapbi_Command with the command named "SET_VARIABLES_STATE" var commandSET_VARIABLES_STATE_1 = new sapbi_Command( "SET_VARIABLES_STATE" ); //Create parameter VARIABLE_VALUES var paramVARIABLE_VALUES = new sapbi_Parameter( "VARIABLE_VALUES", "" ); var paramListVARIABLE_VALUES = new sapbi_ParameterList(); //Create parameter VARIABLE_VALUE var paramVARIABLE_VALUE1 = new sapbi_Parameter( "VARIABLE_VALUE", "" ); var paramListVARIABLE_VALUE1 = new sapbi_ParameterList(); //Create parameter VARIABLE var paramVARIABLE = new sapbi_Parameter( "VARIABLE", VAR ); paramListVARIABLE_VALUE1.addParameter( paramVARIABLE ); //End parameter VARIABLE! //Create parameter VARIABLE_TYPE var paramVARIABLE_TYPE = new sapbi_Parameter( "VARIABLE_TYPE", variabletype ); var paramListVARIABLE_TYPE = new sapbi_ParameterList(); //Create parameter FORMULA_VARIABLE var paramFORMULA_VARIABLE = new sapbi_Parameter( variabletype, VAL ); paramListVARIABLE_TYPE.addParameter( paramFORMULA_VARIABLE ); //End parameter FORMULA_VARIABLE! paramVARIABLE_TYPE.setChildList( paramListVARIABLE_TYPE ); paramListVARIABLE_VALUE1.addParameter( paramVARIABLE_TYPE ); //End parameter VARIABLE_TYPE! paramVARIABLE_VALUE1.setChildList( paramListVARIABLE_VALUE1 ); paramListVARIABLE_VALUES.addParameter( paramVARIABLE_VALUE1 ); //End parameter VARIABLE_VALUE! paramVARIABLE_VALUES.setChildList( paramListVARIABLE_VALUES ); commandSET_VARIABLES_STATE_1.addParameter( paramVARIABLE_VALUES ); //End parameter VARIABLE_VALUES! //End command commandSET_VARIABLES_STATE_1

- 87 -

Page 90: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

//Add the command to the sequence commandSequence.addCommand( commandSET_VARIABLES_STATE_1 ); //Send the command sequence to the server return commandSequence; }

9.4 Source Code for Service in Template <bi:bisp xmlns="http://www.w3.org/TR/REC-html40" xmlns:bi="http://xml.sap.com/2005/01/bi/wad/bisp" xmlns:jsp="http://java.sun.com/JSP/Page" > <html > <head > <title >Netweaver BI Web Application</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body > <bi:QUERY_VIEW_DATA_PROVIDER name="DP_1" > <bi:INITIAL_STATE type="CHOICE" value="QUERY" > <bi:QUERY value="ZD_DX_M01_Q0006_COND" text="DalSegno - Condition Variable" /> </bi:INITIAL_STATE> </bi:QUERY_VIEW_DATA_PROVIDER> <bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" /> <!-- insert data providers, items and other template content here --> <bi:SCRIPT_ITEM name="SCRIPT_ITEM_1" designwidth="300" designheight="70" > <bi:SCRIPT value="biLargeData:QG9A82CU30UXHO9WMMKJGGVNP" /> </bi:SCRIPT_ITEM> <bi:DATA_PROVIDER_INFO_ITEM name="DATA_PROVIDER_INFO_ITEM_1" designheight="120" designwidth="300" > <bi:DATA_PROVIDER_REF value="DP_1" /> </bi:DATA_PROVIDER_INFO_ITEM> </body> </html> </bi:bisp>

9.5 References On the web, http://www.w3schools.com is a great reference for XSL examples. In addition, a great book on XSLT is: XSLT 2.0 Programmer’s Reference Third Edition by Michael Kay

- 88 -

Page 91: How To… Integrate SAP NetWeaver 7.0 BI …...1 Scenario In this scenario, we will integrate UI Elements from BI Web Application Designer such as hierarchies, listboxes, and dialogs

www.sap.com/netweaver