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

SAP Query - Creation & Execution - Table Join & Logical Database - SAP Blogs

SAP Query

Uploaded by

Pallavi
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)
368 views

SAP Query - Creation & Execution - Table Join & Logical Database - SAP Blogs

SAP Query

Uploaded by

Pallavi
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/ 13

10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

Follow RSS feed Like


Community

Ask a Question Write a Blog Post

Former Member
May 9, 2014 5 minute read

SAP Query – Creation & Execution – Table Join & Logical


Database
18 Likes 134,276 Views 11 Comments

SAP Query – Overview:

SAP Query is used to create reports for users who have little knowledge about SAP Table data storage
structure. SAP Query allows evaluating data in the SAP system.

SAP Query offers users a broad range of ways to define reporting programs and create different types of
reports such as basic lists, statistics, and ranked lists.

SAP Query – Features:

Following are the major components which are associated with SAP Query:

Info Sets –  Are base for the Query and it contains one or more database table details
Queries – For the User to create and generate the Query
User Group – To restrict set of Users for a specific Query plus for Authorizations
Quick Viewer –  A simple tool for quick report generation

SAP Query – Creation:

Step 1: Creation of User Group – SQ03

Step 2: Creation of Infoset – SQ02

Step 3: Creation of Query – SQ01

The Terminologies:

SAP Query – Area:


https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 1/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

SAP Query Area is a set of objects having queries, InfoSets and User Groups which are consistent.
Follow RSS feed Like

Following Query Areas:

Standard Area – They are Client Specific Queries and do not create an Work Bench Request
Global Area  – Queries in the Global Area are Client Independent

SAP Query – User Group Creation:

Transaction Code: SQ03

Create a logical set of User Group to which the InfoSet Queries would be assigned.

SAP Query – Info Set Creation – TABLE JOIN:

SAP database have several numbers of tables in which the transactions, master data gets stored and it’s
practically not feasible to have all such fields for selection when creating a query. Hence before the start of
creating a query, InfoSet creation is required.

It allows selecting Fields from either the tables selected or the logical database used to get display/select in
the output.

Transaction Code: SQ02 –

https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 2/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

Follow RSS feed Like

The InfoSet creation can be made with the Combination of Tables (Table Join), Direct read from a Single Table
or with the help of Logical Database.

The Red Box marked Icon allows adding more tables under the join.

Field Group contains the Fields which are required either to get in the report output or in the selection
screen.

Drag the Fields for the “Data Fields” to the relevant Field Groups to appear in the report.

You can even change the text of the Fields that is getting displayed over the Output.
https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 3/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

Follow RSS feed Like

Once the InfoSet is created, it needs to be generated by click on  “Generation” icon.

Any changes made to the InfoSet, it needs to be re-generated everytime.

SAP Query – Assigning to User Group:

Transaction Code: SQ03

All the InfoSet queries which are created to be assigned to one or more user group

Click on Save button for the assignment.

https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 4/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

SAP Query – Query Creation:


Follow RSS feed Like

Transaction Code: SQ01

Once the InfoSets are created and assigned to User Group, Query needs to be designed. It is basically known
as Query Painter in which we design basic lists in WYSIWYG mode (what-you-see-is-what-you-get).

We need to select the User Group first in which query needs to be designed. Click on   icon to select the user
group.

Specify the Query Name and click on the Create Option.

Select the InfoSet which had been created.

Following screen would appear:

We can select the Output Format, Variant assignment over the Basic List.

Click on   to select the required Output/Selection Field.

https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 5/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

Follow RSS feed Like

Click on Save Option to make a final design.

To Run the Query Click on Execute Button:

SAP Query – Info Set – LOGICAL DATABASE:

The LDB is special type of ABAP program that combines the contents of certain related database tables and
retrieves some related data and make it available to application programs. The LDB usually consists of the
https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 6/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

components like Structure, Selections and Database programs.


Follow RSS feed Like

In simple words Logical Database can be referred as Cluster of Tables together.

Transaction Code: SE36

Following are some useful Logical Database from accounting perspectives:

ADA      Assets Database


AUK      Settlement documents
BRF       Document Database
BRM      Accounting Documents
CEK      Cost Centers – Line Items
CIK       Cost Centers – Actual Data
CKA      Costing
CKC      Order BOM
CKW     Costing run: Material Selection
CPK      Cost Centers – Plan Data
KDF      Vendor Database
PAK      CO-PA Segment Level and Line Items
SDF      G/L Account Database

Example:

https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 7/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

Follow RSS feed Like

Once the Table are copied follow the same steps as mentioned above for creation of Field Groups, Query
Creation & Execution.

SAP Query – QUICKVIEWER – SQVI:

Quick Viewer is tool to generate report with basic lists. Quick View Reports are user dependent. While defining a
Quick View Tool report data can be accessed from Tables, Logical Database, Table joins & from Infosets also.

Transaction Code: SQVI

We get an option of extracting the data from a Table / Table Join / Logical Database / SAP Infoset

https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 8/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

Follow RSS feed Like

Once all the required tables are been assigned and joined, click no the Back Icon to Create the Selection /
Output Screen.

Select all the required fields, which are needed as a part of Selection Screen and Report Output Layout and
save the Quick Viewer Query.

To execute teh Query, Click on  Execute Button to the run the Quick Viewer.

Above are the simple options of creating report with the help of Queries.

BR, Jaymin R. Bhatt

https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 9/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

Follow RSS feed Like

Alert Moderator

Assigned tags

FIN (Finance) |

Related Blog Posts

INSTALLMENTS PAYMENT - Payment Terms & Document Split


By Suman Sardar , Sep 27, 2012

TRM 新产品类型:信用证
By Former Member , May 17, 2016

ALE distribution of Cost Center and GL Account Master Data across SAP systems through IDOCs
By Former Member , Oct 08, 2012

Related Questions

SAP Query (KNA1 + KNB1 + ADR6)


By Prashant Govind Rane , Feb 18, 2014

SAP Query with Logical databse BRM


By Narsaiah T , Feb 11, 2010

ABAP query
By Former Member , Aug 13, 2007

11 Comments

https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 10/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

Former
Follow Member RSS feed Like

May 9, 2014 at 3:32 pm

Good Document

Like (0) | Reply | Alert Moderator

Former Member | Post author

May 9, 2014 at 4:25 pm

Thanks…

Like (0) | Reply | Alert Moderator

GT SAP

May 9, 2014 at 5:36 pm

Very nice documentation. Thanks, Jaymin.

Like (0) | Reply | Alert Moderator

Prashant Govind Rane

May 11, 2014 at 12:29 pm

Hello Jaymin,

Thanks for sharing the document.

Is it possible for you to share one example of logical database query for ADA? Thanks in advance!

my email ID [email protected]

B/R

Prashant Rane

Like (0) | Reply | Alert Moderator

Mariks .

May 12, 2014 at 12:38 pm

Thanks for the sharing valuabledocument…

https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 11/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

Like (0) | Reply | Alert Moderator


Follow RSS feed Like

Former Member

November 10, 2017 at 4:51 am

CAN ANYONE HELP

Like (0) | Reply | Alert Moderator

Dibyendu Patra

November 10, 2017 at 5:06 am

You are in comment section in a blog post. What help do you need? If you have any doubt regarding this blog
post, then ask that instead of just posting “Can anyone help”.

Like (0) | Reply | Alert Moderator

Rajesh Polisetty

December 11, 2018 at 2:55 am

Hi Jaymin,

Thanks for the blog with such detailed steps.

Like (0) | Reply | Alert Moderator

Cigil R

March 15, 2019 at 9:56 am

Thanks

Like (0) | Reply | Alert Moderator

Md Zaiedul Hoque

September 18, 2019 at 6:46 am

Thanks for the complete explanation on SAP Query.

Can anyone also help for Making t-code after completing all the query building so that user can use via t-
code. Advance thanks..
https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 12/13
10/8/2020 SAP Query – Creation & Execution – Table Join & Logical Database | SAP Blogs

ZAIED
Follow RSS feed Like
Like (0) | Reply | Alert Moderator

samnovice new

October 1, 2019 at 11:01 am

Md Zaiedul Hoque

Please click here for youtube instructions.

I hope it helps.

BR.

Sam

Like (0) | Reply | Alert Moderator

Add Comment

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://blogs.sap.com/2014/05/09/sap-query-creation-execution-table-join-logical-database/ 13/13

You might also like