You are on page 1of 10

Chapter 7: ABAP Query 7

In this chapter you will learn:


Chapter 8: Contents  The basics of ABAP Query
 The main components of
ABAP Query
Overview................................................................................................................. 7–2
 Answers to some of the
How Is ABAP Query Organized?..........................................................................7–3 most frequently asked
How Does ABAP Query Differ from Other Reporting Tools?.............................7–4 questions about ABAP
Query
How to Access ABAP Query Components?........................................................7–4
Output and Format of ABAP Query......................................................................7–5
Frequently Asked Questions................................................................................7–6
Where to Learn More.............................................................................................7–9

Fundamentals of Reporting 1
Chapter 7: ABAP Query
Where to Learn More

Overview

ABAP Query is an easy-to-use


reporting tool that lets you query data
ABAP
from one or more database table and Q u e ry
funnel it into a list or a table. With this
tool you can extract data from
virtually any module or database table

Rep ort Wri


Ana exible

Rep
in the R/3 System. ABAP Query

ort
lyse
enables you to create reports by

Fl

Pain er
LIS
moving through menus. R /3 R e p o r t

ter
t
D e v e lo p m e n t
One of the strengths of ABAP Query is T o o ls
that it can be used to access just about
any data in the database. This makes it
very desirable for users in many areas LI
of a business. Several R/3 application S n
An Stan ow
areas provide predefined logical aly da illd ting
se r d
s Dr por
databases for easier information Re
retrieval.
Users do not need a background in
ABAP to use the tool. However,
knowledge of the data dictionary and basic programming is extremely helpful.
There are three main components to ABAP Query:
 Functional areas define the tables and the fields within those tables that can be
queried. A functional area uses a logical database, a direct read from a table or a series of
table joins, to determine the tables available.
 User groups control what functional areas and queries a user can access.
 Queries are three different types of reports: Basic, statistical, and ranked lists.
 A basic list is a listing of selected fields, sorted and totaled as specified by the
user in the query. All reports require a basic list.
 A statistical list totals, calculates averages, and apportions percentages based
on the fields in the query.
 A ranked list ranks fields based on a currency or quantity field. A single query
may have multiple statistical and ranked lists but only one basic list.

2 Reporting Made Easy


Chapter 7: ABAP Query
Where to Learn More

How Is ABAP Query Organized?

As shown in the graphic, ABAP Query has three main components:


 Functional areas
 Queries
 User groups
Functional Areas
You need functional areas to offer a ABAP Query
preselected set of data to the user,
depending on the task to be Functional User
Functional Queries User
accomplished. A functional area Areas Queries Groups
Areas Groups
defines the tables—and the fields
within those tables—which can be
queried. Functional areas use a logical
database, a direct read from a table, or
a series of table joins to determine the
available tables.
Statistical
Statistical Basic
Basic Ranked
Ranked
List
List List
List List
List

User Groups
User groups link users to functional areas and queries and control the functional areas and
queries a user can access. Each functional area is assigned to one or more user groups. For
access to ABAP Query, a user must be a member of at least one user group. All members of
a user group can access the same data as well as the same programs (queries) to create lists.
Queries
When you create different lists using ABAP Query, you can save the layout for each list. The
element created is called a query. A query is specific to a user group and functional area.
When creating a query, you may only select one functional area. Within a query, you must
also specify functional groups in the selected functional area. This means the selected area
(and the groups) must contain all the fields you wish to include in the query.
Queries have three different types of reports or lists:
 Basic list: Sorts and totals selected fields as specified by the user in the query. This is
the most common kind of report.
 Statistical list: Totals, calculates averages, and allocates percentages based on the
fields in the query.
 Ranked list: Ranks fields based on numeric fields, including currency or quantity.
A single query may have multiple statistical and ranked lists but only one basic list.

Fundamentals of Reporting 3
Chapter 7: ABAP Query
Where to Learn More

How Does ABAP Query Differ from Other Reporting Tools?

There are several differences between ABAP Query and other reporting tools:
 ABAP Query can access data from most tables within the R/3 System. Most other
reporting tools are limited to which tables they can access.
 ABAP Query is ideal for listing data from any application in the system. It can
calculate additional fields such as purchase price variance (PPV) in procurement or
“aging buckets” in accounts receivable (A/R), and total and sort on any field. These
fields are calculated on each line of a detail report and then totaled by the specified
fields (for example, material or customer).
 ABAP Query reports are typically simple listing and totaling reports, unlike a
balance sheet or an income statement which requires complex groupings (for example, a
cash or revenue line made up of several accounts on a financial statement). Such
complex groupings would require the query to read tables multiple times to
appropriately total and sort the accounts. Other tools (such as Report Painter/ Report
Writer which uses sets for these groupings) may be better suited for reports with
complex groupings.

How to Access ABAP Query Components?

To access the components of ABAP Query, use the menu paths shown in the following table:

ABAP Query Component Menu Path (Use one of the following):

Maintain Queries  System  Services  ABAP Query


 Tools  ABAP Workbench  Utilities  ABAP
Query  Queries
Maintain Functional Areas  Tools  ABAP Workbench  Utilities  ABAP
Query  Functional Areas
Maintain User Groups  Tools  ABAP Workbench  Utilities  ABAP
Query  User Groups

4 Reporting Made Easy


Chapter 7: ABAP Query
Where to Learn More

Output and Format of ABAP Query

The output of ABAP Query can be:


 Displayed on the screen in a table format
 Displayed on the screen using SAP graphics
 Downloaded to a spreadsheet (for example, Microsoft Excel) or a flat file
 Saved as an extract that can be viewed later

Note: A query does lose some of its capabilities in an extract (for example, the report
assignment used for the drilldown function is not available from an extract).

The basic list shown below is a simple listing of transactions for General Ledger (G/L)
accounts. In this example, account 470000 had 15 transactions posted to it for the selection
criteria specified when executing the query.
 The fields for output, selection criteria, sort options, and headers are defined within
the query.
 You may expand or collapse the detail with the Basic list button.
 Report call (sometimes referred to as the drilldown function) is also available from
the query. The report call is query-specific and can call a variety of reports or
transactions. The report call executes reports in the background (when a user double-
clicks on a field) based on header parameters (such as the company code and plant).
 You may save the query to a file to be brought up and viewed later. However, you
lose the expand/collapse and report capability in a saved list.

Fundamentals of Reporting 5
Chapter 7: ABAP Query
Where to Learn More

Frequently Asked Questions

To help you better understand this tool, in this section we include some of the most frequently asked
questions.

Desktop Integration

Q: What sort of integration with spreadsheet applications (for example, Microsoft Excel or Lotus
123) does this tool provide?
A: Data can be downloaded to files in several output formats. For more information, see the R/3
online help.
Q: What integration is supported for Extended Export of Lists (XXL)?

A: ABAP Query is integrated for use with XXL.

Q: Is an external system or special interface required to use this report development tool?

A: No.

Speed and Performance

Q: Does this reporting tool create reports that offer real-time processing of data?

A: The data extraction technique is pull (data is retrieved as it is called), since ABAP Query reads
data from the tables used within the applications. There is no meta data layer with ABAP Query.
Q: How does the speed of report execution change as the data load increases? That is, do reports
created with this tool get very slow as system data increases?
A: Some customers report slower performance as the data load increases.

Q: Are there any methods (for example, OSS notes, configuration, or others) which users can
employ to optimize or enhance report execution speed?
A: Performance depends on data selection and other technical conditions. Optimal performance is
achieved by using the logical databases. Archiving unused data decreases the amount of data
from which to report.

6 Reporting Made Easy


Chapter 7: ABAP Query
Where to Learn More

Integration with Standard R/3 System

Q: How is R/3 data integrated for use by this tool?

A: ABAP Query supports data integration with all application areas of R/3. No meta data is
needed, but ABAP Query can also read from meta data written from other applications and
reporting tools. This is one of ABAP Query’s main features (that all R/3 data can be interpreted
with this tool). Many other reporting tools (especially those offered by third party companies)
do not offer this flexibility.
Q: What is the availability of reports created with this tool as delivered with standard R/3?

A: There are approximately 100 query objects in Asset management (AM) and Human Resources
(HR). There are also many logical databases in several application areas.

Knowledge Level Required for Report Development

Q: Is it difficult to learn how to develop reports with this tool?

A: Basic report development can be learned in less than a day, but extensive development skills
will take longer. With the new interface available in Release 4.5A, developing reports with
ABAP Query will be even easier.
Q: Is there an adequate number of characteristics (key figures) and drilldown levels available for
programming with this tool?
A: There are no restrictions on the number of characteristics with ABAP Query reports. There is a
limit of nine drilldown levels within a query. However, both flat (single table) and hierarchical
data can be interpreted with ABAP Query, and all tables in the R/3 System are accessible.
Q: If meta data is used by the reports developed with this tool, is it difficult to integrate or
program new data structures for use with this tool? (Note: Meta data refers to information
about the data)
A: No meta data needs to be created for ABAP Query. However, all meta data created within R/3 is
accessible.
Q: How flexible is this tool for modifying reports (developed with this tool)?

A: Some customers report having trouble in modifying reports developed with ABAP Query.

Fundamentals of Reporting 7
Chapter 7: ABAP Query
Where to Learn More

User Friendliness

Does the Tool Offer…

Drag and drop capability? YES (when using table control)


Sorting? YES
Summations? YES
Selection screen variants? YES
Saved results (cached query)? YES
Adhoc queries? YES
Column or row sizing? YES (when using table control or ABAP List Viewer)

Q: Is there a common look and feel among reports developed with this tool?

A: Yes.

Q: Is there an easy learning curve for users to use this tool?

A: The learning curve for new users is moderate.

Execution Management

Q: Is authorization control programmable with this tool?

A: Yes, ABAP Query takes advantage of the standard R/3 authorization concept—especially when
used with a logical database. It also provides special user groups.
Q: Does this tool provide alert and monitoring capability (for example, to let users know when
output is out of a certain range)?
A: No.

Q: Does this tool offer batch job processing and background report execution?

A: Yes.

8 Reporting Made Easy


Chapter 7: ABAP Query
Where to Learn More

Where to Learn More


 Chapter 2, ABAP Query in book 2, Report Developments Tools of the Reporting Made
Easy guidebook series.
 R/3 Library (Online help): In Release 4.0B, you will find more information on ABAP
Query. Go to R/3 Library  BC  Basis Components  ABAP Workbench  BC ABAP
Query | BC ABAP Reporting Tutorial.
 ABAP/4 Query, a comprehensive book from the ABAP/4 Development Workbench
documentation published by SAP AG. To order printed copies use product number
50014371.
 BC405: ABAP/4 Development Workbench—Reporting, a five-day training course offered
by SAP Education and Training.

Fundamentals of Reporting 9
Chapter 7: ABAP Query
Where to Learn More

10 Reporting Made Easy

You might also like