0% found this document useful (0 votes)
8 views

Abap Query Tutorial

The document discusses ABAP query and provides steps to create an ABAP query without coding. It defines ABAP query, outlines the types of reports that can be created, and gives a case scenario and step-by-step instructions to generate a purchase order detail report using ABAP query.

Uploaded by

mkumarshahi8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Abap Query Tutorial

The document discusses ABAP query and provides steps to create an ABAP query without coding. It defines ABAP query, outlines the types of reports that can be created, and gives a case scenario and step-by-step instructions to generate a purchase order detail report using ABAP query.

Uploaded by

mkumarshahi8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

ABAP Query

Table of Contents
ADVANCED ABAP CONCEPT – ABAP QUERY 2

1. INTRODUCTION 2

1.1 BASICS OF ABAP 2


1.2 ADVANCED ABAP 2

2. ABAP QUERY 3

2.1 DEFINITION 3
2.2 CREATION OF ABAP QUERY 3
2.3 CASE SCENARIO 3
2.4 STEP BY STEP APPROACH 1
2.4.1 CREATE USER GROUP 1
2.4.2 CREATE INFOSET 2
2.4.3 CREATE ABAP QUERY 5

3. CONCLUSION 6

Page 1
ABAP Query

Advanced ABAP Concept – ABAP Query


This white paper gives a brief introduction on advanced ABAP concepts and detailed steps to create
ABAP Query. Before getting into that in detail, let’s start with basic overview of ABAP.

1. Introduction
1.1 Basics of ABAP
SAP (System Application & Products) is one of the best ERP Applications in the market. The
application has been assembled in such a versatile way that it handles the entire functional
department within an organization. Today major companies including Microsoft and IBM are using
SAP to run their own businesses.

A very high level programming language created by SAP is ABAP (Advanced Business Application
Programming) which is used to develop applications for SAP R/3 system, a widely-installed business
application subsystem. ABAP is thus not only a mature language that has proven itself in the
practical field, but – on the basis of its evolutionary strategy – it continues to be suited to the
requirements of business programming. With the quality of its application programs, it has made
SAP a world leader in the development of business software.

1.2 Advanced ABAP


Following are the advanced topics, among these we are going to deal with ABAP Query,

ABAP Query

ALE, IDOC

BADI

Logical Database

LSMW

ABAP Code Optimization

RFC and BAPI

SAP Workflow

Page 2
ABAP Query

2. ABAP Query
2.1 Definition
ABAP Query is a functional tool used to develop simple report by writing queries instead of writing
ABAP report program i.e. without ABAP coding. All you need is to join the table and drag and drop
field that you wish to occur in the report.

Following are the types of reports developed by ABAP Query Tool,

Basic List: - This is a Simple report.

Statistics: - Report containing statistical functions like Average & Percentage

Ranked List: - Report written for analytical purpose.

2.2 Creation of ABAP Query


There are three steps for creating ABAP Query,

Create User Group (SQ03):- Specify the users who should be authorized to run the query.

Create Infoset (SQ02):- Indicates from which part of the SAP database the data is going to be
retrieved and how the data is to be retrieved by the query.

Create Queries (SQ01):- Create the query and arrange the layout.

2.3 Case Scenario


Let we learn the creation of ABAP Query with a scenario of generating Purchase Order Detail
Report. The report has following details,

Purchase Document Number Order Quantity

Company Code Unit of Measure

Document Category

Document Type

Status

Payment Term

Material Number

Plant

Storage Location

Page 3
ABAP Query

All the above information is stored in the base tables EKKO (Purchasing Document Header)
and EKPO (Purchasing Document Item).

2.4 Step by Step Approach


Step by step approach of creating ABAP query is as follows,

2.4.1 Create User Group


Navigate to SQ03 to create User Group. Give name of the user group and click on “Create”.
The below picture is the snapshot of User Group: Initial Screen where “Z_USER_GRP01” is
the name of the user Group.

Once the user Group is created, users have to be assigned to this group. The users in the
group are only eligible to run the query. The below screen shows “DEV01” and “DEV02” users
are added to this user Group.

Page 1
ABAP Query

2.4.2 Create Infoset


Infoset holds the information about the query i.e. the tables used, fields needed, join
condition etc.

Navigate to SQ02. Give the name and click on “Create”. Provide the Title and the table
information in the fields provided as given in the below screen.

Till now EKKO table is only added in the infoset, now EKPO table has to be added by
clicking on “Insert Table” button in the below screen. Once both the tables are added, the
pictorial representation of the tables are represented as,

Page 2
ABAP Query

Select Fields: - This is achieved by clicking on “Infoset” Button on previous screen. Fields
are selected by simply dragging and dropping from left to right. Here we have selected only 6
fields from EKKO table and 5 fields from EKPO table.

Page 3
ABAP Query

Generate the Infoset by clicking on “Generate” Button. Once the infoset is generated it will
be displayed in the list with its status marked as “Green”.

Page 4
ABAP Query

Assign Infoset to the User Group which we have created.

2.4.3 Create ABAP Query


Navigate to SQ01 and click “InfoSet Query” button for selecting the infoset under which the
query has to be created.

Page 5
ABAP Query

Among the selected fields in the infoset, select the fields for outputting in the report as well
as selection condition can also be given for each and every field before the report is
generated. This is shown in the below screen,

Final report is generated by clicking on “Output” Button in the previous screen. This is the
sample report for Basic list similarly Statistical and Ranking list can be generated by
selecting the option from the dropdown provided in the previous screen.

Page 6
ABAP Query

3. Conclusion
This document gives brief introduction on ABAP concepts and stepwise approach to create
ABAP Query. It is basically a tool to test SQL query. It clearly depicts that, report program is
not needed to test the single SQL Query.

Page 7

You might also like