02 Abap Query

Embed Size (px)

Citation preview

  • 8/10/2019 02 Abap Query

    1/34

    Chapter :2 ABAP Query

    Chapter :3 Contents

    Learning the Basics of ABAP Query.................................................................... 22

    Creating a Report with ABAP Query.................................................................... 27

    Running the Query............................................................................................ .. 226

    Understanding the Report List........................................................................... 227

    etting the !ost fro" ABAP Query# $ips % $ric&s........................................... 227

    Re'iew.................................................................................................................. 2((

    )here to Learn !ore........................................................................................... 2((

    Report *e'e+op"ent $oo+s ,

    2

    In this chapter you will learnhow to:

    Create a functional reportin ABAP Query

    Build a basic functionalarea using a logicaldatabase

    Maintain a user group

    Create a report using afunctional area and a usergroup

  • 8/10/2019 02 Abap Query

    2/34

    2

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    Learning the Basics of ABAP Query

    In this chapter, you will learn about ABAP Query, a tool that lets you present datafrom database tables in report lists. Before getting into how you can use ABAPQuery to create reports, it is important to understand its features and basicorgani ation.

    What Is ABAP Query?

    ABAP Query is an easy!to!use reporting tool that lets you "uery data from one ormore database tables and funnel it into a list. #ith this tool, you can e$tract datafrom %irtually any application or database table in the &'( )ystem. ABAP Queryenables you to create lists by mo%ing through menus.

    *he output of ABAP Query can be:+isplayed on the screen in a table format+isplayed on the screen using )AP graphics+ownloaded to a spreadsheet for e$ample, Microsoft -$cel+ownloaded to a /at 0le)a%ed as an e$tract that can be %iewed later.

    Who Uses ABAP Query?

    ABAP Query is used by two di1erent groups of people. -ach group wor2s withdi1erent ABAP Query components.

    Departmental users: *hese are end users who create new "ueries andgenerate lists. 3on!technical users 0nd ABAP Query particularly usefulbecause it does not re"uire any programming 2nowledge.

    System administrators: )ystem administrators set up the necessaryen%ironment for end users and carry out transports.

    ABAP Query can be used to access 4ust about any data in the database, ma2ingit %ery desirable for users in many areas of a business. )e%eral &'( applicationareas pro%ide a prede0ned logical database for easier information retrie%al.

    How Is ABAP Query rgani!e"?

    As shown in the graphic, ABAP Query has three main components:5unctional areas

    Queries6ser groups

    Reporting !ade -asy

  • 8/10/2019 02 Abap Query

    3/34

    (

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    BasicList

    BasicList

    Ran&edList

    Ran&edList

    tatistica+List

    tatistica+List

    /unctiona+Areas

    /unctiona+Areas

    ABAP Query

    User roupsUser

    roupsQueriesQueries

    #unctiona$ Areas

    7ou need functional areas to o1er a preselected set of data to the user,depending on the tas2 to be accomplished. A functional area de0nes the tables8and the 0elds within those tables8which can be "ueried. 5unctional areas use alogical database, a direct read from a table, or a series of table 4oins todetermine the a%ailable tables.

    Why create functional areas

    ABAP Query allows you to e%aluate data in the &'( )ystem. 9owe%er, sincethe system contains se%eral hundred thousand 0elds in logical databases, intables, and se"uential datasets, it is simply not practical to o1er all these0elds to a user for selection when creating "ueries. *herefore, before startingto create "ueries using the component Maintain Queries , you createfunctional areas using the component Maintain 5unctional Areas . 5unctionalareas pro%ide the user with a framewor2 for de0ning a "uery "uic2ly andeasily.

    Functional groups

    #hen you create a functional area, you select a logical database from anapplication system. 9owe%er, since one logical database can contain a %astnumber of 0elds, you combine 0elds together in logical units 2nown asfunctional groups see page . A functional area not only allows you torestrict the number of 0elds and group them together in meaningful units, butit also allows you to de0ne au$iliary 0elds and process them li2e database0elds.

    7ou can also read the long te$ts in additional tables for e$ample, the longte$t of an airline carrier in the table )CA&& and perform any necessarypreliminary wor2. *his means that you can e%aluate se"uential datasets 4ustas easily as )AP databases. )tarting with &elease ;.

  • 8/10/2019 02 Abap Query

    4/34

    0

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    User %roups

    6ser groups lin2 users to functional areas and "ueries and control the functionalareas and "ueries a user can access. -ach functional area is assigned to one ormore user groups. 5or access to ABAP Query, a user must be a member of atleast one user group. All members of a user group can access the same data aswell as the same programs "ueries to create lists.

    What is a user group?

    A user group is a collection of users that wor2 with comparable data andaccomplish similar tas2s. Changes to functional areas and "ueries areimmediately %isible to all users.

    *he users assigned to a user group can only access the functional areasassigned to their user group. #hen creating a "uery, the user group controlswhich functional areas can be used. 9owe%er, user groups are irrele%ant if auser has full authori ation to all &'( data. )tarting with &elease ;.=!character names. Prior releases were limited to two!character names.

    Queries

    #hen you create di1erent lists using ABAP Query, you can sa%e the layout foreach list. *he element created is called a "uery. A "uery is speci0c to a usergroup and functional area. #hen creating a "uery, you may only select onefunctional area. #ithin a "uery, you must also specify functional groups in theselected functional area. *his means the selected area and the groups mustcontain all the 0elds you wish to include in the "uery.

    Using queriesIf appropriate authori ations are in place, you can e$ecute, modify, copy, anddelete "ueries. Any modi0cations to "ueries a1ect all users of a user group.

    *hat is, if one user deletes a "uery, it is lost for all other users as well. Allchanges or new creations are at once %isible to all users.

    )tarting with &elease ;.

  • 8/10/2019 02 Abap Query

    5/34

    1

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    &e$ate" 'er(ino$ogyLogical database : A series of tables that are lin2ed together %ia a logical

    database program.Functional groups : Part of a functional area. 7ou create functional

    groups within a functional area and then assign the 0elds you want to "ueryto the functional group.

    Logical database

    *o retrie%e data, ABAP pro%ides an e$tra read program called a logicaldatabase. *his program reads the re"uired data and pro%ides it to you in thecorrect order. 7ou only write the statements that process the data. *o ta2ead%antage of this functionality for your report program, you must declare thelogical database in the report attributes.

    )AP deli%ers se%eral logical databases in the application areas and gi%es a userthe capability of creating their own. #e strongly recommend that a basis'toolse$pert be in%ol%ed in the creation of a logical database. *o %iew the deli%ered)AP logical databases, follow the menu path: Tools ABAP WorkbenchDevelopment Programming Environment Logical Databases, or usetransaction code SE36 .

    Functional groups

    If a 0eld is not assigned to a functional group, it cannot be included in a "uery.5unctional groups ha%e two!character names and are functional!areadependent. *here are no naming restrictions for functional groups.

    How to Access ABAP Query Co(ponents?5rom the )AP main menu, choose System Services ABAP !ery to accessABAP Query. *o access the components of ABAP Query, use the menu pathsshown in the following table:

    ABAP Query Component enu Path

    Maintain Queries Tools ABAP Workbench "tilities ABAP!ery !eries

    Maintain 5unctional Areas Tools ABAP Workbench "tilities ABAP

    !ery #!nctional AreasMaintain 6ser ?roups Tools ABAP Workbench "tilities ABAP

    !ery "ser $ro!ps

    Report *e'e+op"ent $oo+s

  • 8/10/2019 02 Abap Query

    6/34

    6

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    How )oes ABAP Query )iffer fro( ther &eporting 'oo$s?

    *here are se%eral di1erences between ABAP Query and other reporting tools:ABAP Query can access data from any table within )AP. Most other

    reporting tools can access only certain tables.ABAP Query is ideal for listing data from any application in the system. It

    can calculate additional 0elds such as purchase price %ariance PP@ inprocurement or aging buc2ets in accounts recei%able A'& , and total andsort on any 0eld. *hese 0elds are calculated on each line of a detail reportand then totaled by the speci0ed 0elds for e$ample, material or customer .

    ABAP Query reports are typically simple listing and totaling reports, unli2ea balance sheet or an income statement that re"uires comple$ groupings fore$ample, a cash or re%enue line made up of se%eral accounts on a 0nancialstatement . )uch comple$ groupings would re"uire the "uery to read tablesmultiple times to appropriately total and sort the accounts. ther tools suchas &eport Painter' &eport #riter which uses sets for these groupings arebetter suited for reports with comple$ groupings.

    What Are the Prere*uisites?An understanding of the data dictionary and perhaps some basic

    programming: #hile an ABAP programming bac2ground is not critical to usethis tool, 2nowledge of the data dictionary and some basic programming ishelpful. If you are not familiar with the data dictionary or do not possess basicprogramming s2ills, you may want to enlist the help of a basis'tools e$pert atsome point. *hese s2ills will come in handy when the functional area you arebuilding needs additional tables, additional 0elds, or table 4oins.

    Kno re!uired database tables and "elds: Before starting a "uery,

    you should 2now the re"uired tables and 0elds. *o e$ecute a "uery, datamust be present in the tables you are accessing. A general understanding ofthe 0elds and how they are stored in the database is also helpful. 5ore$ample, the posted dollar amount in an 5I document is stored as an absolutenumber. *he system uses the posting 2ey to determine if the actual %alue ispositi%e or negati%e. *o show the correct amount in your "uery you will needto create an additional 0eld in the functional area that chec2s the posting 2eyto determine the correct amount. *he correct amount is then stored in theadditional 0eld for your "ueries.

    System settings: An administrator must 0rst ma2e the re"uired settingsto allow a user to wor2 with ABAP Query.

    Authori#ations: -nd users and system administrators must ha%e theappropriate authori ations to use ABAP Query.

    Reporting !ade -asy

  • 8/10/2019 02 Abap Query

    7/34

    7

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    Creating a &eport with ABAP Query

    In this section a guided tour shows you how to create a report using ABAP Query. *his step!by!step approach is built around a sample report see the graphicbelow . #e suggest you ta2e a few minutes to familiari e yourself with thescenario and the desired report.

    +,a(p$e: Bungee Corporation wants to %iew the account history for se%eral?'D accounts at a time8in a speci0ed format. #hile they li2e many of thestandard reports pro%ided in &'(, they would prefer to change the order of thecolumns. Bungee Corporation belie%es that in the future they will include0elds from internal tables, and thus would li2e to begin creating customreports. Additionally, the company wants to be able to print the ?eneralDedger history.

    )hown below is a pre%iew of the ?eneral Dedger 9istory report with all thedesired functionality. 5or this "uery, we will create a functional area using alogical database. *his is an easy and e1ecti%e way to start creating "ueries.

    -ote: In the e$ample we use &elease ;.

  • 8/10/2019 02 Abap Query

    8/34

  • 8/10/2019 02 Abap Query

    9/34

  • 8/10/2019 02 Abap Query

    10/34

    ,4

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    >>.Choose the &reate buttonne$t to the #!nctional gro!ps folder to add two functionalgroups to the newly createdfunctional area ++ $L DETA-L .

    >=.Create the following twofunctional groups, A. and A/ in the &reate #!nctional$ro!ps window:

    A. for Acco!nt 0aster -n1o A/ for Acco!ntTransactions

    >(.Choose Enter .

    Reporting !ade -asy

    ,,

    ,2

    ,(

  • 8/10/2019 02 Abap Query

    11/34

    ,,

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    .tep 2: Assign &e*uire" #ie$"s to #unctiona$ %roups

    >. Choose E(pan) to assign

    0elds to the functional groupsfor "ueries. nce the nesteddetail is in %iew, the buttonturns from green to red.

    =. Clic2 line A., Acco!nt 0aster-n1o, to highlight the group for0eld assignment.

    (. *o assign the 0elds to thefunctional group A. , clic2 theminus ! sign, ne$t to the0eld names. *he icon changesto a green plus sign. *hefunctional group A. appearsne$t to the green icon,indicating that the 0elds ha%ebeen assigned to thehighlighted functional group.

    Continue adding 0elds to thefunctional group by repeatingsteps > and ( abo%e for eachtable that contains 0eldsneeded for your "ueries.

    *o select a di1erent functionalgroup to add 0elds to, double!clic2 on the new functionalgroup and perform steps >and ( abo%e .

    %electing fields for functional groups

    #hen selecting 0elds for your functional groups, select the 0eld in the highestpossible table. 5or e$ample, company code B6J&) is a%ailable in tables )JB>,)JC>A, )JC>C, BJP5, B)I), B)-?, and ?)-?. *he company code should be

    selected only from table )JB> because it is the highest table in the logicaldatabase hierarchy that contains the company code. If the company code isselected from more than one table, it will appear multiple times to the users whencreating "ueries. Multiple appearances can be e$tremely confusing.

    *he ne$t two steps in%ol%e ABAP programming statements. 7ou may want to as2 aBasis'*ools e$pert to help you if you are not familiar with SELE&T statements andbasic ABAP code.

    Report *e'e+op"ent $oo+s

    ,(

    2

  • 8/10/2019 02 Abap Query

    12/34

    ,2

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    *he ne$t step is to add an additional table that does not e$ist in the logical database. In thise$ample, the ?'D account description is not stored in any of the logical database tablesK it isstored in table S2AT% #e need to add table S2AT to table S2A. shown below because all the2ey 0elds of table S2AT are a%ailable in table S2A. .

    ;. Clic2 on the node for S2A. toselect the table in the &hange#!nctional Area ++ $L DETA-Lscreen.

    . Choose E(tras in the toolbarto add an additional table.

    E. Choose &reate .

    F. In 'ame , enter SKAT, the table

    to be added to the functionalarea. Dea%e A))itional table selected.

    G. Choose Enter .

    3ote that the selected table isS2A. .

    Reporting !ade -asy

    7

    1

    0

    6

  • 8/10/2019 02 Abap Query

    13/34

    ,(

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    H. *he system defaults to theSELE&T statement %alues itcan determine. 7ou mustcomplete the missing entries,if any.

    >>.Be sure to add the 0elds fromthe additional table to afunctional group. *headditional tables 0elds will be

    listed under the table to whichit was attached. In thise$ample, table S2AT isattached to table S2A. .

    #e will now loo2 at the same logical database SD# , but at a di1erent table BSE$ . *he ne$tstep is to add an additional 0eld8in this e$ample, the dollar amount in table BSE$ is storedas an absolute %alue. *he online system uses the posting 2ey to determine if the additional0eld is positi%e or negati%e. #e need to add an additional 0eld that would contain the amountwith the proper sign so that the 0nal totals are correctly calculated.

    Report *e'e+op"ent $oo+s

    3

    ,4

    ,,

  • 8/10/2019 02 Abap Query

    14/34

    ,0

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    >=.)elect the line BSE$ .

    >(.Choose the E(tras button toadd an additional 0eld.

    >;.Choose &reate .

    > .In the 'ame 0eld, enterCorrect_Amount , the name ofthe additional 0eld to beadded to the functional area.

    >E.)elect A))itional el) .>F.Choose Enter .

    Reporting !ade -asy

    ,(

    ,0

    ,1

    ,2

    ,6

    ,7

  • 8/10/2019 02 Abap Query

    15/34

    ,1

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    >G.In Description , enter anappropriate 0eld description.

    >H.In 4ea)er , enter the columnheader te$t.

    =.*o enter the ABAP code for theadditional 0eld, choose E)itor .

    ==.-nter the ABAP code that willdetermine the %alue of theadditional 0eld. In thise$ample, we are chec2ing thedebit'credit indicator BSE$5S42+$ . If we 0nd an S fordebit, then the correct amountis e"ual to the local currencyamount BSE$5D0BT7 . If it isnot a debit, then it is a creditand the local currency amountmust be multiplied by 5. .

    &emember to enter the periodsat the end of each lineL

    =(.Choose Save .

    =;.Choose Back .

    = .Choose Enter twice to returnto the logical database %iew of the functional area.

    Report *e'e+op"ent $oo+s

    ,,3

    24

    22

    2( 2021

    2,

  • 8/10/2019 02 Abap Query

    16/34

    ,6

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    =E.+ouble!clic2 on the functionalgroup A/ to select it.

    =F.*o add the additional 0eld&877E&T A08"'T to a

    functional group so that it canbe used in "ueries, e$pandthe BSE$ table to show all the0elds. )croll down to thebottom and select the&877E&T A08"'T 0eld.

    .tep 3: %enerate the #unctiona$ Area

    >. Choose $enerate togenerate the functional area.

    *his is the 0nal step increating the functional area.

    =. Choose Back after thefunctional area has beengenerated.

    Reporting !ade -asy

    26

    ,

    2

    27

  • 8/10/2019 02 Abap Query

    17/34

    ,7

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    .tep 0: Create User %roup

    )tep below describes how to create a user group.

    .tep 1: Assign the #unctiona$ Area to the User %roup

    *he functional area must beassigned to a user group before itcan be used in a "uery. 5rom thepre%ious screen in step ( ,choose Environment "ser$ro!ps .

    >. In "ser gro!p , enter X1, thename of the user group.

    =. If a user group does not e$ist,choose &reate .

    *he rest of this e$ampleshows how to create a usergroup. If an e$isting usergroup will be used, choose

    Assign !sers an) 1!nctionalareas .

    (. In the "sers section, enter theuser names of the users whoshould ha%e access to thefunctional areas and "ueriesof this user group. In thise$ample, we added the userTbecker to the user group.

    ;. Choose Assign 1!nct% areas toassign the appropriatefunctional areas to the usergroup.

    Report *e'e+op"ent $oo+s

    2

    (

    0

    ,

  • 8/10/2019 02 Abap Query

    18/34

    ,

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    . *o assign the functional areasto the user group, select theappropriate chec2bo$es onthe left side of the screen. Inthis e$ample, we selectedfunctional areas ?D andN?DN+-*AID.

    E. Choose Save to sa%e theassignments.

    F. Choose Back twice to return tothe main user group screen.

    3ow that the functional area anduser groups ha%e been set up,you are ready to build the "uery.

    .tep : Create the Query

    *o go to "uery maintenance fromthe "ser $ro!p screen, chooseEnvironment !eries

    >. Ma2e sure you are wor2ing inthe appropriate user group.

    =. If not, choose the 8ther "ser$ro!p button and switch tothe correct user group.

    (. In the !ery 0eld, enter aname for the new "uery. Inthis e$ample, enter A1 .

    ;. Choose &reate .

    Reporting !ade -asy

    1

    6 7

    ,

    2

    (

    0

  • 8/10/2019 02 Abap Query

    19/34

    ,3

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    . 7ou are now prompted toselect a functional area. *helist of functional areasincludes all areas assigned tothe user group you arewor2ing with. +ouble!clic2 onthe functional area you wishto use. In this e$ample,double!clic2 on ++ $L DETA-L .

    E. In Title , enter the title of the"uery, and in 'otes enter anyrele%ant notes. *he notes arefor reference only and do not

    appear in the "uery.F. In &ol!mns , enter the column

    si e in characters . In Lines enter the desired number oflines. In this e$ample, thenumber of lines and columnsis 69 and .3/ respecti%ely.

    *his should match a printformat if the "uery is to beprinted.

    G. Choose 'e(t Screen to

    continue.

    Report *e'e+op"ent $oo+s

    1

    6

    7

  • 8/10/2019 02 Abap Query

    20/34

  • 8/10/2019 02 Abap Query

    21/34

  • 8/10/2019 02 Abap Query

    22/34

    22

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    =>.*he counter 0eld is new in&elease ;.< and allows you tocount the number of entries inyour "uery for the selected0eld. *his will also total on thesort 0elds.

    ==.*he &ompresse) )isplay chec2bo$ allows detailtransactions to be suppressedon the initial screen and thene$panded if necessary . #ithcompression on, you will seethe account number and atotal for the account. #hene$panded you will see all therelated transaction detail.

    =(.Choose 'e(t Screen tocontinue.

    *his screen helps you set up thesort 0elds.

    =;.*o get te$t abo%e each sortbrea2, select Te(t .

    = .*o get totals for a sort le%el,select Total . *his option wor2sonly if you ha%e also selectedTotal for a numeric 0eld on the

    pre%ious screen.=E.*o get counter totals for the

    sort 0eld, select &nt .counter .

    =F.*o get a blan2 line betweenaccount numbers, selectBlnkLn .

    =G.*o get a page brea2 at eachnew company code, select'e:Pg .

    =H.Choose 'e(t Screen tocontinue.

    Reporting !ade -asy

    20 21 26 27 2

    23

  • 8/10/2019 02 Abap Query

    23/34

    2(

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    (.Choose 'e(t Screen tocontinue. Choose this buttonthrough each of the control!le%el te$t screens.

    (=.-ach detail line of your "uerywill ha%e a line on the List lineo!tp!t screen. *o get acolumn header for the list line,select 4ea)er line .

    ((.)electing 7e1% chec2s thereferenced line for e$ample,line

  • 8/10/2019 02 Abap Query

    24/34

    20

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    (E.*he "uery gi%es the standardlength of the 0eld. 7ou nowha%e the option of shorteningit.

    (F.If the Pos 0elds are left blan2,the default is one spacebetween each 0eld. -ntries inthe Pos column determinewhere in the line you want the0eld to start. In our e$ample,we want the account numberto start in character position= ! = O E ; .(G.Choose 'e(t Screen to

    continue.

    -ote: 7ou must remember where the line brea2s occur for e$ample between the ?'Daccount long te$t and the accounting document number . *he long te$t is on line . and thedocument number starts line / .

    (H.*his is the column headerscreen. *o change a 0eldheader, double!clic2 on the0eld header in the Pagehea)er section. In thise$ample, we double!clic2 onthe Amo!nt 0eld.

    Reporting !ade -asy

    (6 (7

    (

    (3

    04

    0, 0002 0(

  • 8/10/2019 02 Abap Query

    25/34

    21

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    ;.Choose Enter .

    ;=.*o enter a date, time, page, orname, put your cursor in thewhite line in the Page hea)er section and type &%DATE, &%TIME, &% !"e , or theappropriate %ariable name. *oinsert additional lines, double!clic2 on the white line.

    ;(.Choose Save .

    ;;.CongratulationsL 7our "uery isnow ready to run. ChooseE(ec!te to run the "uery.

    &unning the Query

    *o run a "uery, choose System Services ABAP !ery%

    >. )elect the "uery from the list.In this e$ample, user group

    >. has only one "uery A. .

    =. Choose E(ec!te .

    Report *e'e+op"ent $oo+s

    ,

    2

  • 8/10/2019 02 Abap Query

    26/34

  • 8/10/2019 02 Abap Query

    27/34

  • 8/10/2019 02 Abap Query

    28/34

    2

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    . Choose &reate to add a new 0eld.

    E. In the &reate Selection window, enter the name of the new selection criteria.6se a name that starts with an alpha character.

    F. )elect Selection criterion . )ince parameters only allow one %alue, thisselection gi%es you the most /e$ibility to enter multiple %alues and ranges.

    G. Choose Enter .

    H. -nter the description and selection te$t for the 0eld. In this e$ample, Co*tCenter is added.

    >

  • 8/10/2019 02 Abap Query

    29/34

    23

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    >>.In the E(tras statement, enter any criteria for the 0eld. In this e$ample, thecost center 0eld is made a mandatory 0eld with matchcode capabilities.

    >=.Choose Enter .

    Using 'a6$e 7oins in a #unctiona$ Area

    *able 4oins became a%ailable with &elease (.

  • 8/10/2019 02 Abap Query

    30/34

    (4

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    F. -nter the names of the other tables that are needed in the functional area.

    G. Choose De ne con)ition to de0ne the lin2 between the two selected tables.

    Reporting !ade -asy

    (

    01

    6

    7

  • 8/10/2019 02 Abap Query

    31/34

    (,

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    H. *he tables appear in the Coin con)itions right side of the screen .

    >>.7ou are prompted for proposals for the table 4oin. Choose es and the systemwill propose the 4oin conditions.

    >=.*he proposed 4oin between 0A7D and 0A7& is the material number and theplant. *hese are the two 2ey 0elds on 0A7& . If both 2ey 0elds can bematched as in this case , then the system will always bring bac2 one uni"uerecord8if a record is found.

    Report *e'e+op"ent $oo+s

    3 ,4

    ,2

    ,(

  • 8/10/2019 02 Abap Query

    32/34

    (2

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    If the proposal did not create the intended 4oin conditions, you may want tode0ne additional 4oin conditions. *o do this, enter matching numeric %alues inthe two!character space ne$t to each 0eld. 5or e$ample, if -n)% #lag material on 0A7D should match the -n)icator #lag material on 0A7& , enter a (.Choose Back to go bac2 one screen.

    >;.Choose #!nctional gro!p on the ne$t screen to begin adding 0elds to thefunctional groups from the ad4oined tables.

    Assigning &eports with &eport Ca$$ #unctiona$ity in a Query

    -ach "uery has 7eport &all functionality for drilling down to other reports. *hesereports can be any of the following:

    &eport groups created using &eport Painter'&eport #riter see chapter (

    +rilldown reports created using the +rilldown reporting tool see chapter ;and appendi$ 5

    ABAP programsther ABAP "ueries

    *ransaction codes for e$ample, standard reports a%ailable in DI). 5or moreinformation, see chapters and E

    Many customers li2e to drill down to display transaction codes for masterrecords and detail transactions from "ueries. *o add the 7eport &all functionality to a "uery:

    >. 7ou must be in &reate or &hange mode within the "uery.=. Choose $oto 7eport assignment .

    (. Assign any of the report types mentioned abo%e to the "uery.

    ore He$pfu$ Hints for &eport )e8e$opersCreating functional areas using table 4oins, instead of logical databases, is

    more e cient for processing if you are using only a few tables. 9owe%er,logical databases are essential for creating hierarchical lists. 7ou may want toconsider the pros and cons of using functional areas and logical databases ifperformance issues are an important concern. +ue to percei%ed performanceproblems, many customers ma2e limited use of ABAP Query.

    3on!technical users may 0nd it di cult to wor2 with table 4oins, additionaltables, and additional 0elds. People may get discouraged and bac2 away fromthe tool. 9a%e the more technical team members create the functional areasand user groups. +elegation of tas2s allows less technical team members toconcentrate on creating "ueries.

    Reporting !ade -asy

  • 8/10/2019 02 Abap Query

    33/34

    ((

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query

    #hile ABAP Query is an easy tool to wor2 with, it is important to recogni ethat e$perience with the tool is %aluable toward producing an e cient "uery.

    It is important to control the usage of the toolK not e%ery user in acompany should be gi%en permission to create, change, or access "ueries.Controlled access to ABAP Query is recommended for optimal system

    performance and report organi ation. A reporting team should be formed tocreate and change "ueries. *his team should be responsible for namingcon%entions, report creation, and testing. *he team should ensure thatduplicate functional areas, "ueries, and user groups are not created and thatthe standards are adhered to.

    A report speci0cation form is a %aluable tool. A sample form is included inthe #!n)amentals o1 7eporting guideboo2 and on the companion C+ suppliedwith this guideboo2 set. *his form ser%es as the 2ey channel ofcommunication between the reporting team and the end users that needreports.

    &e8iew

    ABAP Query is an easy!to!use tool for e$tracting data from the &'( )ystem. It canbe used with most tables, both standard and user!de0ned. #ith ABAP Query youcan list data, total, and sort from almost any table or combination of tables.ABAP Query can create basic, statistical, and ran2ed lists. It wor2s with logicaldatabases, tables 4oins, or indi%idual tables. Queries can be printed, downloaded,used with graphics, sa%ed as e$tracts, or simply %iewed on the screen.

    *he following steps are needed to create a report with ABAP Query:

    >. Create a functional area.

    =. Assign re"uired 0elds to functional groups.(. ?enerate the functional area.

    ;. Create a user group.

    . Assign the functional area to the user group.

    E. Create the "uery.

    Where to Learn ore

    &'( Dibrary nline help : In &elease ;.

  • 8/10/2019 02 Abap Query

    34/34

    Chapter 2# ABAP Query

    Creating a Report with ABAP Query