You are on page 1of 12

SAP Query enables data from multiple tables to be extracted in one report, as long as at least one

field of data can be linked from one table to another e.g. by Document Number.
Unlike table broser !S"#$%, reports from SAP Query can be sa&ed.
'ou ill need the re(uired tables and fields before running SAP Query !if not knon, refer to the
list of tables PD) ithin the Data "xtraction section%.
Read more about SAP ABAP
*lick on the Quick +ieer button.
,he next screen enables ne reports to be created or sa&ed reports to be run or amended.
Note- ,he .elp topics at the bottom of the page are referenced to the SAP /ibrary on 0nternet
"xplorer.
0n this example e are creating a report to sho all &endors for a particular *ompany ith name,
address, payment method and bank details.
This will involve joining three tables:
Table What it Fields Description not a comprehensive SAP !ame
!ame contains list"
/)A# +endor 1aster
+endor Name *ity Postal *ode Search
,erm Street Address *reated 2n *reated
3y Account 4roup
/0)N5 NA1"# 25,6#
PS,/7 S25,/ S,5AS
AD5N5 "5DA, "5NA1
8,288
/)3#
+endor 1aster
Data by
*ompany
+endor *ompany *ode Personnel Number
*reated 2n *reated 3y 5econciliation
Account Payment 1ethods Payment ,erms
/0)N5 3U85S P"5N5
"5DA, "5NA1 A82N,
79"/S 7,"51
/)38
+endor 3ank
Details
+endor 3ank 8ey 3ank account number
Account .older
/0)N5 3AN8/ 3AN8N
820N.

Note- A (uery ill only ork ith actual tables and some e.g. 3S"4 are too large to ork ith.
,he system ill let you kno if it cannot ork ith a specific table. 9hen this happens, logical
databases should be used instead. ,hese can be identified using transaction S"#: !See separate
instructions%.,o create a ne report-
"nter a name for the report in the Quick&ie display box.
*lick ;*reate<
"nter a meaningful title for the report in the ne box that has appeared.
#earn more on SAP ABAP Transaction $ode
"nter a meaningful title for the report in the ne box that has appeared.
0f more than one table is to be used then select ;,able =oin< from the Data source box.
Select ;3asis mode< then, click the ;green tick<.
2n the next screen, click ;0nsert table<.
,o a&oid resorting fields later, tables should be entered in the correct se(uence.
0n this example e ill display the *ompany data then the Address data and finally, the 3ank
data.
"nter table /)3#.
;4reen tick<.
*lick ;0nsert table< again and enter the next table !/)A#%.
;4reen tick<.
"nter the last table name !/)38%.
;4reen tick<.
,he screen should no look like this.
,his shos all a&ailable fields ithin the selected tables and all the links beteen them.
0n this instance there is only one link beteen all three tables and that is the &endor number
!/0)N5%. ,he links need to be checked as sometimes they are not correct.
,o check a link > right click on the line and select ;Display =oin condition<. 3oth fields should be
the
same !apart from the numbering%.
,o delete an incorrect =oin ? right click on the line and select ;5emo&e =oin condition<.
,o add the correct =oin ? click and drag the field from the left hand table to the corresponding
field
on the right hand table and release.
2nce the tables and =oins ha&e been set, click the 4reen ;3ack< Arro.
,he folloing screen should be displayed.
2n
2n the left hand side are the tables selected.
,he right hand side shos the a&ailable fields for selection @ report layout.
)or some reason the field name text is different to the field description on the actual table,
hoe&er, the left hand screen can be expanded to display the SAP field name !hich is constant%
and to specify list and selection fields from each table.
As
As the link to &endor number has already been made, this field only has to be selected from one
of the tables. /ikeise for other fields that appear more than once, they only ha&e to be selected
once, for here they are to appear in the report.
As each field is selected it appears on the right hand side display, hen this process is complete
click on ;"xecute<.
,he next screen enables the selection criteria to be entered.
0f this is not as expected then go back to the pre&ious screen and add@delete selection boxes.
%ore on SAP ABAP &nterview 'uestions
*lick on the options icon in the ;2utput format< area to display all a&ailable formats.
;Spreadsheet< is the preferred option for donloading to 0D"A.
0f the report is too big for this, an error message ill be displayed and either ;SAP /ist +ieer<
or
;Display as ,able< can be used instead.
Select ;,able< and 4reen tick.
;4reen tick< the next screen to run the report.
A spreadsheet titled ;9orksheet in 3asis !#%< should be displayed.
*lick on )ile, Sa&e copy asA..
5ename the file and sa&e in the SAP donload area !it<s a good idea to create a specific folder in
your audit directory for this purpose%.
,o run or change an existing (uery.
*lick on Quick &ieer.
*lick the button to the left of the re(uired (uery !to highlight it%.
*lick ;*hange< to add or remo&e display @ selection fields.
2r click ;"xecute< if changes are not re(uired to the fields.
,his takes you to the selection screen. Selections can be entered and the report run.
> See more at- http-@@.saptechies.org@sap>(uery>step>by>step>
guide@Bsthash.'9,l1e)U.dpuf

You might also like