Professional Documents
Culture Documents
SAP Query StepByStep Guide 12aug2008 PDF
SAP Query StepByStep Guide 12aug2008 PDF
The next screen enables new reports to be created or saved reports to be run or amended.
Note: The Help topics at the bottom of the page are referenced to the SAP Library on Internet
Explorer.
In this example we are creating a report to show all vendors for a particular Company with name,
address, payment method and bank details.
This will involve joining three tables:
Table
Name
What it contains
Fields Description
(not a comprehensive list)
SAP Name
LFA1
Vendor Master
Vendor
Name
City
Postal Code
Search Term
Street
Address
Created On
Created By
Account Group
LIFNR
NAME1
ORT01
PSTLZ
SORTL
STRAS
ADRNR
ERDAT
ERNAM
KTOKK
LFB1
Vendor
Company Code
Personnel Number
Created On
Created By
Reconciliation Account
Payment Methods
Payment Terms
LIFNR
BUKRS
PERNR
ERDAT
ERNAM
AKONT
ZWELS
ZTERM
LFBK
Vendor
Bank Key
Bank account number
Account Holder
LIFNR
BANKL
BANKN
KOINH
Note: A query will only work with actual tables and some e.g. BSEG are too large to work with.
The system will let you know if it cannot work with a specific table. When this happens, logical
databases should be used instead. These can be identified using transaction SE12 (See separate
instructions).
Enter a meaningful title for the report in the new box that has appeared.
If more than one table is to be used then select Table join from the Data source box.
Select Basis mode then, click the green tick.
To avoid resorting fields later, tables should be entered in the correct sequence.
In this example we will display the Company data then the Address data and finally, the Bank
data.
Enter table LFB1.
Green tick.
Click Insert table again and enter the next table (LFA1).
Green tick.
Enter the last table name (LFBK).
Green tick.
This shows all available fields within the selected tables and all the links between them.
In this instance there is only one link between all three tables and that is the vendor number
(LIFNR). The links need to be checked as sometimes they are not correct.
To check a link - right click on the line and select Display join condition. Both fields should be the
same (apart from the numbering).
To delete an incorrect join right click on the line and select Remove join condition.
To add the correct join click and drag the field from the left hand table to the corresponding field
on the right hand table and release.
Once the tables and joins have been set, click the Green Back Arrow.
For some reason the field name text is different to the field description on the actual table,
however, the left hand screen can be expanded to display the SAP field name (which is constant)
and to specify list and selection fields from each table.
As the link to vendor number has already been made, this field only has to be selected from one
of the tables. Likewise for other fields that appear more than once, they only have to be selected
once, for where they are to appear in the report.
As each field is selected it appears on the right hand side display, when this process is complete
click on Execute.
Click on the options icon in the Output format area to display all available formats.
Spreadsheet is the preferred option for downloading to IDEA.
If the report is too big for this, an error message will be displayed and either SAP List Viewer or
Display as Table can be used instead.
Click the button to the left of the required query (to highlight it).