7071503 sap-query-step-by-step-guide-12 aug2008

3,336 views

Published on

Query Creation

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,336
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
243
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

7071503 sap-query-step-by-step-guide-12 aug2008

  1. 1. SAP QUERY – SQ01STEP BY STEP GUIDESAP Query enables data from multiple tables to be extracted in one report, as long as at least onefield of data can be linked from one table to another e.g. by Document Number.Unlike table browser (SE16), reports from SAP Query can be saved.You will need the required tables and fields before running SAP Query (if not known, refer to thelist of tables PDF within the Data Extraction section).Click on the Quick Viewer button.
  2. 2. 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 InternetExplorer.
  3. 3. 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 What it contains Fields Description SAP NameName (not a comprehensive list)LFA1 Vendor Master Vendor LIFNR Name NAME1 City ORT01 Postal Code PSTLZ Search Term SORTL Street STRAS Address ADRNR Created On ERDAT Created By ERNAM Account Group KTOKKLFB1 Vendor Master Data by Vendor LIFNR Company Company Code BUKRS Personnel Number PERNR Created On ERDAT Created By ERNAM Reconciliation Account AKONT Payment Methods ZWELS Payment Terms ZTERMLFBK Vendor Bank Details Vendor LIFNR Bank Key BANKL Bank account number BANKN Account Holder KOINHNote: 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, logicaldatabases should be used instead. These can be identified using transaction SE12 (See separateinstructions).
  4. 4. To create a new report:Enter a name for the report in the Quickview display box.Click ‘Create’Enter a meaningful title for the report in the new box that has appeared.
  5. 5. 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’.
  6. 6. On the next screen, click ‘Insert table’.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 Bankdata.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’.
  7. 7. The screen should now look like this.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 thesame (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 fieldon the right hand table and release.Once the tables and joins have been set, click the Green ‘Back’ Arrow.
  8. 8. The following screen should be displayed.On the left hand side are the tables selected.The right hand side shows the available fields for selection / report layout.
  9. 9. 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 oneof the tables. Likewise for other fields that appear more than once, they only have to be selectedonce, 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 completeclick on ‘Execute’.
  10. 10. The next screen enables the selection criteria to be entered.If this is not as expected then go back to the previous screen and add/delete selection boxes.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.
  11. 11. Select ‘Table’ and Green tick.
  12. 12. ‘Green tick’ the next screen to run the report.A spreadsheet titled ‘Worksheet in Basis (1)’ should be displayed.Click on File, Save copy as…..Rename the file and save in the SAP download area (it’s a good idea to create a specific folder inyour audit directory for this purpose).
  13. 13. To run or change an existing query.Click on Quick viewer.
  14. 14. Click the button to the left of the required query (to highlight it).Click ‘Change’ to add or remove display / selection fields.Or click ‘Execute’ if changes are not required to the fields.This takes you to the selection screen. Selections can be entered and the report run.

×