25
8/9/2019 124254545 13 ABAP Data Dictionary Exercises http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 1/25 SAP R/3 Release 4.7 Exercises: The ABAP Dictionary SAP Development ABAP Trainin !amin "onventions SAP has agreed to never create development objects whose names begin with a Y or a Z. SAP customers (that’s you! must give all objects that they  create names that do begin with a Y or a Z. his prevents the possibility o" naming con"licts during an upgrade "rom one release o" SAP to another.  Also# in the "ollowing e$ercises you will see suggested object names. %ach suggested object name will contain XX  or ZZ . o ensure that objects you create have di""erent names "rom objects that your classmates create# replace the  XX  or ZZ that you will see in the suggested object names with the last two digits o" your SAP &ogon '. )*hen you are in a situation# where a dictionary object o" your selected name already e$ists in the system# then as+ the instructor i" you can delete the e$isting one# otherwise as+ him to suggest a new name "or yours., 'n short- egin all object names with a Y or a Z# and replace the XX  or ZZ  with the last two digits o" your SAP logon '. Developer Access #eys vs. $%&ect Access #eys he "irst time you try to create an object in SAP# the system will respond with a dialog bo$ that says# /You are not a registered developer.0 he dialog bo$ will prompt you "or a 123digit Developer Access #ey. he re4uest "or a developer access +ey will only appear once. A"ter you enter the +ey correctly# you will not be prompted "or it again. 5owever# i" you try to change an SAP3delivered object (or i" you "orget to name your  object beginning with a Y or a Z# you will be prompted "or an $%&ect Access #ey. his is because SAP registers and controls all customer changes to SAP3delivered objects. '" you see this dialog bo$ during this course# you have made a mista+e6 clic+ the cancel button in the dialog bo$. 't is easy to con"use a re4uest "or a developer access +ey with a re4uest "or an object access +ey. 7ne way to remember the di""erence is to remember the phrase# /You are not a registered developer.0 '" the re4uest contains this phrase# it is as+ing "or a developer access +ey. '" it does not contain this phrase# it is as+ing "or an object access +ey. "hapter ' Exercises 8arch 1229 Page :

124254545 13 ABAP Data Dictionary Exercises

Embed Size (px)

Citation preview

Page 1: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 1/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

!amin "onventions

SAP has agreed to never create development objects whose names begin with a Y or a Z. SAPcustomers (that’s you! must give all objects that they  create names that do begin with a Y or a Z.his prevents the possibility o" naming con"licts during an upgrade "rom one release o" SAP toanother.

 Also# in the "ollowing e$ercises you will see suggested object names. %ach suggested objectname will contain XX  or ZZ . o ensure that objects you create have di""erent names "rom objectsthat your classmates create# replace the XX  or ZZ that you will see in the suggested objectnames with the last two digits o" your SAP &ogon '.)*hen you are in a situation# where a dictionary object o" your selected name already e$ists inthe system# then as+ the instructor i" you can delete the e$isting one# otherwise as+ him tosuggest a new name "or yours.,

'n short- egin all object names with a Y or a Z# and replace the XX  or ZZ  with the last two digitso" your SAP logon '.

Developer Access #eys vs. $%&ect Access #eys

he "irst time you try to create an object in SAP# the system will respond with a dialog bo$ thatsays# /You are not a registered developer.0 he dialog bo$ will prompt you "or a 123digitDeveloper Access #ey. he re4uest "or a developer access +ey will only appear once. A"teryou enter the +ey correctly# you will not be prompted "or it again.

5owever# i" you try to change an SAP3delivered object (or i" you "orget to name your  objectbeginning with a Y or a Z# you will be prompted "or an $%&ect Access #ey. his is because

SAP registers and controls all customer changes to SAP3delivered objects. '" you see this dialogbo$ during this course# you have made a mista+e6 clic+ the cancel button in the dialog bo$.

't is easy to con"use a re4uest "or a developer access +ey with a re4uest "or an object access+ey. 7ne way to remember the di""erence is to remember the phrase# /You are not a registereddeveloper.0 '" the re4uest contains this phrase# it is as+ing "or a developer access +ey. '" it doesnot contain this phrase# it is as+ing "or an object access +ey.

"hapter ' Exercises

8arch 1229Page :

Page 2: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 2/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

he e$ercises "or this chapter will teach you how to create and manipulate the basic objects o"the AAP ictionary- tables# data elements# and domains. You will also enter data into one o"

your tables# and you will learn how to write a simple program that e$tracts data "rom an AAPictionary table.

'" you re4uire assistance at any point# please as+ an instructor. ry to do the solutions "or thee$ercises yoursel" and i" you "ind any di""iculty consult the hands on instructor. Also# solutions areprovided in this boo+# but only re"er to them as a last resort.

Exercise '.( "reate the ) XX E*P ta%le.

his table will store basic in"ormation "or all employees. All employees will have one entry in thistable.

Step (:  ;rom SAP 'nitial Screen 3< =o to ools 3< AAP *or+bench 3< evelopment 3< AAPictionary (tco+e: SE(( to go to the AAP ictionary 'nitial Screen.

Step ':  >hoose atabase table and type Y XX %8P in the space provided (replacing XX  withyour 13digit id. hen clic+ the >reate button.

8arch 1229Page 1

Page 3: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 3/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Note:  he name o" the table in the AAP ictionary does not have to be the same as the nameo" the corresponding entity type in the data model. 5owever# in many cases# "or clarity’s sa+e# itmay be logical to ma+e them the same. 5ere# we are naming them the same.

Step 3:  he table de"inition screen appears. egin by entering some o" the table’s generalattributes- short te$t# elivery >lass# and whether or not table maintenance is allowed. %nter >"or the elivery >lass# and clic+ on the ab.8aint.Allowed "ield.

Question 1:  *hat is the primary "unction o" the elivery >lass attribute? *hat does a value o" @>’ in this "ield indicate?

Hint:  urning on the ab.8aint.Allowed attribute permits the table’s data to be edited by S%:#S%::# ideally you should turn o"" ab.8aint.Allowed and create a able 8aintenance =enerator"or the table (See appendi$ to +now about able 8aintenance =enerator to maintain entries

through SAP able 8aintenance ransactions such as S8B2 and S8B:.

8arch 1229Page B

"hoose Data%aseTa%le an+ type

 ),,E*P in thespace provi+e+.Then clic- the"reate %tton.

Page 4: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 4/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

8arch 1229Page C

(. Enter a short +escription orthe ta%le.'. Then0 enter 1"2 the Delivery"lass.3. inally0 selectDisplay/*aintenance Alloe+

Page 5: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 5/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Step 4:  De$t# enter the name o" the "irst "ield in the table. his will be the %mployee ' Dumber.>all this "ield %8PE'. Since this "ield is part o" the primary +ey o" this table (in "act# it is theonly  "ield in the primary +ey o" this table# clic+ on the Fey attribute.

 

Hint:  epending on your monitor and depending on the "ont you have selected in SAP# you maynot see very many "ields in the "ield de"inition area.

Hint:  Dotice that names o" customer3created fields do not have to begin with a Y or a Z. ;ieldsonly have meaning within the particular table "or which they are de"ined# and they are notindividual objects within the AAP ictionary. Dames o" customer3created tables# data elements#and domains# however# must begin with a Y or a Z. ables# data elements# and domains e$ist asindividual objects within the AAP ictionary.

Step 5:  De$t# enter the data element "or this "ield. 'n this case# use a new data element calledY XX %8PE'. 7nce you have entered the data element name# double3clic+ on the name o" thedata element.

 

Step 6:  ouble3clic+ing on the name o" the data element brings up the >reate ata %lement

dialog bo$. >lic+ the green chec+ mar+ to indicate that you wish to continue creating the dataelement.

Step 7:  De$t# you see the data element de"inition tab. %nter a short te$t. his will appearbeside the name o" the "ield on the table de"inition screen. hen# enter Y XX %8P' as thedomain name.

8arch 1229Page 9

Enter the irst iel+ name E*P89D.Then clic- on the #ey attri%te.

Enter the name o the +ataelement ) XX E*P9D. Then+o%le;clic- on the name othe +ata element

Page 6: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 6/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

 

Step <:  De$t# enter the "ield labels in the ;ield label tab. hese are the labels that will appear

on end3user screens when "ields are /painted0 onto those screens "rom the dictionary. ;ill inshort# medium and long "ield labels. 't is also advisable to "ill in a /header0 label (which is used i" the "ield is painted into something +nown as a /table control0.

8arch 1229Page

(. Enter a short+escription.

'. Then0 enter ) XX E*P9D asthe +omain name

Page 7: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 7/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

 

Step =:  De$t# double3clic+ on the name o" the domain that you entered in Step G. >lic+ thegreen chec+ mar+ in the >reate omain dialog bo$ that appears.

Step (>:  %nter a short te$t# and a data type and length "or the domain. You may see the variousdata types available by hitting ;C in the ata type "ield. ;or this domain# use type >5AH andlength :2.

8arch 1229Page G

Enter iel+s2 la%els:short0 me+im0an+ lon0 an+ ahea+er la%el

Page 8: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 8/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

 

Step ((:  Dow you are ready to activate your domain. >lic+ the activation symbol on theapplication toolbar. You will be prompted to enter a pac+age and a change re4uest. A"ter thedomain is activated# you will see a message at the bottom o" the screen# and the status o" thedomain change to /Active0 and /Saved0.

8arch 1229Page I

Enter a shorttext0 +ata type0an+ a iel+lenth

Page 9: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 9/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

 

Hint:  AAP ictionary 7bjects must be activated be"ore they are visible to other objects in thesystem. A"ter you ma+e changes to a dictionary object# you must re3activate it. A commonmista+e is to revise an object and then "orget to re3activate it.

Step (':  De$t# clic+ the green arrow to return to your data element. Dow that the domain hasbeen activated# you may activate the data element. >lic+ the activation symbol. %nter yourpac+age J change re4uest when prompted. You should see a message at the bottom o" thescreen saying that the data element was activated# and the status will change to /Active0 and/Saved0.

Step (3: >lic+ the green arrow to return to the table de"inition screen.

Hint:  '" you are unable to complete your wor+ on a table in one sitting# save the table withoutactivating it (ma+e sure you are on the table de"inition screen. o return to the table later# go toyour pac+age. rill down through ictionary objects# and then ables# until you see the name o"your table. ouble3clic+ on the table name. his will bring you bac+ to the table de"inition screen.%nter change mode by clic+ing the isplayK3<>hange button on the toolbar. o add new "ields tothe table# clic+ the @Dew rows’ button. You may need to reduce the siLe o" your "ont in order "orthe "ield display to wor+ appropriately.

8arch 1229Page M

Ater enterin aPac-ae ? a

chane re@est0the stats o the

+omain illchane.

"lic- the activationsym%ol

Page 10: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 10/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

 

8arch 1229Page :2

Display ; "hane%tton

To a++ ne iel+s tothe ta%le clic- the1!e ros 1%tton.

Page 11: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 11/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Step (4: >omplete the de"inition "or table Y XX %8P by entering the "ollowing "ields# dataelements# and domains. You will create your own data elements "or each "ield. ;or some "ields#you will use pre3de"ined domains# and "or other "ields# you will create your own domains.

iel+ !ame Data Element Domain Type Centh

&ASEDA8% Y XX &DA8% >5AH19 pre3de"ined pre3de"ined;'HSEDA8% Y XX ;DA8% >5AH19 pre3de"ined pre3de"ined5&5EP&AD Y XX 5&5P&D Y XX 5&5P&D DN8> C

Note:  he 5&5EP&AD "ield is to contain the ' o" the health plan the employee has selected.his "ield will eventually point to the Y XX 5%A&5 table.

Note:  'n reality# this table would contain more "ields than this. o save time# you are onlycreating these three "ields.

Step (5: >lic+ the activation symbol. %nter your Pac+age and >hange re4uest when prompted.

8arch 1229Page ::

Page 12: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 12/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Step (6: he 8aintain echnical Settings screen will appear. %nter @NS%H’ as the data classand @2’ as the siLe category. Save the technical settings and clic+ the green arrow. You willreturn to the table de"inition screen# and the table’s status will change to /Active0 and /Saved0. 

8arch 1229Page :1

Secon+0 clic- the save icon.Then0 clic- the reen arro.

irst0 enter the +ataclass an+ sie cateory.

Page 13: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 13/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Question 2:  *hat does the data class control? *hat does a value o" @NS%H’ indicate?

Question 3:  *hat does the siLe category control? 'n this case# what does a value o" @2’represent?

Step (7: ;rom the table de"inition screen# clic+ the green arrow to return to the AAPictionary- 'nitial Screen.

Exercise '.' "reate A++itional Ta%les

>reate the Y XX 5%A&5# Y XX 57NH&Y# Y XX SA&AH'%# and Y XX PAHD%H tables. Nse the"ollowing "ields# data elements# and domains. he YOO57NH&Y# YOOSA&AH'%# andYOOPAHD%H tables will each have one entry "or every employee assigned to that particulartype o" earnings. %ach employee must belong to one and only one type o" earnings table. heYOO5%A&5 table has one entry "or each type o" health plan to which the employees could

belong.

9mportant !ote: As o SAP Release 4.6"0 yo may not have a ta%le an+ a +ata elementith the same name.

 ) XX EACT

iel+ !ame #ey

Data Element Domain Type Centh

P&ADE' O Y XX 5&5P&D Y XX 5&5P&D DN8> C%S>H Y XX %S>H Y XX %S>H >5AH I2

 ADDEPH%8 Y XX  ADDPH%8 Y XX  ADDPH%8 %>

P&ADE' is the health plan '.

%S>H is a description o" the health plan. ADDEPH%8 is the annual premium "or belonging to this health plan.

 ) XX $FRC)

iel+ !ame #ey Data Element Domain Type Centh

%8PE' O Y XX %8P' Y XX %8P' >5AH :257NHEHA% Y XX 57NHHA Y XX 57NHHA DN8> C

Even thoh type "FRR ol+ %e more appropriate or $FRC)8RAT0 the system ill nota+minister a chec- on the ixe+ vales that yo ill create in tre exercises. )o illlearn ho to perorm necessary chec-s prorammatically in the next mo+le.%8PE' is the employee '.57NHEHA% is the hourly rate the employee is paid.

 ) XX SACAR9ED

iel+ !ame #ey

Data Element Domain Type Centh

%8PE' O Y XX %8P' Y XX %8P' >5AH :2SA&AHY Y XX SA&AHY Y XX SA&AHY %> I

%8PE' is the employee '.SA&AHY is the annual salary the employee is paid.

8arch 1229Page :B

Page 14: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 14/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

 ) XX PART!ER

iel+ !ame #ey

Data Element Domain Type Centh

%8PE' O Y XX %8P' Y XX %8P' >5AH :2DN8ES5AH%S Y XX DN8S5AH %>G pre3de"ined pre3de"ined

%8PE' is the employee '.DN8ES5AH%S is the number o" shares the partner owns.

Exercise '.3 Explicitly Cimit Gales or Domains

alid values "or domains can be restricted two ways- by e$plicitly listing (/hard3coding0 "i$edvalues in the domain itsel"# and by speci"ying a value table.

5ourly employees are always paid between Q9.22 and QB9.22 per hour. %$plicitly list this

restriction in the domain "or the hourly rate.

Step (: ;rom SAP 'nitial Screen 3< =o to ools 3< AAP *or+bench 3< evelopment 3< AAPictionary (tcode- S%:: to go to the AAP ictionary 'nitial Screen.

Step ':  >hoose omain and type Y XX 57NHHA in the space provided (replacing XX  with your13digit id.

Step 3: hen clic+ the >hange button.

Step 4:  =o to the @alue range’ tab.

Step 5:  %nter 9 as the lower limit and B9 as the upper limit. %nter a short te$t describing thelimit.

Step 6: >lic+ the Save icon to save your changes. hen clic+ the green arrow to return to theprimary domain de"inition screen.

Step 7: >lic+ the activation symbol to re3activate your domain.

Exercise '.4 Cimit a Domain2s Gales %y Fsin a Gale Ta%le

8arch 1229Page :C

Page 15: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 15/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

he only valid employee '’s are the ones contains in the Y XX %8P table. >hange theY XX %8P' domain so that the value table is listed as Y XX %8P.

Step (:  Proceed to the de"inition screen "or domain Y XX %8P'. %nter change mode.

Step ':  %nter Y XX %8P as the value table in the space provided (about hal"way down thescreen.

Step 3:  He3activate your domain.

Similarly# the only valid health plan '’s are those that are listed in the Y XX 5%A&5 table.

Step 4:  8odi"y domain Y XX 5&5P&D so that the value table is Y XX 5%A&5. He3activate thedomain when you are "inished.

"hapter 3 Exercises

'n the previous e$ercises# you established the basic objects to be used "or a simpli"ied payrollprocessing system. 'n addition to establishing the tables# data elements# and domains# you alsoestablished value tables "or certain domains in order to ensure data integrity within the system.Dow you will ta+e this a step "urther by establishing appropriate "oreign +eys in the AAP

ictionary.

Exercise 3.( Esta%lish a orein #ey Relationship %eteen the ) XX E*Pan+ the ) XX $FRC) Ta%les

Step (: Proceed to the dictionary de"inition o" the Y XX 57NH&Y table. %nter change mode.

Step ':  %stablish a "oreign +ey relationship to the Y XX %8P table on the %8PE' "ield. e sureto speci"y the appropriate cardinality and "oreign +ey "ield type

Step 3:  *hen you are "inished# re3activate the Y XX 57NH&Y table.

8arch 1229Page :9

Page 16: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 16/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Exercise 3.' Esta%lish orein #ey Relationships rom Ta%les ) XX SACAR)0 ) XX PART!ER0 an+ ) XX E*P

Step (: %stablish the "ollowing "oreign +ey relationships-

rom: To:Ta%le iel+ Ta%le iel+

Y XX SA&AH'% %8PE' Y XX %8P %8PE'Y XX PAHD%H %8PE' Y XX %8P %8PE'Y XX %8P 5&5EP&AD Y XX 5%A&5 P&ADE'

"hapter 4 Exercises

he purpose o" these e$ercises is to give you "amiliarity with manipulating e$isting tables# theirstructures# and their data.

Exercise 4.( Fse o the Ta%le "opy "apa%ility.

7"ten times you must create a table and there is already a similar table on the database. So whyreinvent the wheel? 'n the AAP *or+bench you can create a table then copy the elements o"another table into your new table. Additionally it is possible to copy complete tables and thenadd "ields.

Step (: ;rom SAP 'nitial Screen 3< =o to ools 3< AAP *or+bench 3< evelopment 3< AAPictionary (tcode- S%:: to go to the AAP ictionary 'nitial Screen.

Step ':  >hoose atabase table and type Y XX %8P in the space provided (replacing XX  withyour 13digit id.

Step 3:  >lic+ the >opy icon on the application toolbar. 'n the dialog bo$ that appears# enterY XX %8PE>P as the new  table name. hen clic+ the green chec+ mar+.

Step 4:  %nter your pac+age and change re4uest when prompted.

Step 5:  =o to S%:: again and open the newly created table Y XX %8PE>P and activate it.

Question 1:  o what pac+age does the SAP standard table FNDDH belongs?

8arch 1229Page :

Page 17: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 17/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Exercise 4.' "reatin 9n+exes

Step (:  'n the employee table (Y XX %8P# there is o"ten a need to access records by employeename. o improve the e""iciency o" this process# create a secondary inde$ on the last name and"irst name "ields. (>reate one inde$ @DA8’ that sort by last name# then by "irst name.

Exercise 4.3 A++in Data to )or Ta%le

;rom SAP 'nitial Screen go to Tools ;; ABAP Hor-%ench ;; $vervie ;; Data Broser  (transaction S%: to add records to your health plan and employee tables.

Step (:  >reate two "ictitious health plans. =ive them '’s# names (descriptions# and annualpremiums.

Step ':  >reate three "ictitious employees. 8a+e one a partner# one a salaried employee# and

one an hourly employee. =ive each one o" them# appropriate pay in"ormation. (You will need toaccess "our tables- Y XX %8P# Y XX PAHD%H# Y XX SA&AH'%# and Y XX 57NH&Y.

Note:  't is also possible to add entries to a table by accessing the table through your pac+age.=o into the AAP ictionary- >hange ableRStructure ;ields screen and choose menu optionFtilities Ta%le contents "reate Entries.

8arch 1229Page :G

Page 18: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 18/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

"hapter 5 Exercises

he e$ercises "or this chapter will "amiliariLe you with creating and using structures (tables o"type 'DA in SAP.

Exercise 5.( "reate an A++ress Strctre

Your employee table# Y XX %8P# does not yet contain in"ormation about employee’s addresses.ecause address in"ormation is li+ely to be stored in several tables ("or e$ample# in customerand vendor tables as well as the employee table# you will create a structure to provide theappropriate "ield de"inition. hat structure can then be included into the employee table# as wellas into any other tables where it may be needed in the "uture.

Step (:  >reate the structure Y XX  AH. ('n S%:: select radio button @ata ype’ and select@Structure’ in the popup that appears.

 ) XX ADDR

iel+ !ame Data Element Domain Type Centh

 AH: Y XX  AH: >5AH92 Pre3de"ined Pre3de"ined AH1 Y XX  AH1 >5AH92 Pre3de"ined Pre3de"ined>'Y Y XX >'Y >5AH92 Pre3de"ined Pre3de"inedH%='7D Y XX %='7D >5AH:2 Pre3de"ined Pre3de"inedP7SE>7% Y XX P7S> >5AH:9 Pre3de"ined Pre3de"ined>7NDHY &AD:E=P Pre3de"ined Pre3de"ined Pre3de"ined

 AH: is the "irst line o" the address. AH1 is the second line o" the address.

>'Y is the city.H%='7D is the province or state.P7SE>7% is the postal code.>7NDHY is the country.

Step ':  Activate the structure

Step 3:  'nclude the structure Y XX  AH in the table Y XX %8P. o not "orget to re3activate tableY XX %8P.

Exercise 5.' A++ Data to ) XX E*P Fsin the Strctre

Step (:  =o to transaction S%:.

Step ': %nter Y XX %8P as the table name and clic+ the isplay push button on the toolbar.

Step 3:  A selection screen appears. >lic+ the %$ecute push button on the toolbar (or hit ;Iwithout  entering any selection criteria.

Step 4:  >hoose one o" your entries# and then clic+ the >hange push button on the toolbar.

8arch 1229Page :I

Page 19: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 19/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Step 5:  Dotice that you now have additional "ields to enter the employee’s address. %nter anaddress# and then save your wor+.

"hapter 6 Exercises

he purpose o" these e$ercises is to give you e$perience using the AAP Hepository 'n"ormationSystem. his "acility can provide a great deal o" in"ormation on objects created and maintainedwithin SAP.

Exercise 6.( Researchin the Fniversity Data *o+el

SAP provides a sample data model called the Nniversity 8odel. >orresponding dictionaryobjects have also been created by SAP "or this data model.

Step (:  >reate and print a list o" all tables in the university model. ables in this data model allhave names beginning with the letter N. heir delivery class is A.

Step ':  >hoose one table "rom the result list "or Step :. ;or that table# "ind the list o" all "ields#domains# and data elements used in that table.

Exercise 6.' *iscellaneos Ieries

: Search "or all ta%les beginning with the string FDA.1 isplay "ield list "or ta%le FDA:.B isplay only FDA: iel+s with the string >ustomer in the short description.C isplay all iel+s in tables beginning with FDA# with >5AH data types# lengths less than 12#and >ustomer in the short description.

9 isplay all ta%les that uses the chec+ table NP%HS. isplay all search helps that begin with 8.G ;ind a DN8> +omain o" "ield length C# where the output length is di""erent than the "ieldlength.I ;ind all +ata elements that use domain DN8>C.

8arch 1229Page :M

Page 20: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 20/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Exercise 6.3 in+in Ta%les that are relate+ to $ne Another 

Step (:  'n the customer master tables the country +ey is +ept in table FDA:. ;ind the tablewhere the country descriptionRname is +ept (e.g.# "or country +ey NS 33< Nnited States.

Note:  his e$ercise is especially similar to the type o" research you may be re4uired to do on aproject.

Hints: : >oncentrate on the "oreign +ey relationship.1 Helated tables are o"ten named with the same base pre"i$ and a di""erent su""i$ (i.e.OOO# OOOA# OOO would all be related te$t tables.

8arch 1229Page 12

Page 21: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 21/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

"hapter 7 Exercises

Exercise 7.( "hanin a Dictionary Strctre

Step (:  Shorten the >ity "ield in your Y XX  AH structure. o do this# navigate to the Y XX >'Ydata element. >hange the domain "rom >5AH92 to >5AH2.

Step ':  He3activate the Y XX >'Y data element. You may get a warning about the length o" theheader label. '" so# hit %nter to navigate past this warning.

Step 3: De$t you will see a warning that dependent tables may need to be converted. >lic+>ontinue.

Step 4:  De$t you will see a log o" messages "rom the atabase Ntility. hese messages will tellyou that it was possible to success"ully alterRadjust the Y XX  AH structure and the Y XX %8Ptable.

Exercise 7.' "hanin a Ta%le Type

Step (:  >hange the type o" your table Y XX %8PE>P "rom ransparent to Structure. You may dothis by selecting Extras -> Change table category "rom the menu in the table de"inition screen(you must be in change mode. o not "orget to re3activate the object.

Exercise 7.3 *aintainin Gersions

>hoose one o" your transparent tables and maintain various versions o" the object. He"er to

>hapter I in your manual "or additional guidance. Hemember that only temporary versions o"active objects can be stored. here"ore# in order to have di""erent temporary versions# you willneed to : store a temporary version o" your active object# 1 change that active object andreactivate it# B then store another temporary version.

8arch 1229Page 1:

Page 22: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 22/25

Page 23: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 23/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

Exercise <.' "hanin a Gie

Step (: he view is now to include course descriptions as well as course titles. You will need toadd table NFHS to your view. he course descriptions in table NFHS are language-de!endent . %stablish selection criteria "or the view so that course descriptions are limited toeither =erman or %nglish (choose one.

Note:  >ourse titles# as well as "aculty titles# are not language3dependent# and they only exist in"erman#  >ourse descri!tions# however# are in the database in both =erman and %nglish. Youmust choose which language you would li+e to use in your view.

8arch 1229Page 1B

Page 24: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 24/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

"hapter = Exercises

Exercise =.( "reatin Search elp

&et’s assume your employee table is used in a transaction. 8ore than li+ely# you will need toenter the employee ' number rather than the employee name on a screen. You want to providethe user with the ability to search "or the appropriate employee ' based on the employee name.esign a search help to attach to the employee ' "ield.

Step (:  >reate an elementary search help using the wor+bench. Dame your search helpY XX  ES%AH>5E5%&P. he selection method should be your employee table (Y XX %8P.

Step ': 'ndicate the dialog type setting that will create a comple$ dialog where you can narrowyour search.

Step 3:  Select the appropriate "ields so that your search help will return the employee ' basedon the speci"ied employee last or "irst name.

Step 4:  &ist the %mployee ' and "ull name on this hit list.

Step 5: o not have %mployee ' appear on the comple$ dialog.

Step 6: Activate the search help.

Step 7: Attach the search help to your employee ' "ield in the Y XX %8P table.

Step <:  est your search help using the "ollowing method-

Execte the Ta%le.=o to S%:. =ive the name o" the table YOO%8P and clic+ on the table contents push button

 in the application toolbar. he Selection screen appears. Place the cursor on %mployee '"ield and hit the ;C "unction +ey.

IFEST9$!: 5ow would you design a search help to retrieve an employee ' only i" theemployee is salaried? 

8arch 1229Page 1C

Page 25: 124254545 13 ABAP Data Dictionary Exercises

8/9/2019 124254545 13 ABAP Data Dictionary Exercises

http://slidepdf.com/reader/full/124254545-13-abap-data-dictionary-exercises 25/25

SAP R/3 Release 4.7Exercises: The ABAP Dictionary SAP Development ABAP Trainin

"hapter (> Exercises

Exercise (>.( "reate Data Element Docmentation

You will add documentation to your tables Y XX %8P and Y XX 5%A&5. Pic+ a "ield "rom eachtable. (%.g. %8PE' "rom YOO%8P and P&ADE' "rom Y XX 5%A&5

Step (: 8aintain the documentation "or the data elements. (%.g. YOO%8P' and YOO5&5P&D

Step ': 8aintain supplemental documentation "or the data element. ;ollow instructions in>hapter :: o" your manual to create data element supplemental documentation.

Exercise (>.' "reate a Type Jrop

Step (:  >reate a ype =roup YY XX  in the AAP ictionary# which contains the "ields shownbelow. his type group will be used later in the e$ercises "or the programming portion o" thecourse.

ype =roup ;ield Dame ype &engthYYOO YYOOEPA>FG P G

YYOOEPA>FM P M (ecimals T 1

8arch 1229