24
 How-to Guide SAP NetWeaver ‘04s How To… Work with Variables in SAP NetWeaver Visual Composer Version 1.00 – May 2006  Applicable Release s: SAP NetWeaver ’04s SPS07 or greater

Sap Vc Intro

Embed Size (px)

Citation preview

Page 1: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 1/24

How-to GuideSAP NetWeaver ‘04s

How To…Work with Variablesin SAP NetWeaverVisual ComposerVersion 1.00 – May 2006

Applicable Releases:SAP NetWeaver ’04s SPS07 or greater

Page 2: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 2/24

© Copyright 2006 SAP AG. All rights reserved.

No part of this publication may be reproduced ortransmitted in any form or for any purpose withoutthe express permission of SAP AG. The informationcontained herein may be changed without priornotice.

Some software products marketed by SAP AG andits distributors contain proprietary softwarecomponents of other software vendors.

Microsoft, Windows, Outlook, and PowerPoint areregistered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, OS/2, ParallelSysplex, 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 registeredtrademarks of IBM Corporation in the United Statesand/or other countries.

Oracle is a registered trademark of OracleCorporation.

UNIX, X/Open, OSF/1, and Motif are registeredtrademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame,WinFrame, VideoFrame, and MultiWin aretrademarks or registered trademarks of Citrix

Systems, Inc.

HTML, XML, XHTML and W3C are trademarks orregistered trademarks of W3C ®, World Wide WebConsortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems,Inc.

JavaScript is a registered trademark of SunMicrosystems, Inc., used under license fortechnology invented and implemented by Netscape.

MaxDB is a trademark of MySQL AB, Sweden.SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAPNetWeaver, and other SAP products and servicesmentioned herein as well as their respective logosare trademarks or registered trademarks of SAP AGin Germany and in several other countries all overthe world. All other product and service namesmentioned are the trademarks of their respectivecompanies. Data

contained in this document serves informationalpurposes only. National product specifications mayvary.

These materials are subject to change withoutnotice. These materials are provided by SAP AG andits affiliated companies ("SAP Group") forinformational purposes only, without representationor warranty of any kind, and SAP Group shall not beliable for errors or omissions with respect to thematerials. The only warranties for SAPGroup products and services are those that are setforth in the express warranty statementsaccompanying such products and services, if any.Nothing herein should be construed as constitutingan additional warranty.

These materials are provided “as is” without awarranty of any kind, either express or implied,including but not limited to, the implied warranties ofmerchantability, fitness for a particular purpose, ornon-infringement.SAP shall not be liable for damages of any kindincluding without limitation direct, special, indirect, orconsequential damages that may result from the useof these materials.SAP does not warrant the accuracy or completenessof the information, text, graphics, links or other itemscontained within these materials. SAP has no controlover the information that you may access through theuse of hot links contained in these materials anddoes not endorse your use of third party web pages

nor provide any warranty whatsoever relating to thirdparty web pages.SAP NetWeaver “How-to” Guides are intended tosimplify the product implementation. While specificproduct features and procedures typically areexplained in a practical business context, it is notimplied that those features and procedures are theonly approach in solving a specific business problemusing SAP NetWeaver. Should you wish to receiveadditional information, clarification or support, pleaserefer 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 aproductive system environment. The Code is onlyintended better explain and visualize the syntax andphrasing rules of certain coding. SAP does notwarrant the correctness and completeness of theCode given herein, and SAP shall not be liable forerrors or damages caused by the usage of the Code,except if such damages were caused by SAPintentionally or grossly negligent.

Page 3: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 3/24

- 1 -

1 Scenario

You have an SAP BI query with variables, and you'd like to be able to model an interactive,analytical application in SAP NetWeaver Visual Composer using this query as a dataservice. You'd like to model an input form for the variables to allow users to be able to entervalues at runtime on the portal before executing the query.

If, in fact, you have a mandatory variable, you need to model an input form or the query willfail to execute at runtime on the portal.

2 Introduction

This document provides detailed instructions on how to model an application that provides

an input form for entering variable values at runtime. We demonstrate what the variablesinput form looks like when the query is executed in BEx Analyzer, then we model the inputform in Visual Composer. We further enhance the input form with value help, which allowsthe user to easily create advanced variable selections without having to know the correctsyntax. We demonstrate two different kinds of value help for these purposes, then wedeploy the model and interact with it on the portal.

Using advanced modeling techniques, we then demonstrate how you can reduce thenumber of forms your users need to access by chaining input fields together.

2.1 Prerequisites

All you need to model this scenario is delivered in SAP NetWeaver 2004s SP Stack 07 orgreater.

In particular:

• SAP BI system, defined with the SAP BI Connector in the Portal System LandscapeThis includes SAP BW 3.5 systems SP15 or greater, or SAP NetWeaver 2004s BIsystems.

• SAP BI query in this system defined with one or more variables• SAP NetWeaver Visual Composer

Note: Queries with mandatory variables are not supported by BI XMLA connections, so if you havecreated an SAP BI system on the portal using the BI XMLA Connector, you won't be able touse the BI Integration Wizard or MDX Editor, for example, with queries with mandatoryvariables.

To fully leverage BI query capabilities, however, this document relies on an SAP BI systemcreated with the SAP BI Connector.

Page 4: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 4/24

- 2 -

2.2 For More Information

For more information about SAP BI variables, see the online

documentation at:

ht tp: / /help .sap.com/ → SAP NetWeaver → SAP NetWeaver 2004s → SAPNetWeaver by Key Capability → Information Integration by Key Capability → Business Intelligence → BI Suite: Business Explorer → Query Design: BExQuery Designer → Reusable Query Components → Variables

For more information about modeling applications in Visual Composer, see the SAPNetWeaver Visual Composer Modeler's Guide and the SAP NetWeaver Visual ComposerReference Guide .

Page 5: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 5/24

- 3 -

3 The Step By Step Solution

To model an application using variables in Visual Composer, we perform these steps:

1. Model the basic elements: data service, input form, and table.2. Explore the different kinds of variable "display areas" and required syntax.

Considering the variables functionality when the query is executed in BEx Analyzer,add value help to the input form, which automatically generates valid values andselection syntax.

3. Deploy the model and interact with the application in the portal.4. Model advanced input fields, to reduce the number of forms at runtime.

3.1 Model the Basic Elements

In this step, we create data service, input form, and table that form the foundation of theapplication. We also restrict the number of fields displayed on the input form.

1. Launch Visual Composer in theportal to which your SAP BI systemis connected.

2. Open an existing model in which tomodel your application, or create anew one.

3. Navigate into an existing iView or

create a new one and navigate intoit.

From the Find Data Services taskpanel, select the SAP BI system inwhich your query is located, and findthe query that contains the variables. In this example, we're using theOrder and Sales Values query(technical name 0D_SD_C03_Q009 ),delivered with SAP Demo content,which has several optional variablesdefined.

Any variables saved in an SAP BIquery display in the Variables folderin the InfoObject tree. Optionalvariables appear with an icon with agreen equals sign; mandatoryvariables display a red equals sign.

Page 6: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 6/24

- 4 -

4. Drag the query to the VisualComposer storyboard.

5. Drag from the data service'sVariables port and choose AddInput Form .

6. Drag from the data service's Output port and choose Add Table View ,and select the fields you want todisplay in the table.

7. Double-click the Variables Form ,and in the Field section of theConfigure Element task panel,select the variables for which youwant to provide input when thequery is executed at runtime on theportal, keeping the SUBMIT buttonalso selected. Save your model.

In this example, we are going toprovide input fields for two of thequery's variables.

Note: If you have mandatoryvariables, you must keep these onthe form.

At this point, your model is functionally complete, and you could deploy it to the portal,enter values in the variable fields, and execute the query. However, you need to enter theproper values and selection syntax in each of the input fields. This is what we discuss inthe next section.

Page 7: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 7/24

- 5 -

3.2 Add Value Help to the Input Form

In this step, we first explore the different types of "display areas" of BI system variables andthe syntax that is required by each in an input field in Visual Composer, then we take a look

at what the variable selection dialog boxes look like when a query is executed in BEx Analyzer.

Finally, we implement value help dialog boxes in Visual Composer that not only allow us tochoose valid variable values, but also provide the correct selection syntax.

3.2.1 Variable Selection Types and Syntax In the query's definition, you can configure SAP BI characteristic value variables that allowyou to provide different kinds of selections. For example, you can configure a variable toselect single values, multiple values, or a range of values. These are called "display areas"of variables in SAP BI, and each requires a specific type of syntax in an input field in Visual

Composer.

The following table lists the display areas for variables in BI, the corresponding value helptype in Visual Composer, and the syntax required by Visual Composer in the input field byeach. Note that with variables, you must pass the Key (External Display) (* _ext_key ) valueof the characteristic to the field. " Value " in the syntax column refers to this value:

BI VariableSelection

Type (DisplayArea)

VisualComposerValue Help

Type

Input Field Syntax Examples

Single Value SingleSelection

[Value] 1612(the single value 1612 )

Multiple SingleValues

MultipleSelection

[Value 1 ];[Value 2 ];[Value 3 ]...

1612;1614( 1612 and 1614 )

Interval IntervalSelection

[Value (Start) ]:[Value (End) ] 07/2004:12/2004(the range from 07/2004 to 12/2004)

SelectionOption

SelectionOptions

[Value]:[Value (End -optional) ]: Operator :I(Includes) or E (Excludes)

Available Operators:

• EQ -- Equal to

• GE -- Greater than or equalto

• GT -- Greater than

• LE -- Less than or equal to

• LT -- Less than

• BT -- Between

1592::EQ:I;1612:1614:BT:I(include the single value 1592 and the range from 1612 to 1614 ) 1614::GE:I;6512::EQ:E (include all values greater than orequal to 1614 except 6512 )

1552::LT:I;4000::GT:I

(all values less than 1552 andgreater than 4000 )

Page 8: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 8/24

- 6 -

Note: SAP BI precalculated value set variables are not supported in Visual Composer.

3.2.2 Variable Selection in BEx Analyzer When you execute a query in BEx Analyzer, the input form provided to enter variable valuesmight look something like this (SAP NetWeaver 2004s):

Here's an example of the dialog box that helps you configure selections (in this case, arange for the Calendar Month/Year variable):

Page 9: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 9/24

- 7 -

3.2.3 Adding Value Help

We'll now model similar functionality using value help in Visual Composer. Remember thatadding value help to the input form will not only help to select the right value to pass along tothe form, but will create the syntax for each variable selection type for you. We demonstratetwo different kinds of value help for these purposes.

8. In Visual Composer, on the Layout board, right-click the input field forone of the variables ( SalesOrganization ) and choose AddValue Help from the context menu.

Page 10: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 10/24

- 8 -

9. On the Add Value Help for SelectedInput Field screen, notice thatVisual Composer recommends thetype of value help to use. Forvariables, you must accept the

recommended type, whichcorresponds with the display areaconfigured in the variable itself.

For our example, this is Selectionoptions for the Sales Organization variable, and Interval selection forthe Calendar Year/Month variable.

10. On the Select Data Service screen,browse to and select thecharacteristic that will provide thelist of valid variable values.

11. Use the Get data from drop-downlist in the Properties section tospecify to retrieve all valid valuespresent in the master data table (asopposed to all values in thedimension table).

Page 11: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 11/24

- 9 -

12. On the Specify Data ServiceRuntime Parameters screen, leavethe Input values as they are bydefault.

13. In the Output section, select allformats of the output fields in theOutput Fields table, so in theresultant value help dialog box youwill see, for example, how the Key and Key (External Display) valuesdiffer.

The Key field is the value that isactually passed on to the inputform. The Key and Key (ExternalDisplay) values are usually thesame, but when they differ (such asis usually the case for timecharacteristics), you need to usethe Key (External Display) value asinput for a variable. Accordingly,select Key (External Display) fromthis drop-down list.

14. Click Finish to exit the wizard andgenerate the value help.

15. Repeat from Step 8 to define valuehelp for the Calendar Month/Year field.

.

Once you have completed the wizardscreens, you return the Layout board,where you can see that a Value Help button has been added next to eachinput field where you have configured it.

16. On the Layout board, edit thedisplay of field labels and clean upthe layout of the buttons, form, andtable as desired.

17. Save the model.

Page 12: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 12/24

- 10 -

3.3 Deploy and Interact

18. Go to the Deploy to Portal taskpanel, and click Deploy to deploythe model to the portal in Adobe

Flash format.19. Click Run [iView name] to view the

iView in runtime on the portal.

20. When the iView appears on the portal, you see the input form, value help buttons, and table.The query is waiting for you to select variable values before it executes:

Page 13: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 13/24

- 11 -

21. Click the Value Help button for the Sales Organization field. The dialog box for selectionoptions value help looks like this:

From the Options drop-down list, select the option you wish to configure:

• Equal to

• Greater than or equal to

• Greater than

• Less than or equal to• Less than

• Between

You can specify that values should be excluded with the Exclude value checkbox.

22. Use the Value Help buttons to select values for fields as appropriate, which evokes the valuehelp dialog box:

Page 14: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 14/24

- 12 -

23. Build as many types of selections as you like and transfer them to the selection using the Add button. Notice that the value help formula updates as you build your selection:

Page 15: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 15/24

- 13 -

24. When you are done, click Done to exit the dialog box and transfer the value to the input field onthe form:

Notice that in addition to providing you the proper Key (External Display) values for the inputfield, Visual Composer value help has automatically generated the proper selection syntax foryour field.

25. Select and configure value help for additional variables as desired. If you have mandatoryvariables, you must configure values for these before you submit the query.

In the dialog box for interval selection value help (for the Calendar Month/Year variable), youspecify start and end points of the interval by selecting values and pressing the Add button:

Page 16: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 16/24

- 14 -

26. When you are done, click Done to exit the value help dialog box and transfer the selectedvalues to the input field.

27. Click Submit to execute the query with the variable values you configured and retrieve theresult for display in the table:

3.4 Model Advanced Input Fields

In this step, we demonstrate advanced field modeling to reduce the number of dialog boxesthe user needs to process when executing the query on the portal.

Note that to enter these variable values, the user has to select the value help button on theinput form, and then interact with multiple dialog boxes and controls, then return to the inputform and finally submit the values to be executed in the query.

We can streamline the number of dialog boxes and controls with which the user mustinteract by concatenating fields and configuring different controls.

Page 17: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 17/24

- 15 -

In this example, the Calendar Month/Year variable is an interval variable, which uses thefollowing syntax:

[Value (Start) ]:[Value (End) ]

To prevent users from having to access any dialog boxes to configure the proper values, we

split this variable's input field into two fields ( From and To ), provide the proper field valuesusing drop-down lists, and concatenate these together in a formula for the CalendarMonth/Year variable.

28. On the Layout board, select theCalendar Month/Year field anddelete it by clicking the Remove (-)button in the Field section of theConfigure Element task panel.

29. Select the field's Value Help buttonand click the Remove button todelete it as well.

30. Click the Add (+) button to define anew field.

31. Select the Drop-down List controltype, Text data type, and enterFrom as the field name.

32. Repeat steps 30 and 31 to create asecond field, entering To as thefield name.

Page 18: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 18/24

- 16 -

33. Double-click the From field toaccess the Control Propertiesdialog box.

34. On the Entry List tab, choose theDynamic radio button.

35. In the Find Data Service dialog box,select the appropriate system and

query, and navigate to select theCalendar Year/Month characteristic.

36. Select INPUT from the Input port drop-down list.

37. Select OUTPUT from the Output port drop-down list.

38. Click OK .

Page 19: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 19/24

- 17 -

39. Back on the Entry List tab,configure the following AssignedValues for the Input and Outputports:

• Input Field –Calendar_Year/Month =@Calendar_Year_Month

• Output Field – VALUE =@KEY_EXT

• Output Field – TEXT = @TEXT

40. On the Display tab, in the Appearance section, enter Cal.Month/Year From in the Label field.

41. Select Long label from the Label position drop-down list.

42. Repeat from step 33 to configurethe entry list and display of the To field. For this field, enter Cal.Month/Year To as the field label.

43. Close the Control Properties dialogbox.

Page 20: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 20/24

- 18 -

On the Layout tab, your variables formnow looks something like this:

44. On the Design tab, select theunused Value Help for

Calendar_Month_Year popupsignal, and delete it. This cleans upthe popup signal as well as theiView that represented the valuehelp we're not using anymore.

45. Click to select the submit line thatconnects the Variables Form andthe query data service.

Now we define the formula thatconcatenates the From and To fields forthe Calendar Month/Year variable input.

46. In the Configure Element taskpanel, select Enter formula in the

Assigned Value column next to theCalendar_Month_Year input field.

Page 21: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 21/24

- 19 -

47. In the Assign Value dialog box,enter the following formula:

@From& ':' &@To

This corresponds to the intervalselection syntax required by thisvariable:

[Value (Start) ]:[Value (End) ]

48. Check to make sure the formula isvalid, and click OK to exit the dialogbox.

49. Save the model and deploy it to theportal.

In the application in runtime on the portal, you can still use value help to construct the SalesOrganization variable value, but the Calendar Month/Year variable input has been streamlined:

Page 22: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 22/24

- 20 -

Simply select from the From and To drop-down lists to define the Calendar Month/Year interval:

By concatenating fields and configuring a drop-down list, the same query result is achieved with farfewer clicks and without a dialog box for the interval variable. Your end-users also don't need toknow about the interval syntax, since that syntax is included in the concatenated formula:

Page 23: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 23/24

- 21 -

Tips:

• Disable the Sales Organization field. This makes the field inactive to manual input, requiringend-users to use value help in order to generate the proper syntax, which also prevents

users from entering incorrect syntax and values.

• Set the Calendar Month/Year fields to Required . This way, end-users will be required to fillin both fields, and not just one or the other, which would generate incorrect syntax values.

Page 24: Sap Vc Intro

8/11/2019 Sap Vc Intro

http://slidepdf.com/reader/full/sap-vc-intro 24/24

www.sap.com/netweaver