R E S E A R C H P A P E R BEx Query Designer As a component of Business Explorer, used for multidimensional reporting and analysis performed in SAP BW. Student: Miglena Marinova Teacher: Luell Thompson Term: Summer 2010 University of Texas at Dallas Table of Contents Part 1. BEx Query Designer – brief introduction………………………………………………………… 3 1.1. What BEx Query Designer is and how we can open it…………………………………………….. 3 1.2. Functions of the BEx Query Designer……………………………………………………………………. 4 Part 2. Business Scenario with BEx Query Designer……………………………………………………. 9 2.1. Short description…………………………………………………………………………………………………. 9 2.2. Steps for creating and executing a query (parameters and settings)………………………... 9 2.2.1. Create a query………………………………………………………………………………….. 9 2.2.2. G/L Account Variable…………………………………………………………………….. 11 2.2.3. Business Area variable……………………………………………………………………. 11 2.2.4. Save Query……………………………………………………………………………………… 12 2.2.5. Defining Key Figure………………………………………………………………………… 14 2.2.6. Creating Structure…………………………………………………………………………… 15 2.2.7. Renaming variables………………………………………………………………………….. 16 2.2.8. Absolute Variance and Variance (%) variables…………………………………... 17 2.2.9. Financial Statement Item………………………………………………………………..… 18 2.2.10. Changing Details of Variable and using BEx Analyzer……………………….. 21 2 Part 1. BEx Query Designer – brief introduction. 1.1. What BEx Query Designer is and how we can open it. The BEx Query Designer is a graphical tool for defining both tabular queries and multidimensional queries that access powerful OLAP functions. The BEx Query Designer, while a standalone client program, interacts with the SAP BW server, more specifically the Meta Data Repository. Meta data about a query’s InfoProvider is passed to the Query Designer so the form and function of a query may be defined and ready for ad hoc execution. All characteristics, navigational attributes, and key figures available through an InfoProvider are available for use in query definitions. Because queries are multidimensional objects, they effectively define subcubes called query cubes on top of the InfoProvider. Query cubes define the degree of freedom available for query navigation in the presentation layer. We have various options for calling up the Query Designer: . FromtheBEx Analyzer open dialog box . As a separate program using Start → Programs → Business Explorer → Query Designer . UsingtheWeb Application Designer (see the BEx Web Application Designer unit) . With Crystal Reports (Crystal Reports >=8.5 including CR add -ons for SAP) 3 1.3. Functions of the BEx Query Designer. The following figure gives an overview of the BEx Query Designer functions that you can call from the Query Designer toolbar. The functions are described within the context of query definition. Quit and Use Query : With this function, you leave the Query Designer and use the query you have defined. Exit Query : Choose Exit Query if you want to leave the Query Designer. Your entries are not saved. Display Query on the Web : Using this function, you can display the query in a default view on the Web, once you have saved your query definition. 4 New Query : Choose this function if you want to create a query. The BEx Open dialog box appears and you can select the InfoProvider here that contains the data that you want to evaluate in the query. Open Query : This function takes you directly to the BEx Open dialog box. You can choose from queries in your History, Favorites, Roles, or from the InfoAre as. Save Query : You use this function to save a modified query under its current name. If the query does not yet have a technical name, the system automatically offers the function Save Query As.... Save Query As... : You use this function to save a query under a new technical name. You can save the query in your favorites or in a role. Delete Query : You use this function to delete the query. You can only delete the query if it is not being used in workbooks, Web templates, Crystal Reports, or Reporting Agent settings. Publish : You are able to publish queries that you have edited and saved in the Query Designer so that they are available to other users. Under the small arrow, next to the publish symbol, you can select from the following options: . Publish in roles The save dialog appears and you can select a role in which you want to publish the query. The system saves a link to the current query in the selected role. . Publish to the portal 5 The save dialog appears and you can publish the query to the Ent erprise Portal. Here you can select from several options: for example you can publish the query to your portfolio or you can put in a collaboration room. . BEx Broadcaster The BEx Broadcaster, which is a Web application for precalculating and distributing queries, Web templates and workbooks, appears. You are able to precalculate the query that you edited in the Query Designer or you can generate it as an online link. You can distribute the generated document or the link by e-mail or you can export it to the Enterprise Portal. Furthermore, you can also precalculate and distribute other queries, Web templates or workbooks. Exception : You use this function to define exceptions for a query. Note: Exceptions are deviations from normal key figure values, as defi ned by you, and are highlighted in color in the query view. Using the small arrow next to the exceptions symbol, you can change or create exceptions. For more information, see the Exceptions and Conditions unit. Condition: You use this function to define c onditions for a query. Using the small arrow next to the conditions symbol, you can change or create conditions. Note: For each characteristic, you can give limit conditions to the key figure values in order to determine, for example, all sales revenues ab ove or below a specified threshold value. The chosen characteristics are displayed in the query with restricted key figures. Define Cells : This function is only available for queries with two structures. 6 You can define formulas and selection conditions f or cells explicitly. In this way, you control the values of cells that appear at the intersections of structural components. This function enables you to access individual cells in queries or to assign special values to these. Query Properties : Choose this function if you want to change the description of the query or define the settings for the result position, display options, numeric display, zero display and key date of the query. Check Query : Using this function, you can check a new or saved query for errors before you save it. Query Where-Used List : Using this function, you can find out in which objects (Workbooks, Web templates, Crystal Reports, or Reporting Agent settings) the query is used. Display <-> Change : Using this function, you can swi tch between the display and change modes. Change Query (Global Definition) : You choose this function if you are in the Local Query Definition and want to switch to the Global Definition. Table Display : You can create a query for tabular reporting (each query element in a separate column), as well as for Online Analytical Processing (OLAP) reporting, by activating or deactivating the Table Display mode in the query definition when defining a query. This function is only available for queries with one structure. You can only have queries with two structures in the multi-dimensional display. They are not suitable for OLAP reporting. Technical Name : Using this function, you can show/hide the technical names of the query components. 7 Context Menu : This function enables you to display the current context menu without using the right mouse button (for example, for use with a touch screen). Help : This function takes you to the SAP BW online documentation. The BEx Query Designer section automatically displays the re in the BEx documentation. Using the small arrow next to the help symbol, under the About... entry, you can see the version of the Query Designer, with the support package number and the revision level. 8 Part 2. Business Scenario with BEx Query Designer. 2.1. Short description. The second part of this research topic will try to give an answer to the following questions: 1. How to create a query; 2. How to open and make changes to an existing query; 3. How to see the query result via BEx Analyzer. 4. How to make settings to various query parameters. The query will use the virtual InfoCube General Ledger: Financial Statements (technical name 0FIGL_VC1) , two Free Characteristics, several Columns and Financial Statement Item row (technical name 0GLACCEXT). The result of the query will be to Display Financial Statement (different versions) for company code 1000 (Germany), two years will be contrasted. 2002, as a Base Year and 2003 as a Comparison Year. Absolute Variance and Variance (in %) will be included for better understanding of the differences. 2.2.1. Create a query. How we can create a query? BEx Query Designer makes this task really easy for us. To create a query we need to choose an InfoCube , that our query to use. 9 From the menu we go to Query -> New and search within the InfoAreas of our BW system. For the purpose of this research paper, I found my InfoCube in: Financials Management and Controlling -> Financial Accounting -> General Ledger Accounting -> General Ledger: Financial Statements After opening General Ledger: Financial Statements the following window appears: We now need to build on this query and add the characteristics we would like this query to have. An interesting thing to notice here is that soving the query at this moment is not possible. I will only be able to save the query once I add a characteristic to it. 10 2.2.2. G/L Account Variable. Our first characteristic will be G/L Account. As I do not want this characteristic to appear in columns, but still to be able to filter on it, I need it to be placed in “Free Characteristics”. I found it in InfoProvider “Dimensions” -> Accounts. I noted how, once I placed a dimension in “Free Characteristics” it automatically appeared in “Filter”. 2.2.3. Business Area variable. I need one more to appear in the same place. That will be the Business area. I drag in from “Dimensions” and drop it in “Free Characteristics”, as I did for the first one characteristic. On the very right side, in Properties I noticed that the description of the characteristic can be changed, however the technical name can not. Here is how the query looks after adding these two: 11 2.2.4. Save Query. Now, we are ready to save it. From the menu I choose Query -> Save As -> I will place it in Favorites under the name Financial Statement. Technical name MUST be unique, so I choose BW_Project as such name. 12 Now, I have this query saved. The following message appeared on the screen: , also some more information, regarding the creation date, time and user: 13 2.2.5. Defining Key Figure. The next step is to define our Key Figure. Looking at the Key Figures on the left side of the screen, there are two key figures I can choose from: I drag and drop one of them into my Key Figure field. Immediately, a hierarchy with a node appeared. It is a good time to turn the technical names on, so we can see what we are working with. How to do this? We can do this by choosing from the menu View -> Technical Names -> and then my choice will be “[Key] Text”, but there are few more options, depends how the user would like the names to appear. Now, here how this query looks like (much better with the technical names turned on): 14 2.2.6. Creating Structure. It is time to add some periods. For the purpose of this query, periods are one of the major parameters and since a comparison between periods will be made, it definitely should appear in columns. Here is what will happen, if I try to add “Year” directly to “Columns”: There is an error message stating that we need one more element in our hierarchy, if we want the node “Year” to appear in our query. I click with the other button of the mouse somewhere in “Column” field, but not on any of the objects there and choose “New Structure”. Now, I can connect “Year” to the new Structure that I renamed as “Periods”. 15 We will need one more period, as two reporting time intervals will be compared. I need to remember which variable I choose as “Year”, because no identical variables must exist in “Column” field. This will turn in doubling the calculations (I learned this the hard way – by trying to do so). This time, I choose a variable with another name. The way these two variables look is not good.. There is no way, I, or someone else will recognize which is which. I need to change their names. Here is how to do it: 2.2.7. Renaming variables. Click on the variable and where “Properties” is go to “General” tab (if you are not already there) and in the “Description” write the new name. Here is how my query looks after these changes: 16 2.2.8. Absolute Variance and Variance (%) variables. The next step is to add the Absolute Variance and the Variance (%). These two will serve an amazing job to show in more details the comparison between the two periods. It will calculate numbers, so it has to be a formula. We go to Columns and click with the other button of the mouse on “Periods” and choose “New Formula”. A new parameter appears and I am going to change its name to “Absolute Variance”. I need to set the formula. Here is how we can do this: 17 Then after we choose “OK” the variable is set. Note the indicator that appears next to the name of the variable. We do “Variance (%)” the same way using this time different formula. 2.2.9. Financial Statement Item. There is one more parameter I want to add and that is “Financial Statement Item” in “Rows”. Without this variable, nothing really will matter. The report will mean nothing. I drag and drop the variable from “Dimensions” -> “Accounts” to the “Rows”. 18 Here is the screen shot of the almost ready to run query: It is good if we have the habit to save the query after saving a variable, that way we will have better view if something is not right, where the problem is. You go to “Query” and “Save” and cross your fingers that everything will be “Green!” Here is mine status message: So far, so good. Let’s try to run the query to see what will happen. We need to go to BEx Analyzer and execute the query from there. 19 A dialog window appears asking for fiscal year. If I choose to not enter anything a warning message will appear. What if I am not sure about the year or if there is any other reason for me to not choose this field? White testing the system data I tried many many many cross-options. Years, company codes, Financial statements versions till I got something useful to work with. And how I found it? After making variables “Optional”. We need to change the variable from Mandatory to Optional. ! I am going to put an exclamation mark here! It is certainly not a good thing to change this variables, unless you are not their creator! The system will generate the following message: After completing this course, I have to change back the original settings of variables I modified. 20 2.2.10. Changing Details of Variable. Changing the variable from “Mandatory” to “Optional”. It is quite easy to do so. You go to “Properties”, choose the variable and go to “Details”, click on this icon and change “Variable is” from “Mandatory” to “Optional”. Now, I can try again running the query. An informational message appears. It is ok, it will show just one time: I click ok and then I do not write anything in “Fiscal Year” and the query will still be generated. Here is a little part of it: 21 We can easily notice that there is no point of having such a report without specifying a period. So, now I go back again loading the query and putting some meaningful information in “Year” fields. I choose 2002 for Base and 2003 for Comparison. 22 Here is my new report: We can use the functions of “Filter” to filter by different parameters: I am going to filter by “Business Area” and I would like to choose Drill Down. 23 And here it is: Now, it has a finished look. Many other variables could be added to this one, like filtering not only by year, but by month or adding more information like sales by business area, or choosing between various Financial Statement versions. 24 REFERENCES: 1. http://help.sap.com/saphelp_rc10/helpdata/en/43/4e3a1c430e324ee10000000a422035/conte nt.htm 2. http://www.scribd.com/doc/21373903/Business-Warehouse-Business-Explorer-Details 3. http://myhelp.uky.edu/rwd/HTML/BW/BEX_310_Manual.pdf 4. http://webcache.googleusercontent.com/search?q=cache:1FPQYoLp0JAJ:cscstudentweb.lr.edu/swp/SAP/CSC292/Query%2520Design1/Query%2520Design/BI%2520L3%252 0BEx%2520Query%2520Designer%2520Unit%25202.ppt+%22You+can+restrict+%28filter%29+th e%22+%3Fcharacteristic+values+of+a+%3Fcharacteristic+in+the+Rows&cd=1&hl=en&ct=clnk&gl =us&client=firefox-a 5. http://s3.amazonaws.com/r2d2/group_images/481/SAP-Logo_details.jpg 25