Sie sind auf Seite 1von 58

Queries in SAP R/3

Queries in
SAP R/3
Germn Gonzlez
SAP FI/CO Consultant

2006 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
About this Document

This preface includes the following sections:

Purpose of This Document

How to Use This Document

Related Documentation

Contact Information

3 23 October 2017
Purpose of this Document
This document describes:

User Group in SAP R/3.

InfoSet in SAP R/3.

Query in SAP R/3.

4 23 October 2017
How this document is organized?
This course provide a general description of queries and
what is the importance of use queries in SAP R/3.

Also this course will be describe which are the basic


components of a query.

We will see how to create User Groups, InfoSets and


Queries.

We will see the output format of a query.

5 23 October 2017
Who should read this document
This document is for anyone who wants to exploit
the Queries capabilities in SAP R/3.

Readers should be familiar with SAP R/3 and have


knowledge of SAP Tables and their relation with
transactions and reports in order to be able to
identify the right tables with needed information.

6 23 October 2017
Prerequisite Knowledge
Users of this document are expected to have the
following skill set, in order to understand the
context of this document

SAP R/3 knowledge , including SAP Tables.

Business application knowledge in some specific


application area.

7 23 October 2017
Topics Not Covered in This Document
This document does not cover the following related
topics:

Business analysis of SAP R/3

8 23 October 2017
Version Reference

Product Version

SAP R/3 4.6, 4.7, 6.0

9 23 October 2017
How to Use This Document
This document, Queries in SAP R/3, is designed primarily as a presentation. If you are reading this as
a paper publication, note that to get full use from this document in the sharepoint using your web
browser.

Opening the Document in a Web Browser


To access the online version of this document, open the following HTML file in a Web browser:

http://na2.know.hp.com/teams/STK/Innovation%20(TSG-CF-
SC)/TS%20Efficiency/Forms/Training.aspx?RootFolder=%2fteams%2fSTK%2fInnovation%20%28T
SG%2dCF%2dSC%29%2fTS%20Efficiency%2fTraining%20Queries&View=%7bA0F7D5DA%2d43
E6%2d4A48%2dB5D2%2d0F9908715A8C%7d

Note: The online documentation requires a Web browser that supports HTML version 3.0. Netscape
Navigator version 2.02 or Microsoft Internet Explorer version 3.0 or later are recommended.

Printing from a Web Browser


You can print a copy of this document, one file at a time, from the Web browser. Before you print,
make sure that the chapter or appendix you want is displayed and selected in your browser. (To
select a chapter or appendix, click anywhere inside the chapter or appendix you want to print. If your
browser offers a Print Preview feature, you can use the feature to verify which chapter or appendix
you are about to print.)
The Queries in SAP R/3 Online Documentation also includes Adobe Acrobat PDF files of all of the
online documents. You can use the Adobe Acrobat Reader to print all or a portion of each document.

10 23 October 2017
Related documentation
You can go to this link for information releated to
this course:

http://help.sap.com/saphelp_470/helpdata/EN/d2/cb3efb455611d189710000e83
22d00/frameset.htm

11 23 October 2017
Contact Information

Germn Gonzlez
german.gonzalez@hp.com
SAP FI/CO Consultant
3669-9500 x 8896

12 23 October 2017
Introducing Queries in SAP R/3
Query is a tool which permit to get information
from SAP R/3 tables and display it as a report,
table, or Spreadsheet format.
You can get information from one or more tables
and display all information in specific format; you
can display information as Spreadsheet format,
as a table format, as a report, etc.
You can manipulate every field before display it in
the output, it means that you can sum, rest,
multiply, count, substring, concatenate fields
before it will be displayed, etc.

13 23 October 2017
Queries
What are they?

14 23 October 2017
Queries in SAP R/3
The SAP Query application is used to create reports. It is
designed for users with no specific ABAP programming
language.
SAP Query provide several ways to define reports and
create different types of reports such as basic lists,
statistical, and ranked lists.

15 23 October 2017
Queries Benefits
The advantage of using Queries is that it is easier and
faster than use ABAP Reports.
It is not necessary to have knowledge of ABAP
Programming.
Is easy to change queries (add, delete or calculate fields)
You can join several tables to pull data out from all those
tables.

16 23 October 2017
User Groups
Users groups , as their name indicate, are only User
groups with a common Profile.
Users from specific group, only can have access to
execute queries defined in this particular user group.
Each InfoSet is assigned to one or more user groups. To
access SAP Queries, the User must have access at least
to one User group.
Members in a User Group can access to same information
and the same queries.

17 23 October 2017
User Groups
User groups are a user collection that work with similar
data that end in similar tasks.
Users assigned to one user group only can access to
InfoSet assigned to these user group.
When you create a query, the user group control which
InfoSets can be used.

18 23 October 2017
User Groups
To create a user group you must execute transaction
SQ03, write the name of new user group then click on the
Create button:

19 23 October 2017
20 23 October 2017
User group in SAP R/3
Then write the user group description, then click on Save
button:

21 23 October 2017
User group in SAP R/3
Then write the Package, then click on Save button:

22 23 October 2017
User group in SAP R/3
The Package selected in the example was the one
appears at the end of the next screen:

23 23 October 2017
User group in SAP R/3
Following is an example to assign user to a user group
TEST.
You should write the name of the user group to which you
want to assign a user, then click on Assign users and
InfoSets.
Then you can write the user (s) you want to assign to the
user group and then click on Save button.
Also in the same screen, you can click on Assign InfoSets
button to assign one or more InfoSets to the user group:

24 23 October 2017
25 23 October 2017
26 23 October 2017
27 23 October 2017
InfoSet in SAP R/3
InfoSet are the central part in the Query, we can say that
they are a field groups from one or more SAP tables from
which we can make use in order to create a Query.

We need InfoSet to show a pre-selected data collection for


the user, depending on the task will be developed.

So, we need first to create an InfoSet with defined range


of fields that will make easy and fast to create queries.

28 23 October 2017
InfoSet in SAP R/3
InfoSet define tables and fields that can be required.
InfoSet can use:
Joins
Direct Read
Logical Database

29 23 October 2017
InfoSet in SAP R/3
Table Join:
Select this option if you want to read data using a
table join.
A table join is two or more table links which are read
with special forms of the SELECT statement. The first
table in the join is the table specified above in the field
Basis table. You can specify the other tables by calling
the function continue (when you create a new InfoSet)
or join Although a table join always covers several
tables, the result is a sequence of records with a flat
structure. The structure of these records is a field list
where fields of the tables involved in the join are listed
30
one after the other.
23 October 2017
InfoSet in SAP R/3
Direct Read:
Select this option if you want to read data directly
from the SAP table.

31 23 October 2017
InfoSet in SAP R/3
Logical Database:
Select this option if the data procurement for this
InfoSet should take place with the aid of a logical
database. Enter the name of the logical databse in the
field intended for this. You can also enter a special
selection screen version of the logical databse.

32 23 October 2017
Example of InfoSet creation in SAP R/3
To create an InfoSet you must execute transaction SQ02
and write the new InfoSet name, then click on the Create
button and enter the InfoSet description in the field Name.
Then select the data source you want to use and write the
name of the table that you want to use, and leave the rest
of fields as they are, click on the green arrow:

33 23 October 2017
Example of InfoSet creation in SAP R/3

34 23 October 2017
Example of InfoSet creation in SAP R/3
Select the Field group Defaults:
You can include all table fields and after take them
out the ones you do not need, or you can include
only the key fields from the table, or create empty
field group and choose fields after:

35 23 October 2017
36 23 October 2017
Example of InfoSet creation in SAP R/3
If you select the option Include key fields you will see
the three key fields as they are showed in the screen
up, as you can see, they are in blue color in the left part
of screen and only these three key fields are displayed
on the right part of the screen.
Then you should click on the Check icon to check if
there are not inconsistencies.
And then, you must click on Generate icon, write the
right Package and click on Save icon:

37 23 October 2017
Example of InfoSet creation in SAP R/3

38 23 October 2017
39 23 October 2017
Example of InfoSet creation in SAP R/3
Once the InfoSet is generated, you must click on the
InfoSet and click on the Role/User Group Assignment
button, then select the user group to which you want to
assign the InfoSet, and click on Save Assignment icon:

40 23 October 2017
41 23 October 2017
Query in SAP R/3
Now you can create the Query, you must run
transaction SQ00 and after that, click on the first icon
from left to right, this icon is to change to Other user
group.
Choose the user group TEST, this is the group where
we going to create our queries to practice.
Then write the Name of you query in the Query field
and click on the Create button, choose the InfoSet
already created:

42 23 October 2017
43 23 October 2017
Query in SAP R/3

44 23 October 2017
Query in SAP R/3
Create Query screen appear, write the title you desire
for you new query, you can leave the List format, the
Table format, Special attributes, Print list and Output
format fields like they appears, you will learn and
change this fields on the practice, click on the next
screen icon and select the Field group (s) displayed:

45 23 October 2017
46 23 October 2017
Query in SAP R/3
Click again in the next screen icon, and select the
fields you want to get from the table previously defined
in the InfoSet.
Click next screen icon:

47 23 October 2017
48 23 October 2017
Query in SAP R/3
Select the fields you want for the screen selection
fields and write the sequence number to determine the
order they will appear, then click on Layout display icon:

49 23 October 2017
50 23 October 2017
Query in SAP R/3
Select the fields you want for the screen selection
fields, then click on Basic List icon.
In the layout design, select the Fields you want to
display in the query output, then click on the Check icon
and after that click on the test icon.
A Test query window will be displayed, we will not
use a variant to run our query, so just click on the green
arrow to display the Query screen:

51 23 October 2017
52 23 October 2017
Query in SAP R/3

53 23 October 2017
54 23 October 2017
Query in SAP R/3
If the screen appear with the selection fields filled, you
can execute with this values or you can enter other
values and execute it clicking on the Execute icon or
press F8.

Now, you will see your query output:

55 23 October 2017
56 23 October 2017
Query in SAP R/3
Once you check the output information, you can come
back to the layout design in order to save your query.
For saving, press F3 to come back to the principal
screen query and press again F3 to come back to
layout design, then you must click on Save icon to Save
your first Query.
Now you can try to make modification to your InfoSet
to pull more fields and modify your query to display
them in the output layout, or you can try to create a new
InfoSet with the join option in order to pull out other
fields from two or more tables.

57 23 October 2017
Query in SAP R/3

Good luck:

THANKS!!!

58 23 October 2017

Das könnte Ihnen auch gefallen