query creation using sap standard infosets

26
Query Creation Confidential Page 1 SAP R/3 FINANCIALS Query Creation Prepared By Natesh G

Upload: natesh-kumar

Post on 29-Mar-2015

315 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Query Creation  using  SAP Standard InfoSets

Query Creation

Confidential Page 1

SAP R/3 FINANCIALS

Query Creation

Prepared By Natesh G

Page 2: Query Creation  using  SAP Standard InfoSets

Query Creation

TABLE OF CONTENTS

QUERY CREATION..........................................................................................3

1. INTRODUCTION.....................................................................................3

2. CREATE NEW QUERY..............................................................................3

2.1 CREATE NEW INFOSET................................................................................................32.2 CREATE USER GROUP.................................................................................................62.3 CREATE QUERY.........................................................................................................82.4 Create Transaction to view Query.......................................................................14

Confidential Page 2

Page 3: Query Creation  using  SAP Standard InfoSets

Query Creation

Query Creation

1. Introduction

Queries are useful in creating reports without coding in ABAP. It is a very simple tool to generate complex reports for fetching data from various tables in SAP. One can either create a report or use the existing standard report to create a report that suits the needs. This document explains how to copy standard query to generate reports.

Be specific on query creation..whether client specific or cross client… Click on the environment in infoset / query t-code.

And select relevant ones.

Steps for creation of new query:1) Create Infoset – SQ02 (Assigning of Tables, Joining Tables & “Z” fields)2) Assign Infoset to Role / User Group – SQ033) Create Query – SQ01

2. Create New Query

2.1 Create New InfoSet

Confidential Page 3

Page 4: Query Creation  using  SAP Standard InfoSets

Query Creation

Via Menus Tools -> ABAP Workbench -> Utilities -> SAP Query -> InfoSets

Via Transaction Code SQ02

* Copying an existing infoset.

Select the standard query that you want to copy and select the Copy from the Menu shown above or use Keyboard shortcut ‘Ctrl + F1’

Give the name for the Infoset that needs to be created

Confidential Page 4

Page 5: Query Creation  using  SAP Standard InfoSets

Query Creation

After created, the Infoset needs to be generated, so that it can be used in creating the query.

* Creation of New Infoset: (List of contracts in SD as outputs…by joining tables VBAK & KNA1)

Confidential Page 5

Page 6: Query Creation  using  SAP Standard InfoSets

Query Creation

Give VBAK & KNA1 & KNB1

For joining tables click on “Define condition after selecting both tables , the following will be visible on right hand side of the screen

Confidential Page 6

Page 7: Query Creation  using  SAP Standard InfoSets

Query Creation

For establishing a relationship between both tables, we need to identify a common field in both the tables. Click on the above circled icon.

By default system shows the following relationship.

For establishing relationship between these two tables of VBAK & KNA1 with customer number..then we need to remove relationship came as default…click on “=” button and click on above.

Then find KUNNR field on left side as well and give relationship as “00” “=” “00” as below.

Come back once and generate Infoset. The following screen appears..press Enter

Confidential Page 7

Page 8: Query Creation  using  SAP Standard InfoSets

Query Creation

In the above screen…left side of the screen shows the tables selected and system displays all the fileds in those tables…if we need to select only few of them for our reporting purpose either for input or output…then we need to get those fields to right hand side by dragging and dropping…Steps:

1) First create some field groups as required on right hand side2) Drag and drop required fields from left hand side to right hand side.

These groups will be useful during our output selection.Now only fields which are on the right hand side will be available for our evaluation purpose.

Click on the above to generate Infoset.

Confidential Page 8

Page 9: Query Creation  using  SAP Standard InfoSets

Query Creation

2.2 Create User Group

Via Menus Tools -> ABAP Workbench -> Utilities -> SAP Query -> User Groups

Via Transaction Code SQ03

Once the user group is created, the users and Infosets that should be assigned to this

User group should be assigned. Select

Confidential Page 9

Page 10: Query Creation  using  SAP Standard InfoSets

Query Creation

Assign the users who can change the Infosets and Queries assigned to the user group.

Click

Select the InfoSet that needs to be used for creating the Query

Confidential Page 10

Page 11: Query Creation  using  SAP Standard InfoSets

Query Creation

2.3 Create Query

Via Menus Tools -> ABAP Workbench -> Utilities -> SAP Query -> Queries

Via Transaction Code SQ01

From the user group select the Menu below to go to the Queries

Click

Confidential Page 11

Page 12: Query Creation  using  SAP Standard InfoSets

Query Creation

Select the InfoSet to enter the screen for creating the Query

Confidential Page 12

Page 13: Query Creation  using  SAP Standard InfoSets

Query Creation

Use the arrows on the left screen to open the various tables and select the items in Selection Criteria and Output

Confidential Page 13

Page 14: Query Creation  using  SAP Standard InfoSets

Query Creation

Note:

1. The values in the right screen are the Selection Options that appear on the screen (Input Screen)

2. The columns below are the Columns that appear in the Output. 3. For certain columns, there is an option to display either text or value or both. This

can be selected by Right-clicking on the column and selecting accordingly as shown.

4. The output columns also can be shuffled by dragging and dropping at the desired locations.

Click Button to save the query

Confidential Page 14

Page 15: Query Creation  using  SAP Standard InfoSets

Query Creation

Choose the user group and give the name and description of the query that appears when the Query is executed

Once saved, the Query must be generated so that the Report name is generated which can be used for creating the transaction

Confidential Page 15

Page 16: Query Creation  using  SAP Standard InfoSets

Query Creation

Confidential Page 16

Page 17: Query Creation  using  SAP Standard InfoSets

Query Creation

2.4 Create Transaction to view QueryVia Menus Tools -> ABAP Workbench -> Utilities -> SAP Query ->

QueriesVia Transaction Code SE93

Give the name of the Transaction that needs to be created

Confidential Page 17

Page 18: Query Creation  using  SAP Standard InfoSets

Query Creation

Select the second option

Give the name of the Program that was copied from the Query

Confidential Page 18

Page 19: Query Creation  using  SAP Standard InfoSets

Query Creation

Once Transaction is created, it can be checked by giving the name in the Address bar as shown above

The selection criteria appear as above. More selection options are got by using the

button. The output format also can be chosen by clicking the button.

Confidential Page 19

Page 20: Query Creation  using  SAP Standard InfoSets

Query Creation

The output of the report is as shown below for SAP List Viewer

** For Transport of Query / Downloand of query : SQ03 click on ..

Confidential Page 20

Page 21: Query Creation  using  SAP Standard InfoSets

Query Creation

Give names of infoset and query to download…

Select the filename to be download…and the path..

The following output will be given.

Confidential Page 21

Page 22: Query Creation  using  SAP Standard InfoSets

Query Creation

And to upload into the destination system…goto the target system..use SQ03 and transport and click on Upload…

Confidential Page 22

Page 23: Query Creation  using  SAP Standard InfoSets

Query Creation

Confidential Page 23