This action might not be possible to undo. Are you sure you want to continue?
Creating Standard SAP Reports Without ABAP Knowledge
By Matthias Liebich, MLI Solutions, LLC Editor's Note: Reporting is one of the most important issues on mature SAP® implementations. In recent editions of SAPtips, we've covered reporting techniques from a variety of angles. In this white paper, Pricing expert Matthias Liebich touches on another method we haven't covered yet: using QuickViewer and SAP Query to generate SAP reports. The most important aspect of these techniques? They can be utilized without ABAP programming. In this extensive white paper, Matthias presents a screen-by-screen look at the techniques needed to use both of these tools. He begins by explaining how these tools evolved, and contrasting the appeal of QuickViewer for beginning users to the depth of SAP Query for more advanced users. Then he describes how to develop a QuickViewer report in SD, how to create a User Group, how to develop an SAP Query, and how to create the InfoSets on which SAP Queries are based. By the time this white paper is finished, SAPtips readers will have a detailed understanding of how these tools can be used for custom reporting—without digging into an ABAP programming manual.
Most of our readers have likely never worked on a SAP R/2 system. R/2 was (and at some companies still is) the mainframe version of SAP before client-server and R/3 took off in the early '90s. In those days, a mouse was mostly known as an animal, and PF keys guided users from one screen to another. No IMG existed; a support person needed to know all configuration tables by name and/or number. Also, if a user needed a quick and dirty report to list customer or sales document data, a request for development needed to be filled out to have a custom report coded in order to supply that information. Not exactly real-time. Then came R/3 and things got a little more user friendly with the GUI interface. Now, you were able to use the data browser (transaction SE16) to give you the information of one SAP table at a time. If you wanted to see, for example, the order header and order item data in one report, you needed to download each table (VBAK and VBAP) individually and then link them in MS Access. Starting with SAP R/3 Release 4.6A, SAP began providing useful tools such as the QuickViewer and SAP Query, both of which enable you to create your own basic reports to get your desired information without the help of a developer. In his editor's letter in the April/May edition of SAPtips, Jon Reed mentioned that more and more customers are looking for ways to utilize standard tools to avoid custom development. The tools described in this article are another step in that direction. Jim O’Day wrote an excellent article in that same edition about the VA05 transaction and how to customize information in this standard report. The following paper should provide you with an additional tool to provide the business information you need quickly.
QuickViewer vs. SAP Query
In principle, both of these tools work similarly and provide similar outputs. There are three main steps necessary to set up and execute these tools: • • • Define the data basis Structure lists and selection screens Execute lists
Copyright © 2004 by Klee Associates, Inc. www.SAPtips.com
QuickViewer and SAP Query:
Creating Standard SAP Reports Without ABAP Knowledge
QuickViewer is a simplified version of SAP Query and is intended for beginning users. As the name says, it is an ad-hoc tool for one-time use to quickly generate reports without having to program in ABAP. If a specific set of data needs to be analyzed and referenced on a regular basis, it is recommended to use SAP Query, since it is based on InfoSets, which store the data basis to be re-used for different queries (a more detailed explanation of InfoSets follows later in this paper). A main difference between the QuickViewer and the SAP Query is that QuickViewer reports are user-dependent, which means only the person who creates them can use them. SAP Queries, on the other hand, are assigned to one or more user groups. The other major distinction of the tools is that QuickViewer reports can’t be transported. However, you can define the QuickViewer in every SAP instance separately. QuickViewer allows you to create basic lists, whereas SAP Query does that but also has capabilities to create statistics and ranked lists. For the scenario in this paper, our goal is to quickly gather sales order information; in particular, we would like to know if an order item was created with reference to another sales document or if it was transmitted via EDI. Since we will do a great job in creating the QuickViewer, other users in our company would like to use this same report. We will then convert the QuickViewer into an SAP Query and make it available to multiple users via user groups.
Copyright © 2004 by Klee Associates, Inc. www.SAPtips.com
com Page 3 . In our example. www.” or transaction SQVI. or display your QuickViewer definition as well as execute the QuickViewer report.” menu path “System-Services-QuickViewer. Copyright © 2004 by Klee Associates. Inc. Enter that name and click on the “Create” button. From this screen (see Figure 1). all QuickViewer reports that you created will show under your user name. Figure 1: QuickViewer Maintenance Screen Since the QuickViewer definitions are not transportable. you can give the QuickViewer report any name you want. we will call it “SAPTIPS_DEMO1”. you can create. As mentioned above.SAPtips. change.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge Creating a QuickViewer Report You can reach the QuickViewer screen either via menu path “Tools-ABAP Workbench-UtilitiesQuickViewer.
which can be used as a data source for a QuickViewer.com Page 4 .SAPtips. Comments to explain the purpose of the report are optional and will not print on the final product. In the section “Data Source. Logical database: SAP provides a hierarchical structure of tables in the form of logical databases (for example. Be aware that you can use transparent tables in the join (such as VBAK. www. Figure 2: Creating a QuickView with a Table Join as Data Source Copyright © 2004 by Klee Associates. VBAP). similar to transaction SE16 (SAP Data Browser).QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge For your report title. We will leave the default setting of “Basis mode” and click the check mark. you should put in a meaningful name since this is also the title that will show on your final report. Since we don’t need all the tables of the logical database for sales documents in our example. Inc. “VAV” for sales document data). QuickViewer provides a basis mode or a layout mode to define the QuickViewer report. Table join: With the table join. There are four options (see Figure 2): Table: This is the simplest form and provides you with all fields of a table (for example. you are able to link multiple SAP tables together. which can then repeatedly be used as a data source for the Quick Viewer. we will create our own table join and select “Table join” as our data source. but not pool or cluster tables (such as KONV). KNA1 for customer master data).” you need to define where the information you want to process is coming from. SAP Query InfoSet: You can save your own definition of tables and their respective fields in InfoSets (more on that later).
For our example. www.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge Since we selected “Table join” as our data source. select the table name for each table that should be included in the table join. Inc.com Page 5 . The screen looks similar to the design screen in MS button. we are presented with a blank screen on which we have to define the join conditions. VBKD (Sales document business data) and KNA1 (General customer data) (see Figure 3). VBAP (Sales document item data). To insert tables. You will be asked to enter the DDIC Access. Figure 3: Creating a Data Join Copyright © 2004 by Klee Associates.SAPtips. we will need the following tables: VBAK (Sales document header data).
This completes the phase of “Defining the data basis.SAPtips. If you would like to remove any of these joins. click the green “back” arrow. Once you are done establishing your joins. If you would like to add a join. www. the system proposes join conditions. select a field in one table by clicking the left mouse button and drag the field to a field in another table. Inc.” Figure 4: Managing Join Conditions Copyright © 2004 by Klee Associates.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge After a table is inserted.com Page 6 . right click on the join option and select “Remove join condition” (see Figure 4).
• • • Figure 5: Basis Mode View of QuickViewer Copyright © 2004 by Klee Associates. . you don’t need this help anymore and you can minimize that screen by dragging the borders of the window. . Inc. www.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge The following screen (Figure 5) is the “Basis mode” of the QuickViewer that is divided into four areas: • The upper-left window shows you the tables that were previously selected in the table join and from which you can select the fields that should be displayed in the report. The lower-right window offers links to the help menu of the QuickViewer. Once you created a few QuickViewers. and “Selection”. The lower-left window displays an online help on how to use the functions in the current screen. Here you also define the sort and selection criteria of the report.SAPtips. The upper-right window indicates in which order the fields were selected for the tabs .com Page 7 . and “List”. You can change the settings with the buttons. “Sort”. The last tab “Data source” lets you go back to make changes to your data join.
To define a field as selection criteria. The fields will appear in the list field and selection list in the order they were selected. To change the order of the fields. indicate this in the third column. The first column shows the field description. we are going to select the following fields: Sales organization (VBAK-VKORG) Distribution Channel (VBAK-VTWEG) Division (VBAK-SPART) Sales document (VBAK-VBELN) Create date (VBAK-ERDAT) Sales document type (VBAK-AUART) Sold-to party (VBAK-KUNNR) Sold-to name (KNA1-NAME1) Item number (VBAP-POSNR) Material number (VBAP-MATNR) Rejection reason (VBAP-ABGRU) Reference document number (VBAP-VGBEL) Purchase order number (VBKD-BSTKD) Purchase order type (VBKD-BSARK) As selection fields. not in the order they appear in the DDIC tables (see Figure 6). the fourth column shows the respective technical name.com Page 8 . www.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge Selecting the in front of a table in the upper-left window reveals the fields within that table. Inc. select them in the second column. select a field and use the buttons to move them up and down the respective lists.SAPtips. For our example. we choose: Sales organization (VBAK-VKORG) Distribution Channel (VBAK-VTWEG) Division (VBAK-SPART) Sales document (VBAK-VBELN) Create date (VBAK-ERDAT) Sales document type (VBAK-AUART) Sold-to party (VBAK-KUNNR) Purchase order type (VBKD-BSARK) Material number (VBAP-MATNR) Rejection reason (VBAP-ABGRU) Reference document number (VBAP-VGBEL) and Copyright © 2004 by Klee Associates. To select fields that should be displayed in the final report.
SAPtips. Figure 6: Selecting Fields for Display and Selections Copyright © 2004 by Klee Associates. This is just a default setting and can be changed in the “Output format” section on the selection screen when you execute the report (see Figure 9). Inc. but you can also select a different format such as a regular ABAP list or an Excel spreadsheet. “ABAP List Viewer”).com Page 9 . www. The default and standard output medium is the SAP List Viewer (which is called “ALV”— the “A” stands for the previous name. you can also define the proposed output format under the “Export as” label.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge In addition.
Inc. as well as a sample line of data (see Figure 7). activate the trash can box and drag and drop fields to this box. The layout mode shows you the information based on the WYSIWYG principle. Then. To use their functions. The only window that changes is the one in the upper right. Several toolboxes are displayed as well. The header field descriptions are displayed. Figure 7: Layout Mode of QuickViewer Copyright © 2004 by Klee Associates.SAPtips. To delete a field. drag and drop a field from the list to the box (for example. switch from the “Basis mode” to the “Layout mode” by selecting the button.com Page 10 . www. “Created on”). select in one of them (for example “Sort fields”) which will activate the box by putting a frame around it.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge To see how the report layout is going to look.
For example. save the QuickViewer by clicking the button.com Page 11 .QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge In “Layout mode.SAPtips. Figure 8: Changing Field Length and Header Descriptions in Layout Mode Copyright © 2004 by Klee Associates. To execute the report from this screen. After defining our data basis.” you can also change the display lengths of the fields and their labels in the report. www. Inc. To change the length of the field. simply select the field in the data line and drag the right side of the box as far as you would like the field to go (see Figure 8). you can always do so from the main QuickViewer screen (see Figure 1). If you would like to run it at a later time. we have now completed the structuring of our list and the creation of the selection screens. the field for the sales document was labeled “Sales doc” (see Figure 7). Once you are done with your adjustments. Positioning the cursor on that label will highlight the label and you will be able to change its description (in our example to “Order number”). click the button. This will generate an ABAP program based on the fields selected. You could also accomplish this by changing the output length of the selected field in the lower-left window.
This setting (remember?) comes from the QuickViewer definition “Export as” that was done in Figure 6. execute the report (see Figure 9). Inc. The order of the selection fields is according to the order defined in the “Selection fields” tab (see Figure 5). the ALV). You can always narrow down your selections. Once you have made all your selections.com Page 12 .SAPtips. which will also improve the runtime of the report. EDI orders are identified by purchase order type DFUE (Datenfernübertragung in German—as in my last article. You can change the default here. we would like to see all orders that were transmitted for a specific sales area in April via EDI. SAP’s standard output format is the SAP List Viewer (or.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge The selection screen for the QuickViewer report is displayed based on the selection criteria we defined in the setup phase. For our example. Figure 9: Selection Screen of QuickViewer Report Copyright © 2004 by Klee Associates. www. as noted. you get a free German crash course included).
If we would like to restrict it to order line items with reference only. button. Jim O’Day explained in detail the functions of the ALV in his “VA05” article in the April/May edition of SAPtips. In the report below. etc. You can accomplish this by clicking on the open an Excel spreadsheet from which further processing can commence. select “Options” and “Not equal to”) space in Figure 9. This will At the beginning of our example.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge Figure 10 displays the QuickViewer report in the SAP List Viewer (ALV). Inc. we would have to add the selection for field “Document number of the refer” as NE (right click on the selection field. you can see the referenced line items as the lines that have an order number in column “Ref. so we don’t need to go into detail on how to sort. There is just one more thing I would like to mention about the ALV.com Page 13 .SAPtips. A frequent function that I’ve seen at customer sites is the export option of the report to MS Excel.” Our first selection showed all EDI orders. Executing the list also concludes the final step on how to set up and run a QuickViewer. doc. we defined that we would like to see EDI orders that were referenced to other documents. www. change columns. Figure 10: QuickViewer Report of EDI Orders Copyright © 2004 by Klee Associates.
instead of having to create the same query from scratch. Copyright © 2004 by Klee Associates.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge Creating User Groups As mentioned before. you can always come back later to add or remove users. execute transaction SQ03 or use menu path “Tools-ABAP Workbench>Utilities->SAP Query->User groups”. So what do you do if you decide that this QuickViewer is so useful that you want to make it available to other users as well? Fortunately. we can convert the QuickViewer report to a SAP Query. and then select “Assign users and InfoSets”. we will need to create a user group and assign users to it.com Page 14 . access to the QuickViewer is limited to the user who creates it. www. Inc. But before we convert our QuickViewer report. Figure 11: Create User Groups Assign all users you want to add to the newly-created user group according to their SAP logon IDs (see Figure 11). If you already have user groups set up. To set up user groups.SAPtips. this step is not necessary. You will be asked for a description of a user group (see Figure 11). Confirm that entry. SAP Queries can be shared by multiple users via user groups and. Freely define a user group name (for our example SAPTIPSUSERS) and click on “Create”. since QuickViewer has a converting feature. Once you have made the initial assignments.
If you need to change your user group. Inc. Standard queries are client-specific and not transportable. To change your query area. we want to make sure that we are using the correct user group.SAPtips. www. A list of all available user groups is displayed Copyright © 2004 by Klee Associates. select “Edit-Other user group” or click on the for selection. To verify which user group you’re currently logged in under. since converting a QuickViewer into an SAP Query is not possible in the global area. You can also branch to the SAP Query from the QuickViewer screen by clicking the “SAP Query” button (see Figure 1). Note: There are separate sets of user groups and InfoSets for each of the query areas. enter transaction SQ01 or use menu path “Tools->ABAP Workbench>Utilities->SAP Query->Queries”. This means a user group that is set up in the standard area is not available in the global area and vice versa. button. There are two kinds of queries: standard and global.com Page 15 . can be transported from system to system. Queries can be assigned to multiple user groups. For our example. For example. Only global queries. which are available cross-client. we need to make sure that we are in the standard area. check the user group that is listed after “Queries of user group” (in our example it is SAPTIPSUSERS). a customer master query might be of interest to the customer service and the credit department.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge Figure 12: Assigning Users to User Groups Creating an SAP Query To create an SAP Query. Before we convert our QuickViewer. select “Environment-Query Areas” from the main SAP Query screen.
In our case.SAPtips. Now specify a query name (it can be the same as the QuickView name) and InfoSet (see Figure 13). and then click . Inc. You need to specify the previously created QuickViewer report. table join. or LDB). www. Z_ZORDERINFO) and the InfoSet will be generated automatically based on the data source of the query (table. Figure 13: Converting a QuickViewer Report into an SAP Query Copyright © 2004 by Klee Associates. Enter a freely-definable InfoSet name (in our example. it would be the table join of our previous QuickViewer.com Page 16 . select “Query-Convert QuickView”.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge Once you have selected the correct user group.
Inc. The resulting report will also look identical. just one) queries with the supporting InfoSet name.SAPtips. When you execute this query. www. the same selection screen as in our QuickViewer (see Figure 9) will display.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge As a result.com Page 17 . Figure 14: Main SAP Query Screen Copyright © 2004 by Klee Associates. The main SAP Query screen shows all (in our case. the converted QuickViewer report displays now as an SAP Query.
If the user has the proper authorization. we were asked for an InfoSet. was created automatically for us when we converted the QuickViewer) in order to show you the components of the InfoSet. We will again create a data join. In comparison to the QuickViewer. To create an InfoSet. we will create a second InfoSet (the first one.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge InfoSets When we converted the QuickViewer to the SAP Query. enter transaction SQ02 or use menu path “Tools->ABAP Workbench>Utilities->SAP Query->InfoSets”. For our purposes. Z_ZORDERINFO. A second user can use the same InfoSet to create a different query that would. Enter “Z_ZORDERINFO2” as the InfoSet name and click on “Create”. This InfoSet can then be assigned to multiple user groups. The “join definition” screen appears (the same way as in Figure 3 and 4). For example. www. Inc. as the basis table in the “Data Source” section (see Figure 15).com Page 18 . The InfoSet determines the database tables or the fields of those tables that a query can access.SAPtips. InfoSets are sources of data that can be re-used for multiple queries. Figure 15: InfoSet Maintenance Screen Copyright © 2004 by Klee Associates. where we link table VBAK with VBAP and then click the green back-arrow. for example. InfoSets are the basis for every query. you can attach additional tables for field descriptions or store custom ABAP code in InfoSets. he can use this InfoSet as the data source for a specific query (for example. VBAK. show all rejected line items on export orders. so we enter the first table of this join. you can create an InfoSet table join with order header and item data VBAK and VBAP. all orders with a billing block).
For our example. Figure 16: Field Group Options Copyright © 2004 by Klee Associates. or if you only want to remove a few of those fields. There are three options to choose from: • • • Include all table fields: All fields of the joined tables will be copied. The field groups will then be manually created. If you only want to make a few fields of each table available. Create empty field groups: No fields of the joined tables will be copied. If you want all order header and item fields to be available. Include key fields: Only the keys of the database tables in the join will be copied. select “Include all data fields” (see Figure 16). customer data.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge The system then asks what field groups should be created. Inc. Field groups are logical units of fields (for example. The decision on which option to choose depends on what data you want to make available for the users to create their queries with.com Page 19 .SAPtips. order data). choose the second option and manually add the additional fields later. choose the first option. www.
com Page 20 . Once all settings are complete. you need to re-generate the InfoSet in order for the changes to be available in the queries. Note: Only the fields that are defined in the field groups will be available later for a query. www. If you make changes to the InfoSet after that. if you chose the “Include key fields only” option before. If you want to remove a field from a field group. save the InfoSet and generate it by clicking the button. Figure 17: Defining Field Groups Copyright © 2004 by Klee Associates. The system assigned one field group per database table. from the database tables on the left.SAPtips. Finally. Inc. You can then drag and drop fields between field groups or. we need to assign the newly created InfoSet to one or more user groups. Additional options such as ABAP coding and enhancements can be accessed through the buttons. You accomplish this from the main InfoSet screen by clicking the “User group assignment” button (see Figure 15) and selecting the appropriate user groups. Selecting a field will show the respective detailed information in the lower-right window of the screen (see Figure 17). select it and click the button.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge The following screen shows the joined tables on the left side with the field groups listed in the upper-right window. You can create your own field groups by clicking the button.
They are also both available in CRM. Copyright © 2004 by Klee Associates. If you don’t want to give your users access to the query function. If you exclusively work in the Global Query Area. They are both set in your user profile that can be accessed through System->User Profile->Own Data (select “Parameters” tab): If you want to default to a specific user group every time you access the SAP Query. we will have two InfoSets to choose from (see Figure 18). both tools can be used for any application in the SAP system. I found two user settings that I was always looking for myself. but could never find. enter key “AQB” and list your user group as the field value. One final tip: During my research for this paper. since the Standard Area is the system default. enter key “AQW” and field value G. If you mainly work in the Standard Query Area.com Page 21 . Inc. Figure 18: InfoSets as Data Basis for SAP Queries Closing Comments Although I showed the QuickViewer and the SAP Query based on an SD example. creating your own reports is easy and does not require any coding knowledge. don’t make this entry. you can always attach the generated ABAP program to the standard report tree.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge If we create an SAP Query now within user group SAPTIPSUSERS. All that is left is to wish you fun creating your first QuickViewer or SAP Query. As you can see. but want them to be able to execute a query report. www.SAPtips.
Liebich@SAPtips. SAP AG and mySAP are registered trademarks of SAP AG. LLC. Beyond the core SD functionality. Any use of this documentation is at the risk of the user. acquired during numerous full life cycle implementations in the US and Germany. Inc. and Klee Associates. Inc. He is SD certified and has extensive hands-on experience in new implementations. reserves the right to make changes without prior notice. He can be reached at Matthias. and is owned by Klee Associates. Inc. The information in our publications and on our Website is the copyrighted work of Klee Associates. Inc. he is also proficient in ABAP. All other company and product names used herein may be trademarks or registered trademarks of their respective owners. Inc. Klee Associates. mergers. Matthias has over 12 years of SAP SD consulting experience.SAPtips. Although we make every good faith effort to ensure accuracy. Inc. Copyright © 2004 by Klee Associates. and this publication are not affiliated with or endorsed by SAP AG. this document may include technical or other inaccuracies or typographical errors.QuickViewer and SAP Query: Creating Standard SAP Reports Without ABAP Knowledge Matthias Liebich. SAP AG software referenced on this site is furnished under license agreements between SAP AG and its customers and can be used only within the terms of such agreements.com. In addition to his cross-module functional knowledge. enabling him to play a leading role as link between functional and technical teams. Matthias is an expert in the areas of Pricing. makes no warranty as to its accuracy or use. and Rebates.com Page 22 . NO AFFILIATION: Klee Associates. MLI Solutions. upgrades. www. divestitures and bolt-on integration. NO WARRANTY: This documentation is delivered as is. Contracts.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.