29
EXPLORE SAP NETWEAVER BI INTERFACES IM265 Exercises / Solutions Frontend Andreas Keppler, Tobias Kaufmann SAP NetWeaver RIG, EMEA Marc Bernard, Tanner Spaulding SAP NetWeaver RIG, Americas

IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

EXPLORE SAP NETWEAVER BIINTERFACESIM265

Exercises / Solutions Frontend

Andreas Keppler, Tobias KaufmannSAP NetWeaver RIG, EMEA

Marc Bernard, Tanner SpauldingSAP NetWeaver RIG, Americas

Page 2: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

2

01_Introduction Web Item Analysis ModificationBusiness ScenarioYou are asked to enhance the visualization of your BEx Web Applications. One request is to align the column widthsover several tables. Another requirement is to display comments inside a table close to the key figures. The thirdrequest is about scrolling; your users would like to work with a fix header.

Page 3: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

3

02_Exercise Web Item Analysis Modification1. Create Web Template with fix column widthYou have to perform the following tasks to create a Web Template with fix column width:

a) Start the BEx Web Application Designerb) Create a blank Web Templatec) Create a new Data Provider based on query ZIM265_QUERYd) Drag & Drop a Web Item Navigation Pane to your Web Templatee) Drag & Drop a Web Item Analysis to your Web Templatef) Change the property Modification of the Web Item Analysis to Single Moduleg) Press the Edit Parameter button and set the following parameter:

Switch Active to OnChoose Generic Module as Type and press EditEnter com.sap.ip.bi.rig.ColumnWidth as Implementation Name

Press Edit on the Parameter in the Parameter List to add a new parameterEnter COLUMN_FIX_DEFAULT as Name/ExpressionChoose Integer as ValueEnter 150 as IntegerPress OK

Press Edit on the Parameter in the Parameter List to add a new parameterEnter COLUMN_DEFAULT as Name/ExpressionChoose Integer as ValueEnter 100 as IntegerPress OK

Close the dialogs

h) Save the Web Template under the name ZIM265_MOD_COL_WIDTH_<group_number>i) Execute the Web Template

If you like, you can add more parameters to the Parameter List.

j) Add fix width for column with index 1Press Edit on the Parameter in the Parameter List to add a new parameterEnter COLUMN_1 as Name/Expression (“_1” indicates index; alternatively, you can choose Integer in thePlaceholder List and enter 1 as Integer; see documentation for more options)Choose Integer as ValueEnter 200 as Integer

Press OK

k) Add fix width for column for characteristic 0D_MATERIALPress Edit on the Parameter in the Parameter List to add a new parameterEnter COLUMN as Name/ExpressionChoose Integer as ValueEnter 200 as Integer

Page 4: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

4

Choose Characteristic as Value in Placeholder ListEnter 0D_MATERIAL as Characteristic (or select from value help)

Press OK

Use the Navigation Pane to see the different behavior.

2. Create Web Template with commentsYou have to perform the following tasks to create a Web Template that shows comments in the table:

NoteThe module DocumentContent sets the width of one column. If you set the width of one column, you have to set alsothe width of all other columns. This could be done with the module ColumnWidth (see above).

a) Start the BEx Web Application Designerb) Create a blank Web Templatec) Create a new Data Provider based on query ZIM265_QUERYd) Drag & Drop a Web Item Navigation Pane to your Web Templatee) Drag & Drop a Web Item Analysis to your Web Templatef) Change the property Modification of the Web Item Analysis to Module Listg) Press the Edit Parameter button to add the first module and set the following parameter:

Switch Active to OnChoose Generic Module as Type and press EditEnter com.sap.ip.bi.rig.ColumnWidth as Implementation Name

Press Edit on the Parameter in the Parameter List to add a new parameterEnter COLUMN_DEFAULT as Name/ExpressionChoose Integer as ValueEnter 100 as Integer

Press OKClose the dialogs

h) Press the Edit Parameter button to add the second module and set the following parameter:Switch Active to OnChoose Generic Module as Type and press EditEnter com.sap.ip.bi.rig.DocumentContent as Implementation Name

Press Edit on the Parameter in the Parameter List to add a new parameterEnter DISPLAY_TEXT_PLAIN as Name/ExpressionChoose Boolean as ValueSwitch Boolean to On

Press OK

Press Edit on the Parameter in the Parameter List to add a new parameterEnter COLUMN as Name/ExpressionChoose Boolean as ValueSwitch Boolean to OnChoose Integer as Value in Placeholder List

Page 5: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

5

Enter 4 as Integer

Press OK

Press Edit on the Parameter in the Parameter List to add a new parameterEnter WIDTH as Name/ExpressionChoose Integer as ValueEnter 200 as Integer

Press OK

Press Edit on the Parameter in the Parameter List to add a new parameterEnter ALIGNMENT as Name/ExpressionChoose String as ValueEnter LEFT as String

Press OKClose the dialogs

i) Save the Web Template under the name ZIM265_MOD_DOC_<group_number>j) Execute the Web Template

3. Create Web Template with scrollingYou have to perform the following tasks to create a Web Template with scrolling:

a) Start the BEx Web Application Designerb) Create a blank Web Templatec) Create a new Data Provider based on query ZIM265_QUERYd) Drag & Drop a Web Item Navigation Pane to your Web Templatee) Drag & Drop a Web Item Analysis to your Web Templatef) Change the property Modification of the Web Item Analysis to Single Moduleg) Press the Edit Parameter button and set the following parameter:

Switch Active to OnChoose Generic Module as Type and press EditEnter com.sap.ip.bi.rig.Scrolling as Implementation Name

Press Edit on the Parameter in the Parameter List to add a new parameterEnter HEIGHT as Name/ExpressionChoose String as ValueEnter document.body.clientHeight / 2 as StringPress OK

Close the dialogs

h) Save the Web Template under the name ZIM265_MOD_SCROLL_<group_number>i) Execute the Web Templatej) Use the Navigation Pane to change the size of the table.

Page 6: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

6

03_Solution Web Item Analysis ModificationAs a standard solution, you can check the Web Templates ZIM265_MOD_COL_WIDTH_SOLUTION,ZIM265_MOD_DOC_SOLUTION and ZIM265_MOD_SCROLL_SOLUTION in the system.

In addition, please find the complete XHTML of the Web Templates in Appendix 04_1 at the end of this document.

Switch to the XHTML view and compare your version with the appendix.

More Information: See documentation Analysis Web Item: Using Parameter Modification

Page 7: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

7

01_Introduction Custom PresentationBusiness ScenarioYour Canadian subsidiary requires displaying the master data in two languages. In addition, the text will be longer thanthe allowed 60 characters.

02_Exercise Custom Presentation1. Create Web Template with fix column widthYou have to perform the following tasks to create a Web Template with fix column width:

a) Start the BEx Web Application Designerb) Create a blank Web Templatec) Create a new Data Provider based on query ZIM265_QUERY

Parameters for custom presentation could not be entered in the Data Provider dialogSwitch to the XHTML viewExtend the properties in the following way

<bi:QUERY_VIEW_DATA_PROVIDER name="DP_1" > <bi:INITIAL_STATE type="CHOICE" value="QUERY" > <bi:QUERY value="ZIM265_QUERY" text="ZIM265_QUERY" /> </bi:INITIAL_STATE> <bi:CUSTOMER_EXIT_LIST type="ORDEREDLIST" > <bi:CUSTOMER_EXIT type="COMPOSITE" index="1" > <bi:CUSTOMER_EXIT_TYPE type="CHOICE" value="ABAP_CLASS_NAME" > <bi:ABAP_CLASS_NAME value="ZIM265_CL_BICS_PRES_BILINGU" /> </bi:CUSTOMER_EXIT_TYPE> <bi:NAMED_PROPERTY_LIST type="UNORDEREDLIST" >

Page 8: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

8

<bi:NAMED_PROPERTY type="COMPOSITE" index="1" > <bi:NAME value="LANGUAGE_1" /> <bi:VALUE value="EN" /> </bi:NAMED_PROPERTY> <bi:NAMED_PROPERTY type="COMPOSITE" index="2" > <bi:NAME value="LANGUAGE_2" /> <bi:VALUE value="FR" /> </bi:NAMED_PROPERTY> </bi:NAMED_PROPERTY_LIST> </bi:CUSTOMER_EXIT> </bi:CUSTOMER_EXIT_LIST> </bi:QUERY_VIEW_DATA_PROVIDER>

ZIM265_CL_BICS_PRES_BILINGU is the name of the ABAP class (use SE24 to view ABAP class)LANGUAGE_1 and LANGUAGE_2 are parameters that a read in the ABAP methodIF_BICS_CONS_MD_EXIT~INITIALIZEIn ABAP method IF_BICS_CONS_MD_EXIT~GET_EXTENSIONS the technical name of the CustomPresentation (that is used later in step e5) is definedIn ABAP method IF_BICS_CONS_MD_EXIT~GET_VALUES the different languages are read and the new textconcatenated

If you like you can copy the ABAP class ZIM265_CL_BICS_PRES_BILINGU and create your own ABAP classZIM265_CL_BICS_PRES_BILINGU_<group_number>

d) Drag & Drop a Web Item Button Group to your Web Templatee) Press Edit parameter button to add a new button

Enter Set bi-lingual Text as CaptionChoose command SET_PRESENTATIONSelect DP_1 as affected Data ProviderChoose 0D_MATERIAL as CharacteristicChoose Result Set as Presentation AreaEnter CUSTOM_BILINGUAL_TEXT as Member Presentation

Repeat these steps for Member Presentation TEXT and DISPLAY_KEY

f) Drag & Drop a Web Item Analysis to your Web Templateg) Drag & Drop a Web Item Context Menu to your Web Template

Switch parameter Save View to OnThis allows you to save the current navigation state including the custom presentation to a reusable QueryView which is used in other Web Template

h) If you like, you can choose to the Web Template in the Properties pane and add the commandSET_PRESENTATION as action for the parameter Action Before First Display

i) Save the Web Template under the name ZIM265_PRES_BILINGU_<group_number>j) Execute the Web Template

03_Solution Custom PresentationAs a standard solution, you can check the Web Templates ZIM265_PRES_BILINGU_SOLUTION in the system.In addition, please find the complete XHTML of the Web Templates in Appendix 04_2 at the end of this document.Switch to the XHTML view and compare your version with the appendix.

Page 9: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

9

01_Introduction Command Export XMLBusiness ScenarioYou run a report and would like to display further detailed information based on the current navigation state.

02_Exercise Command Export XML1. Create Web Template with command Export XMLYou have to perform the following tasks to create a Web Template with command Export XML:

a) Start the BEx Web Application Designerb) Create a blank Web Templatec) Create a new Data Provider based on query ZIM265_QUERYd) Drag & Drop a Web Item Button Group to your Web Templatee) Press Edit parameter button to add a new button

Enter Export XML as CaptionChoose command EXPORT_XMLSelect DP_1 as affected Data ProviderEnter http://cimtdc00.wdf.sap.corp:8001/sap/bc/bsp/sap/zim265_bsp/output.htm as Redirect URLSwitch Output Navigation Status to OnSwitch Output Result Data to On

Page 10: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

10

f) Drag & Drop a Web Item Navigation Pane to your Web Templateg) Drag & Drop a Web Item Analysis to your Web Templateh) Save the Web Template under the name ZIM265_EXPORT_XML_<group_number>i) Execute the Web Template

If you like you can copy the BSP ZIM265_BSP and create your own BSP ZIM265_BSP_<group_number>

We recommend rendering the hostname of the SAP Web Application Server (ABAP server) as JavaScriptvariable into the HTML. You can do this with the help of the Web Item Custom Extension (see below). Youhave to use a Web Item Script to generate the JavaScript coding (using the Command Wizard) for thecommand EXPORT_XML. In a second step, you can extend the Redirect URL of the command by theJavaScript variable from the Web Item Custom Extension.

03_Solution Command Export XMLAs a standard solution, you can check the Web Templates ZIM265_EXPORT_XML_SOLUTION in the system.

In addition, please find the complete XHTML of the Web Templates in Appendix 04_3 at the end of this document.

Switch to the XHTML view and compare your version with the appendix.

More Information: See documentation Export Data Provider as XML and ABAP InterfaceIF_BICS_CONS_WEBITEM_CUST_EXIT (regarding using XML)

Page 11: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

11

01_Introduction Web Item Custom ExtensionBusiness ScenarioThe Web Item Custom Extension allows you to render your own HTML and JavaScript. This exercise demonstrate thefollowing use cases:

Retrieve information from XML (Data Provider and current characteristics in rows) Generating server-side JavaScript Passing parameters from Web Template to ABAP class Display information in messages

Page 12: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

12

02_Exercise Web Item Custom Extension2. Create Web Template with Web Item Custom ExtensionYou have to perform the following tasks to create a Web Template with a Web Item Custom Extension:

a) Start the BEx Web Application Designerb) Create a blank Web Templatec) Create a new Data Provider based on query ZIM265_QUERYd) Drag & Drop a Web Item Custom Extension to your Web Template

Press Edit button to change parameter Customer ExitChoose ABAP Class Name as Exit TypeEnter ZIM265_CL_CUSTOMER_EXIT as ABAP Class NameEnter one or more Name/Value pairs to the Properties ListPress OK

Choose DP_1 as Data Provider in the Access Data Provider ListSwitch Access navigational and Access result set to On

e) Drag & Drop a Web Item Navigation Pane to your Web Templatef) Drag & Drop a Web Item Analysis to your Web Templateg) Save the Web Template under the name ZIM265_CUSTOMER_EXIT_<group_number>h) Execute the Web Template

Use the Navigation Panel to change the navigation state and to see the impact on the Web Item CustomExtension.

If you like you can copy the ABAP class ZIM265_CL_CUSTOMER_EXIT and create your own ABAP classZIM265_CL_CUSTOMER_EXIT_<group_number>

03_Solution Web Item Custom ExtensionAs a standard solution, you can check the Web Templates ZIM265_CUSTOMER_EXIT_SOLUTION in the system.

In addition, please find the complete XHTML of the Web Templates in Appendix 04_4 at the end of this document.

Switch to the XHTML view and compare your version with the appendix.

More Information: See documentation Custom Extension Web Item

Page 13: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

13

04_Appendix04_1_Web Item Analysis ModificationWeb Template ZIM265_MOD_COL_WDITH_SOLUTION<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 >BEx 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="ZIM265_QUERY" /> </bi:INITIAL_STATE> </bi:QUERY_VIEW_DATA_PROVIDER> <bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" />

<p ><bi:NAVIGATION_PANE_ITEM name="NAVIGATION_PANE_ITEM_1" designwidth="100" designheight="145" >

<bi:WIDTH value="100" /> <bi:HEIGHT value="145" /> <bi:DATA_PROVIDER_REF value="DP_1" /> </bi:NAVIGATION_PANE_ITEM>

</p> <p >

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_NO_MOD" designwidth="400" designheight="200" > <bi:DATA_PROVIDER_REF value="DP_1" /> </bi:ANALYSIS_ITEM>

</p> <p >

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_DEFAULT" designwidth="400" designheight="200" > <bi:DATA_PROVIDER_REF value="DP_1" /> <bi:MODIFICATION type="CHOICE" value="MOD_SINGLE_MODULE" > <bi:MOD_SINGLE_MODULE type="COMPOSITE" > <bi:ACTIVE value="X" /> <bi:MOD_SELECT type="CHOICE" value="MOD_GENERIC_MODULE" > <bi:MOD_GENERIC_MODULE type="COMPOSITE" > <bi:MOD_REFERENCE value="com.sap.ip.bi.rig.ColumnWidth" /> <bi:MOD_PARAMETER_LIST type="ORDEREDLIST" > <bi:MOD_PARAMETER type="COMPOSITE" index="1" > <bi:MOD_PARAM_NAME value="COLUMN_FIX_DEFAULT" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="150" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> <bi:MOD_PARAMETER type="COMPOSITE" index="2" > <bi:MOD_PARAM_NAME value="COLUMN_DEFAULT" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="100" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> </bi:MOD_PARAMETER_LIST> </bi:MOD_GENERIC_MODULE> </bi:MOD_SELECT> </bi:MOD_SINGLE_MODULE> </bi:MODIFICATION> </bi:ANALYSIS_ITEM>

</p> <p >

Page 14: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

14

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_INDEX" designwidth="400" designheight="200" > <bi:DATA_PROVIDER_REF value="DP_1" /> <bi:MODIFICATION type="CHOICE" value="MOD_SINGLE_MODULE" > <bi:MOD_SINGLE_MODULE type="COMPOSITE" > <bi:ACTIVE value="X" /> <bi:MOD_SELECT type="CHOICE" value="MOD_GENERIC_MODULE" > <bi:MOD_GENERIC_MODULE type="COMPOSITE" > <bi:MOD_REFERENCE value="com.sap.ip.bi.rig.ColumnWidth" /> <bi:MOD_PARAMETER_LIST type="ORDEREDLIST" > <bi:MOD_PARAMETER type="COMPOSITE" index="1" > <bi:MOD_PARAM_NAME value="COLUMN_FIX_DEFAULT" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="150" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> <bi:MOD_PARAMETER type="COMPOSITE" index="2" > <bi:MOD_PARAM_NAME value="COLUMN_DEFAULT" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="100" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> <bi:MOD_PARAMETER type="COMPOSITE" index="3" > <bi:MOD_PARAM_NAME value="COLUMN_1" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="200" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> </bi:MOD_PARAMETER_LIST> </bi:MOD_GENERIC_MODULE> </bi:MOD_SELECT> </bi:MOD_SINGLE_MODULE> </bi:MODIFICATION> </bi:ANALYSIS_ITEM>

</p> <p >

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_CHAR" designwidth="400" designheight="200" > <bi:DATA_PROVIDER_REF value="DP_1" /> <bi:MODIFICATION type="CHOICE" value="MOD_SINGLE_MODULE" > <bi:MOD_SINGLE_MODULE type="COMPOSITE" > <bi:ACTIVE value="X" /> <bi:MOD_SELECT type="CHOICE" value="MOD_GENERIC_MODULE" > <bi:MOD_GENERIC_MODULE type="COMPOSITE" > <bi:MOD_REFERENCE value="com.sap.ip.bi.rig.ColumnWidth" /> <bi:MOD_PARAMETER_LIST type="ORDEREDLIST" > <bi:MOD_PARAMETER type="COMPOSITE" index="1" > <bi:MOD_PARAM_NAME value="COLUMN_FIX_DEFAULT" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="150" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> <bi:MOD_PARAMETER type="COMPOSITE" index="2" > <bi:MOD_PARAM_NAME value="COLUMN_DEFAULT" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="100" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> <bi:MOD_PARAMETER type="COMPOSITE" index="3" > <bi:MOD_PARAM_NAME value="COLUMN" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="200" /> </bi:MOD_PARAM_VALUE> <bi:MOD_PLACEHOLDER_LIST type="ORDEREDLIST" > <bi:MOD_PARAM_VALUE type="CHOICE" index="1" value="CHARACTERISTIC" >

Page 15: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

15

<bi:CHARACTERISTIC value="0D_MATERIAL" text="0D_MATERIAL" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PLACEHOLDER_LIST> </bi:MOD_PARAMETER> </bi:MOD_PARAMETER_LIST> </bi:MOD_GENERIC_MODULE> </bi:MOD_SELECT> </bi:MOD_SINGLE_MODULE> </bi:MODIFICATION> </bi:ANALYSIS_ITEM>

</p><!-- insert data providers, items and other template content here -->

</body> </html></bi:bisp>

Web Template ZIM265_MOD_DOC_SOLUTION<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 >BEx 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="ZIM265_QUERY" /> </bi:INITIAL_STATE> </bi:QUERY_VIEW_DATA_PROVIDER> <bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" />

<p ><bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_MOD" designwidth="400" designheight="200" >

<bi:DATA_PROVIDER_REF value="DP_1" /> <bi:MODIFICATION type="CHOICE" value="MOD_MODULE_LIST" > <bi:MOD_MODULE_LIST type="ORDEREDLIST" > <bi:MOD_SINGLE_MODULE type="COMPOSITE" index="2" > <bi:ACTIVE value="X" /> <bi:MOD_SELECT type="CHOICE" value="MOD_GENERIC_MODULE" > <bi:MOD_GENERIC_MODULE type="COMPOSITE" > <bi:MOD_REFERENCE value="com.sap.ip.bi.rig.DocumentContent" /> <bi:MOD_PARAMETER_LIST type="ORDEREDLIST" > <bi:MOD_PARAMETER type="COMPOSITE" index="1" > <bi:MOD_PARAM_NAME value="DISPLAY_TEXT_PLAIN" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="BOOLEAN" /> </bi:MOD_PARAMETER> <bi:MOD_PARAMETER type="COMPOSITE" index="2" > <bi:MOD_PARAM_NAME value="COLUMN" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="BOOLEAN" /> <bi:MOD_PLACEHOLDER_LIST type="ORDEREDLIST" > <bi:MOD_PARAM_VALUE type="CHOICE" index="1" value="INTEGER" > <bi:INTEGER value="4" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PLACEHOLDER_LIST> </bi:MOD_PARAMETER> <bi:MOD_PARAMETER type="COMPOSITE" index="3" > <bi:MOD_PARAM_NAME value="WIDTH" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="200" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> <bi:MOD_PARAMETER type="COMPOSITE" index="4" > <bi:MOD_PARAM_NAME value="ALIGNMENT" />

Page 16: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

16

<bi:MOD_PARAM_VALUE type="CHOICE" value="STRING" > <bi:STRING value="LEFT" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> </bi:MOD_PARAMETER_LIST> </bi:MOD_GENERIC_MODULE> </bi:MOD_SELECT> </bi:MOD_SINGLE_MODULE> <bi:MOD_SINGLE_MODULE type="COMPOSITE" index="1" > <bi:ACTIVE value="X" /> <bi:MOD_SELECT type="CHOICE" value="MOD_GENERIC_MODULE" > <bi:MOD_GENERIC_MODULE type="COMPOSITE" > <bi:MOD_REFERENCE value="com.sap.ip.bi.rig.ColumnWidth" /> <bi:MOD_PARAMETER_LIST type="ORDEREDLIST" > <bi:MOD_PARAMETER type="COMPOSITE" index="1" > <bi:MOD_PARAM_NAME value="COLUMN_DEFAULT" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="INTEGER" > <bi:INTEGER value="100" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> </bi:MOD_PARAMETER_LIST> </bi:MOD_GENERIC_MODULE> </bi:MOD_SELECT> </bi:MOD_SINGLE_MODULE> </bi:MOD_MODULE_LIST> </bi:MODIFICATION> </bi:ANALYSIS_ITEM>

</p> <p >

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_ICON" designwidth="400" designheight="200" > <bi:DATA_PROVIDER_REF value="DP_1" /> <bi:DOCUMENT_ICONS_MASTERDATA value="X" /> <bi:DOCUMENT_ICONS_DATA value="X" /> </bi:ANALYSIS_ITEM>

</p><!-- insert data providers, items and other template content here -->

</body> </html></bi:bisp>

Web Template ZIM265_MOD_SCROLL_SOLUTION<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 >BEx 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="ZIM265_QUERY" /> </bi:INITIAL_STATE> </bi:QUERY_VIEW_DATA_PROVIDER> <bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" />

<p ><bi:NAVIGATION_PANE_ITEM name="NAVIGATION_PANE_ITEM_1" designwidth="100" designheight="102" >

<bi:WIDTH value="100" /> <bi:HEIGHT value="102" /> <bi:DATA_PROVIDER_REF value="DP_1" /> </bi:NAVIGATION_PANE_ITEM>

</p> <p >

Page 17: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

17

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_1" designwidth="400" designheight="200" > <bi:DATA_PROVIDER_REF value="DP_1" /> <bi:MODIFICATION type="CHOICE" value="MOD_SINGLE_MODULE" > <bi:MOD_SINGLE_MODULE type="COMPOSITE" > <bi:ACTIVE value="X" /> <bi:MOD_SELECT type="CHOICE" value="MOD_GENERIC_MODULE" > <bi:MOD_GENERIC_MODULE type="COMPOSITE" > <bi:MOD_REFERENCE value="com.sap.ip.bi.rig.Scrolling" /> <bi:MOD_PARAMETER_LIST type="ORDEREDLIST" > <bi:MOD_PARAMETER type="COMPOSITE" index="1" > <bi:MOD_PARAM_NAME value="HEIGHT" /> <bi:MOD_PARAM_VALUE type="CHOICE" value="STRING" > <bi:STRING value="document.body.clientHeight / 2" /> </bi:MOD_PARAM_VALUE> </bi:MOD_PARAMETER> </bi:MOD_PARAMETER_LIST> </bi:MOD_GENERIC_MODULE> </bi:MOD_SELECT> </bi:MOD_SINGLE_MODULE> </bi:MODIFICATION> <bi:BLOCK_COLUMNS_SIZE value="0" /> <bi:BLOCK_ROWS_SIZE value="0" /> </bi:ANALYSIS_ITEM>

</p><!-- insert data providers, items and other template content here -->

</body> </html></bi:bisp>

04_2_Custom PresentationABAP Class ZIM265_CL_BICS_PRES_BILINGUBased on ABAP Interface IF_BICS_CONS_MD_EXIT.

Attributes

Attribute Level Visibility TypingAssociatedType Description Initial value

IF_BICS_CONS_MD_EXIT~N_EXIT_TYPE Constant Public Type

RSBOLAP_OBJECT_NAME Exit Type

'BICS_MASTER_DATA_EXTENSION'

C_PRESENTATION_NAMEInstanceAttribute Private Type

RSBOLAP_OBJECT_NAME

ObjektName 'BILINGUAL_TEXT'

P_LANGUAGE_1InstanceAttribute Private Type SY-LANGU Sprache 1

P_LANGUAGE_2InstanceAttribute Private Type SY-LANGU Sprache 2

Methods

method if_bics_cons_md_exit~get_extensions.

* This method returns the technical name in l_s_presentations-name (see constant attribute c_presentation_name)* and the textual description in l_s_presentations-text.* The name will be used in the BEx Web API command SET_PRESENTATION.* The text will be shown in the properties dialog of the characteristic.

Page 18: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

18

data: l_s_info_object_names type rsbolap_s_object_name, l_s_presentations type bics_cons_md_exit_presentation.

loop at i_t_info_object_names into l_s_info_object_names. l_s_presentations-info_object_name = l_s_info_object_names-name. l_s_presentations-name = c_presentation_name. l_s_presentations-text = 'Text (bilingual)'. l_s_presentations-is_key_presentation = rs_c_false. l_s_presentations-is_text_presentation = rs_c_true. l_s_presentations-is_for_display = rs_c_true.

append l_s_presentations to e_t_presentations.

endloop.

endmethod.

method if_bics_cons_md_exit~get_values.

* This method reads the master data of two different languages and* concatenate them into the value (l_s_value-value).* The two language will be displayed in two lines. Use c_lf for line-break.

data: c_lf type string, l_h_lf(2) type x value '0D0A', l_r_conv type ref to cl_abap_conv_in_ce.

* Get the line feed and carriage return for unicode l_r_conv = cl_abap_conv_in_ce=>create( input = l_h_lf ). l_r_conv->read( importing data = c_lf ).

data: l_s_member_names type bics_cons_md_exit_s_membername, l_s_values type bics_cons_md_exit_value, l_s_iobjtxtsml type rs_s_txtsml, l_s_presentations type rsbolap_s_object_name, l_info_object_name type rsd_iobjnm.

l_info_object_name = i_info_object_name.

data: l_t_chavlinfo type rsdm_t_chavlinfo, l_s_chavlinfo type rsdm_s_chavlinfo, l_value_1 type string, l_value_2 type string.

loop at i_t_member_names into l_s_member_names.

* language 1* get text from masterdatatable

refresh l_t_chavlinfo.clear l_s_chavlinfo.

l_s_chavlinfo-c_chavl = l_s_member_names-name.

Page 19: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

19

append l_s_chavlinfo to l_t_chavlinfo.call function 'RSD_CHAVL_READ_ALL'exporting

i_iobjnm = l_info_object_name i_langu = p_language_1 i_check_value = space i_sid_in = space

changing c_t_chavlinfo = l_t_chavlinfo

exceptions info_object_not_found = 1 routines_generation_error = 2 check_table_not_existing = 3 text_table_not_existing = 4

others = 5.

if sy-subrc = 0.read table l_t_chavlinfo into l_s_chavlinfo index 1.

l_value_1 = l_s_chavlinfo-e_chatexts-txtmd.endif.

* language 2* get text from masterdatatable

refresh l_t_chavlinfo.clear l_s_chavlinfo.

l_s_chavlinfo-c_chavl = l_s_member_names-name.append l_s_chavlinfo to l_t_chavlinfo.call function 'RSD_CHAVL_READ_ALL'exporting

i_iobjnm = l_info_object_name i_langu = p_language_2 i_check_value = space i_sid_in = space

changing c_t_chavlinfo = l_t_chavlinfo

exceptions info_object_not_found = 1 routines_generation_error = 2 check_table_not_existing = 3 text_table_not_existing = 4

others = 5.

if sy-subrc = 0.read table l_t_chavlinfo into l_s_chavlinfo index 1.

l_value_2 = l_s_chavlinfo-e_chatexts-txtmd.endif.

loop at i_t_presentations into l_s_presentations.case l_s_presentations-name.

* Presentation EXAMPLE_PRESENTATION : Concatenate Shorttext, Middle Text and Longtextwhen c_presentation_name.

l_s_values-member_name = l_s_member_names-name. l_s_values-presentation = l_s_presentations-name.

Page 20: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

20

l_s_values-concatenate_value = rs_c_false.

concatenate p_language_1 ':' l_value_1 c_lf p_language_2 ':' l_value_2 into l_s_values-value .

append l_s_values to e_t_values.endcase.

endloop.

endloop.endmethod.

method if_bics_cons_md_exit~free.endmethod.

method if_bics_cons_md_exit~initialize.

* This method reads the parameters from the Web Template*<bi:CUSTOMER_EXIT_LIST type="ORDEREDLIST" >* <bi:CUSTOMER_EXIT type="COMPOSITE" index="1" >* <bi:CUSTOMER_EXIT_TYPE type="CHOICE" value="ABAP_CLASS_NAME" >* <bi:ABAP_CLASS_NAME value="ZIM265_CL_BICS_PRES_BILINGU" />* </bi:CUSTOMER_EXIT_TYPE>* <bi:NAMED_PROPERTY_LIST type="UNORDEREDLIST" >* <bi:NAMED_PROPERTY type="COMPOSITE" index="1" >* <bi:NAME value="LANGUAGE_1" />* <bi:VALUE value="EN" />* </bi:NAMED_PROPERTY>* <bi:NAMED_PROPERTY type="COMPOSITE" index="2" >* <bi:NAME value="LANGUAGE_2" />* <bi:VALUE value="FR" />* </bi:NAMED_PROPERTY>* </bi:NAMED_PROPERTY_LIST>* </bi:CUSTOMER_EXIT>*</bi:CUSTOMER_EXIT_LIST>

* Read parameterdata:

l_s_properties type rsbolap_s_name_value.

read table i_t_properties with key name = 'LANGUAGE_1' intol_s_properties.if sy-subrc = 0.

p_language_1 = l_s_properties-value.endif.read table i_t_properties with key name = 'LANGUAGE_2' into

l_s_properties.if sy-subrc = 0.

p_language_2 = l_s_properties-value.endif.

endmethod.

Page 21: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

21

Web Template ZIM265_PRES_BILINGU_SOLUTION

<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 >Custom Presentation ABAP: Bi-lingual Text</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="ZIM265_QUERY" text="ZIM265_QUERY" /> </bi:INITIAL_STATE> <bi:CUSTOMER_EXIT_LIST type="ORDEREDLIST" > <bi:CUSTOMER_EXIT type="COMPOSITE" index="1" > <bi:CUSTOMER_EXIT_TYPE type="CHOICE" value="ABAP_CLASS_NAME" > <bi:ABAP_CLASS_NAME value="ZIM265_CL_BICS_PRES_BILINGU" /> </bi:CUSTOMER_EXIT_TYPE> <bi:NAMED_PROPERTY_LIST type="UNORDEREDLIST" > <bi:NAMED_PROPERTY type="COMPOSITE" index="1" > <bi:NAME value="LANGUAGE_1" /> <bi:VALUE value="EN" /> </bi:NAMED_PROPERTY> <bi:NAMED_PROPERTY type="COMPOSITE" index="2" > <bi:NAME value="LANGUAGE_2" /> <bi:VALUE value="FR" /> </bi:NAMED_PROPERTY> </bi:NAMED_PROPERTY_LIST> </bi:CUSTOMER_EXIT> </bi:CUSTOMER_EXIT_LIST> </bi:QUERY_VIEW_DATA_PROVIDER> <bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" > <bi:WEB_TEMPLATE_ACTIONS type="COMPOSITE" > <bi:ACTION_BEFORE_FIRST_RENDERING type="COMPOSITE" > <bi:INSTRUCTION > <bi:SET_PRESENTATION > <bi:TARGET_DATA_PROVIDER_REF_LIST type="ORDEREDLIST" > <bi:TARGET_DATA_PROVIDER_REF index="1" value="DP_1" /> </bi:TARGET_DATA_PROVIDER_REF_LIST> <bi:CHARACTERISTIC value="0D_MATERIAL" text="0D_MATERIAL" /> <bi:PRESENTATION_AREA value="RESULT_SET" /> <bi:MEMBER_PRESENTATION_LIST type="ORDEREDLIST" > <bi:MEMBER_PRESENTATION index="1" value="CUSTOM_BILINGUAL_TEXT" /> </bi:MEMBER_PRESENTATION_LIST> </bi:SET_PRESENTATION> </bi:INSTRUCTION> </bi:ACTION_BEFORE_FIRST_RENDERING> </bi:WEB_TEMPLATE_ACTIONS> </bi:TEMPLATE_PARAMETERS>

<p ><bi:BUTTON_GROUP_ITEM name="BUTTON_GROUP_ITEM_1" designheight="23" designwidth="300" >

<bi:BUTTON_LIST type="ORDEREDLIST" > <bi:BUTTON type="COMPOSITE" index="1" > <bi:CAPTION value="Set bi-lingual Text" /> <bi:ACTION type="CHOICE" value="INSTRUCTION" > <bi:INSTRUCTION > <bi:SET_PRESENTATION > <bi:TARGET_DATA_PROVIDER_REF_LIST type="ORDEREDLIST" > <bi:TARGET_DATA_PROVIDER_REF index="1" value="DP_1" /> </bi:TARGET_DATA_PROVIDER_REF_LIST> <bi:CHARACTERISTIC value="0D_MATERIAL" text="0D_MATERIAL" /> <bi:PRESENTATION_AREA value="RESULT_SET" />

Page 22: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

22

<bi:MEMBER_PRESENTATION_LIST type="ORDEREDLIST" > <bi:MEMBER_PRESENTATION index="1" value="CUSTOM_BILINGUAL_TEXT" /> </bi:MEMBER_PRESENTATION_LIST> </bi:SET_PRESENTATION> </bi:INSTRUCTION> </bi:ACTION> </bi:BUTTON> <bi:BUTTON type="COMPOSITE" index="2" > <bi:CAPTION value="Set Key" /> <bi:ACTION type="CHOICE" value="INSTRUCTION" > <bi:INSTRUCTION > <bi:SET_PRESENTATION > <bi:TARGET_DATA_PROVIDER_REF_LIST type="ORDEREDLIST" > <bi:TARGET_DATA_PROVIDER_REF index="1" value="DP_1" /> </bi:TARGET_DATA_PROVIDER_REF_LIST> <bi:CHARACTERISTIC value="0D_MATERIAL" text="0D_MATERIAL" /> <bi:PRESENTATION_AREA value="RESULT_SET" /> <bi:MEMBER_PRESENTATION_LIST type="ORDEREDLIST" > <bi:MEMBER_PRESENTATION index="1" value="DISPLAY_KEY" /> </bi:MEMBER_PRESENTATION_LIST> </bi:SET_PRESENTATION> </bi:INSTRUCTION> </bi:ACTION> </bi:BUTTON> <bi:BUTTON type="COMPOSITE" index="3" > <bi:CAPTION value="Set Text" /> <bi:ACTION type="CHOICE" value="INSTRUCTION" > <bi:INSTRUCTION > <bi:SET_PRESENTATION > <bi:TARGET_DATA_PROVIDER_REF_LIST type="ORDEREDLIST" > <bi:TARGET_DATA_PROVIDER_REF index="1" value="DP_1" /> </bi:TARGET_DATA_PROVIDER_REF_LIST> <bi:CHARACTERISTIC value="0D_MATERIAL" text="0D_MATERIAL" /> <bi:PRESENTATION_AREA value="RESULT_SET" /> <bi:MEMBER_PRESENTATION_LIST type="ORDEREDLIST" > <bi:MEMBER_PRESENTATION index="1" value="TEXT" /> </bi:MEMBER_PRESENTATION_LIST> </bi:SET_PRESENTATION> </bi:INSTRUCTION> </bi:ACTION> </bi:BUTTON> </bi:BUTTON_LIST> </bi:BUTTON_GROUP_ITEM>

</p> <p >

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_1" designwidth="400" designheight="200" > <bi:DATA_PROVIDER_REF value="DP_1" /> </bi:ANALYSIS_ITEM>

<br /> </p> <p >

<bi:CONTEXT_MENU_ITEM name="CONTEXT_MENU_ITEM_1" designheight="70" designwidth="300" > <bi:MENU_VIEW_SAVE value="X" /> </bi:CONTEXT_MENU_ITEM>

<br /> </p> </body> </html></bi:bisp>

Page 23: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

23

04_3_Command Export XMLBSP ZIM265_BSP1. Create a BSP based on Pages with Flow Logic2. Create a Page output.htm

Attributes

Attribute TypingAssociatedType Description

P_CHAR_STRING Type STRING Characteristics in XMLP_XML_STRING Type STRING XML as string

Event Handler

OnInitialization* event handler for data retrieval

type-pools: rrx1.

data: l_xml_string type string, l_sx_view type rrx1_sx_view, l_s_dim type rrx1_s_dim.

l_xml_string = request->get_form_field( 'xml' ).p_xml_string = l_xml_string.

* l_xml_string contains the XML of exactly one Data Provider* convert_xml could be directly used

call method cl_bics_cons_state_converter=>convert_xmlexporting

i_xml_string = l_xml_stringimporting

e_sx_view = l_sx_view.

p_char_string = ''.loop at l_sx_view-dim into l_s_dim where axis = 'Y'.concatenate p_char_string l_s_dim-iobjtxt ' ( ' l_s_dim-

iobjnm ') ' into p_char_string respecting blanks.endloop.

Web Template ZIM265_EXPORT_XML_SOLUTION

<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 >

Page 24: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

24

<title >BEx 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="ZIM265_QUERY" /> </bi:INITIAL_STATE> </bi:QUERY_VIEW_DATA_PROVIDER> <bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" />

<p ><bi:BUTTON_GROUP_ITEM name="BUTTON_GROUP_ITEM_1" designheight="23" designwidth="300" >

<bi:BUTTON_LIST type="ORDEREDLIST" > <bi:BUTTON type="COMPOSITE" index="1" > <bi:CAPTION value="Export XML" /> <bi:ACTION type="CHOICE" value="INSTRUCTION" > <bi:INSTRUCTION > <bi:EXPORT_XML > <bi:TARGET_DATA_PROVIDER_REF value="DP_1" /> <bi:REDIRECT_URL value="http://cimtdc00.wdf.sap.corp:8001/sap/bc/bsp/sap/zim265_bsp/output.htm" /> <bi:RESULT_SET value="X" /> </bi:EXPORT_XML> </bi:INSTRUCTION> </bi:ACTION> </bi:BUTTON> </bi:BUTTON_LIST> </bi:BUTTON_GROUP_ITEM>

</p> <p >

<bi:NAVIGATION_PANE_ITEM name="NAVIGATION_PANE_ITEM_1" designwidth="100" designheight="103" > <bi:DATA_PROVIDER_REF value="DP_1" /> <bi:WIDTH value="100" /> <bi:HEIGHT value="103" /> </bi:NAVIGATION_PANE_ITEM>

</p> <p >

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_1" designwidth="400" designheight="200" > <bi:DATA_PROVIDER_REF value="DP_1" /> </bi:ANALYSIS_ITEM>

</p><!-- insert data providers, items and other template content here -->

</body> </html></bi:bisp>

04_4_Web Item Custom ExtensionABAP Class ZIM265_CL_CUSTOMER_EXITBased on ABAP Interface IF_BICS_CONS_WEBITEM_CUST_EXIT.

Page 25: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

25

Attributes

Attribute Level Visibility TypingAssociatedType Description Initial value

P_URL_PREFIX InstanceAttribute

PrivateType

STRING URL Prefix

P_CHAR_STRING InstanceAttribute

PrivateType

STRING Characteristicsin XML

P_PROPERTIES InstanceAttribute

PrivateType

STRING Properties

Methods

method if_bics_cons_webitem_cust_exit~initialize.

* This method demonstrate the following use cases:* 01 Get information from XML* 02 Generate server-side JavaScript* 03 Passing parameter from Web Template to ABAP class* 04 Display information in messages* Search for the number to see the relevant coding

* 02 Get hostnamedata: l_url_prefix type string.

call function 'RSBB_URL_PREFIX_GET'exporting

i_messageserver = spaceimporting

e_url_prefix = l_url_prefix.

concatenate p_url_prefix'<script type="text/javascript">''var url_prefix="' l_url_prefix '";''</script>'

into p_url_prefix.

* 03 Get propertiesdata: l_s_name_value type rsbolap_s_name_value.

clear p_properties.concatenate p_properties '<table border="1">' into p_properties. "#EC NOTEXT

* 03 Header lineconcatenate p_properties '<tr>' into p_properties. "#EC NOTEXTconcatenate p_properties '<th> Name </th>' into p_properties. "#EC NOTEXTconcatenate p_properties '<th> Value </th>' into p_properties. "#EC NOTEXTconcatenate p_properties '</tr>' into p_properties. "#EC NOTEXT

* 03 Value linesloop at i_t_properties into l_s_name_value.concatenate p_properties '<tr>' into p_properties. "#EC NOTEXT

Page 26: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

26

concatenate p_properties '<th>' l_s_name_value-name '</th>' into p_properties. "#EC NOTEXT

concatenate p_properties '<th>' l_s_name_value-value '</th>' into p_properties. "#EC NOTEXT

concatenate p_properties '</tr>' into p_properties. "#EC NOTEXTendloop.concatenate p_properties '</table>' into p_properties. "#EC NOTEXT

endmethod.

method if_bics_cons_webitem_cust_exit~free.endmethod.

method if_bics_cons_webitem_cust_exit~execute.

* This method demonstrate the following use cases:* 01 Get information from XML* 02 Generate server-side JavaScript* 03 Passing parameter from Web Template to ABAP class* 04 Display information in messages* Search for the number to see the relevant coding

type-pools: rrx1.

data: l_string type string, l_xml_string type string, l_xml_xstring type xstring, l_sx_view type rrx1_sx_view, l_s_dim type rrx1_s_dim.

data: l_t_data_providers type cl_bics_cons_webitem_util=>tn_t_data_provider, l_s_data_providers type cl_bics_cons_webitem_util=>tn_s_data_provider, l_r_variable_container type ref to if_ixml_node.

clear e_xml.

try.

* 01 Get information from XMLcall method cl_bics_cons_webitem_util=>utf8_xstring_2_stringexporting

i_utf8_xstring = i_xml receiving r_string = l_xml_string.

call method cl_bics_cons_webitem_util=>parse_xmlexporting

i_xml = i_xmlimporting

e_t_data_providers = l_t_data_providers

Page 27: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

27

e_r_variable_container = l_r_variable_container.

* 01 Get name of first Data Providerread table l_t_data_providers index 1 into l_s_data_providers.

call transformation bics_cons_webitem_filter_by_dpparameters dataprovider = l_s_data_providers-name

source xml i_xml result xml l_xml_xstring.

call method cl_bics_cons_state_converter=>convert_xmlexporting

i_xml = l_xml_xstringimporting

e_sx_view = l_sx_view.

* 01 Add Data Providerconcatenate l_string '<p>Data Provider: ' l_s_data_providers-

name '</p>' into l_string respecting blanks.

* 01 Add characteristics of axis y (rows)clear p_char_string.loop at l_sx_view-dim into l_s_dim where axis = 'Y'.concatenate p_char_string ' ' l_s_dim-iobjtxt ' ( ' l_s_dim-

iobjnm ') ' into p_char_string respecting blanks.endloop.

concatenate l_string '<p>Charateristic(s): ' p_char_string '</p>' into l_string respecting blanks.

* 02 Add JavaScript variable with hostnameconcatenate l_string '<p>View Source Code to see JavaScript variable</p>' into l_

string respecting blanks.concatenate l_string p_url_prefix into l_string.

* 03 Add properties tableconcatenate l_string p_properties into l_string.

* Return HTMLcall method cl_bics_cons_webitem_util=>string_2_utf8_xstringexporting

i_string = l_string receiving r_utf8_xstring = e_xml.

* 04 Output messagecall function 'RRMS_MESSAGE_HANDLING'exporting

i_class = 'BRAIN' i_type = 'S' i_number = '143' i_msgv1 = 'This is a test message...' i_msgv2 = sy-msgv2 i_msgv3 = sy-msgv3

Page 28: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

28

i_msgv4 = sy-msgv4.catch cx_bics_cons_webitem_error.

endtry.endmethod.

Web Template ZIM265_CUSTOMER_EXIT_SOLUTION<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 >BEx 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="ZIM265_QUERY" /> </bi:INITIAL_STATE> </bi:QUERY_VIEW_DATA_PROVIDER> <bi:TEMPLATE_PARAMETERS name="TEMPLATE_PARAMETERS" />

<p ><bi:CUSTOMER_EXIT_ITEM name="CUSTOMER_EXIT_ITEM_1" designheight="120" designwidth="300" >

<bi:DATA_PROVIDER_ACCESS_LIST type="ORDEREDLIST" > <bi:DATA_PROVIDER_ACCESS type="COMPOSITE" index="1" > <bi:DATA_PROVIDER_REF value="DP_1" /> <bi:RESULT_SET_ACCESS value="X" /> <bi:NAVIGATIONAL_STATE_ACCESS value="X" /> </bi:DATA_PROVIDER_ACCESS> </bi:DATA_PROVIDER_ACCESS_LIST> <bi:CUSTOMER_EXIT type="COMPOSITE" > <bi:CUSTOMER_EXIT_TYPE type="CHOICE" value="ABAP_CLASS_NAME" > <bi:ABAP_CLASS_NAME value="ZIM265_CL_CUSTOMER_EXIT" /> </bi:CUSTOMER_EXIT_TYPE> <bi:NAMED_PROPERTY_LIST type="UNORDEREDLIST" > <bi:NAMED_PROPERTY type="COMPOSITE" index="1" > <bi:NAME value="TEST" /> <bi:VALUE value="This is the parameter TEST value" /> </bi:NAMED_PROPERTY> </bi:NAMED_PROPERTY_LIST> </bi:CUSTOMER_EXIT> </bi:CUSTOMER_EXIT_ITEM>

</p> <p >

<bi:NAVIGATION_PANE_ITEM name="NAVIGATION_PANE_ITEM_1" designwidth="100" designheight="123" > <bi:DATA_PROVIDER_REF value="DP_1" /> <bi:WIDTH value="100" /> <bi:HEIGHT value="123" /> </bi:NAVIGATION_PANE_ITEM>

</p> <p >

<bi:ANALYSIS_ITEM name="ANALYSIS_ITEM_1" designwidth="400" designheight="200" > <bi:DATA_PROVIDER_REF value="DP_1" /> </bi:ANALYSIS_ITEM>

</p><!-- insert data providers, items and other template content here -->

</body> </html></bi:bisp>

Page 29: IM265 · 2017-08-25 · 2 01_Introduction Web Item Analysis Modification Business Scenario You are asked to enhance the visualization of your BEx Web Applications. One request is

29

Copyright 2007 SAP AG. All Rights ReservedNo part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAPAG. 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 softwarevendors.Microsoft, Windows, Excel, 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, System i, System i5, System p, System p5, System x, System z, System z9, z/OS, AFP, Intelligent Miner,WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower and PowerPC are trademarks orregistered trademarks of IBM Corporation.Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe SystemsIncorporated 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 trademarksof Citrix Systems, Inc.HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, MassachusettsInstitute 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 byNetscape.MaxDB is a trademark of MySQL AB, Sweden.SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as wellas their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all overthe world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in thisdocument serves informational purposes only. National product specifications may vary.

The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or transmitted in anyform or for any purpose without the express prior written permission of SAP AG.This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. Thisdocument contains only intended strategies, developments, and functionalities of the SAP® product and is not intended to bebinding upon SAP to any particular course of business, product strategy, and/or development. Please note that this document issubject to change and may be changed by SAP at any time without notice.SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or scompleteness ofthe information, text, graphics, links, or other items contained within this material. This document is provided without a warranty ofany kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particularpurpose, or non-infringement.SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damagesthat may result from the use of these materials. This limitation shall not apply in cases of intent or gross negligence.The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that youmay access through the use of hot links contained in these materials and does not endorse your use of third-party Web pages norprovide any warranty whatsoever relating to third-party Web pages.

SAP assumes no responsibility for errors or omissions in these materials