Abap Data Dictionary Exercises 1

download Abap Data Dictionary Exercises 1

of 25

Transcript of Abap Data Dictionary Exercises 1

  • 7/23/2019 Abap Data Dictionary Exercises 1

    1/25

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

    Naming Conventions

    SAP has agreed to never create development objects whose names begin with a Y or a Z. SAPcustomers (thats you!) must give all objects that theycreate names that do begin with a Y or aZ. This prevents the possibility of naming conflicts during an upgrade from one release of SAPto another.

    Also, in the following exercises you will see suggested object names. Each suggested objectname will containXXorZZ. To ensure that objects you create have different names from objectsthat your classmates create, replace theXXorZZthat you will see in the suggested objectnames with the last two digits of your SAP Logon ID.[When you are in a situation, where a dictionary object of your selected name already exists inthe system, then ask the instructor if you can delete the existing one, otherwise ask him tosuggest a new name for yours.]

    In short: Begin all object names with a Y or a Z, and replace theXXorZZwith the last two digitsof your SAP logon ID.

    Developer Access Keys vs. Object Access Keys

    The first time you try to create an object in SAP, the system will respond with a dialog box thatsays, You are not a registered developer. The dialog box will prompt you for a 20-digitDeveloper Access Key. The request for a developer access key will only appear once. Afteryou enter the key correctly, you will not be prompted for it again.

    However, if you try to change an SAP-delivered object (or if you forget to name yourobjectbeginning with a Y or a Z), you will be prompted for an Object Access Key. This is because

    SAP registers and controls all customer changes to SAP-delivered objects. If you see this dialogbox during this course, you have made a mistake; click the cancel button in the dialog box.

    It is easy to confuse a request for a developer access key with a request for an object accesskey. One way to remember the difference is to remember the phrase, You are not a registereddeveloper. If the request contains this phrase, it is asking for a developer access key. If it doesnot contain this phrase, it is asking for an object access key.

    Chapter 2 Exercises

    March 2005Page 1

  • 7/23/2019 Abap Data Dictionary Exercises 1

    2/25

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

    The exercises for this chapter will teach you how to create and manipulate the basic objects ofthe ABAP Dictionary: tables, data elements, and domains. You will also enter data into one ofyour tables, and you will learn how to write a simple program that extracts data from an ABAPDictionary table.

    If you require assistance at any point, please ask an instructor. Try to do the solutions for theexercises yourself and if you find any difficulty consult the hands on instructor. Also, solutionsare provided in this book, but only refer to them as a last resort.

    Exercise 2.1 Create the YXXEMP table.

    This table will store basic information for all employees. All employees will have one entry inthis table.

    Step 1: From SAP Initial Screen -> Go to Tools -> ABAP Workbench -> Development -> ABAPDictionary (tcode: SE11) to go to the ABAP Dictionary Initial Screen.

    Step 2: Choose Database table and type YXXEMP in the space provided (replacingXXwithyour 2-digit id). Then click the Create button.

    March 2005Page 2

  • 7/23/2019 Abap Data Dictionary Exercises 1

    3/25

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

    Note: The name of the table in the ABAP Dictionary does not have to be the same as the nameof the corresponding entity type in the data model. However, in many cases, for claritys sake, itmay be logical to make them the same. Here, we are naming them the same.

    Step 3: The table definition screen appears. Begin by entering some of the tables generalattributes: short text, Delivery Class, and whether or not table maintenance is allowed. Enter Cfor the Delivery Class, and click on the Tab.Maint.Allowed field.

    Question 1: What is the primary function of the Delivery Class attribute? What does a value ofC in this field indicate?

    Hint: Turning on the Tab.Maint.Allowed attribute permits the tables data to be edited by SE16,SE11, ideally you should turn off Tab.Maint.Allowed and create a Table Maintenance Generatorfor the table (See appendix to know about Table Maintenance Generator) to maintain entries

    through SAP Table Maintenance Transactions such as SM30 and SM31.

    March 2005Page 3

    Choose DatabaseTable and type

    YXXEMP in thespace provided.Then click theCreate button.

  • 7/23/2019 Abap Data Dictionary Exercises 1

    4/25

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

    March 2005Page 4

    1. Enter a short description forthe table.2. Then, enter C the DeliveryClass.3. Finally, selectDisplay/Maintenance Allowed

  • 7/23/2019 Abap Data Dictionary Exercises 1

    5/25

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

    Step 4: Next, enter the name of the first field in the table. This will be the Employee ID Number.Call this field EMP_ID. Since this field is part of the primary key of this table (in fact, it is theonlyfield in the primary key of this table), click on the Key attribute.

    Hint: Depending on your monitor and depending on the font you have selected in SAP, you maynot see very many fields in the field definition area.

    Hint: Notice that names of customer-created fields do not have to begin with a Y or a Z. Fieldsonly have meaning within the particular table for which they are defined, and they are notindividual objects within the ABAP Dictionary. Names of customer-created tables, data elements,and domains, however, must begin with a Y or a Z. Tables, data elements, and domains exist asindividual objects within the ABAP Dictionary.

    Step 5: Next, enter the data element for this field. In this case, use a new data element calledYXXEMP_ID. Once you have entered the data element name, double-click on the name of thedata element.

    Step 6: Double-clicking on the name of the data element brings up the Create Data Element

    dialog box. Click the green check mark to indicate that you wish to continue creating the dataelement.

    Step 7: Next, you see the data element definition tab. Enter a short text. This will appearbeside the name of the field on the table definition screen. Then, enter YXXEMPID as thedomain name.

    March 2005Page 5

    Enter the first field name (EMP_ID).Then click on the Key attribute.

    Enter the name of the dataelement (YXXEMPID). Thendouble-click on the name ofthe data element

  • 7/23/2019 Abap Data Dictionary Exercises 1

    6/25

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

    Step 8: Next, enter the field labels in the Field label tab. These are the labels that will appearon end-user screens when fields are painted onto those screens from the dictionary. Fill inshort, medium and long field labels. It is also advisable to fill in a header label (which is used ifthe field is painted into something known as a table control).

    March 2005Page 6

    1. Enter a shortdescription.

    2. Then, enterYXXEMPID asthe domain name

  • 7/23/2019 Abap Data Dictionary Exercises 1

    7/25

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

    Step 9: Next, double-click on the name of the domain that you entered in Step 7. Click thegreen check mark in the Create Domain dialog box that appears.

    Step 10: Enter a short text, and a data type and length for the domain. You may see the variousdata types available by hitting F4 in the Data type field. For this domain, use type CHAR and

    length 10.

    March 2005Page 7

    Enter fieldslabels: short,medium, and long,and a header label

  • 7/23/2019 Abap Data Dictionary Exercises 1

    8/25

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

    Step 11: Now you are ready to activate your domain. Click the activation symbol on theapplication toolbar. You will be prompted to enter a package and a change request. After thedomain is activated, you will see a message at the bottom of the screen, and the status of thedomain change to Active and Saved.

    March 2005Page 8

    Enter a shorttext, data type,and a fieldlength

  • 7/23/2019 Abap Data Dictionary Exercises 1

    9/25

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

    Hint: ABAP Dictionary Objects must be activated before they are visible to other objects in thesystem. After you make changes to a dictionary object, you must re-activate it. A commonmistake is to revise an object and then forget to re-activate it.

    Step 12: Next, click the green arrow to return to your data element. Now that the domain hasbeen activated, you may activate the data element. Click the activation symbol. Enter yourpackage & change request when prompted. You should see a message at the bottom of thescreen saying that the data element was activated, and the status will change to Active andSaved.

    Step 13: Click the green arrow to return to the table definition screen.

    Hint: If you are unable to complete your work on a table in one sitting, save the table withoutactivating it (make sure you are on the table definition screen). To return to the table later, go toyour package. Drill down through Dictionary objects, and then Tables, until you see the name ofyour table. Double-click on the table name. This will bring you back to the table definition screen.Enter change mode by clicking the DisplayChange button on the toolbar. To add new fields tothe table, click the New rows button. You may need to reduce the size of your font in order forthe field display to work appropriately.

    March 2005Page 9

    After entering aPackage & a

    change request,the status of the

    domain willchange.

    Click the activationsymbol

  • 7/23/2019 Abap Data Dictionary Exercises 1

    10/25

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

    March 2005Page 10

    Display Changebutton

    To add new fields tothe table click theNew rows button.

  • 7/23/2019 Abap Data Dictionary Exercises 1

    11/25

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

    Step 14: Complete the definition for table YXXEMP by entering the following fields, dataelements, and domains. You will create your own data elements for each field. For some fields,you will use pre-defined domains, and for other fields, you will create your own domains.

    Field Name Data Element Domain Type Length

    LAST_NAME YXXLNAME CHAR25 pre-defined pre-definedFIRST_NAME YXXFNAME CHAR25 pre-defined pre-definedHLTH_PLAN YXXHLTHPLN YXXHLTHPLN NUMC 4

    Note: The HLTH_PLAN field is to contain the ID of the health plan the employee has selected.This field will eventually point to the YXXHEALTH table.

    Note:In reality, this table would contain more fields than this. To save time, you are onlycreating these three fields.

    Step 15: Click the activation symbol. Enter your Package and Change request when prompted.

    March 2005Page 11

  • 7/23/2019 Abap Data Dictionary Exercises 1

    12/25

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

    Step 16: The Maintain Technical Settings screen will appear. Enter USER as the data classand 0 as the size category. Save the technical settings and click the green arrow. You willreturn to the table definition screen, and the tables status will change to Active and Saved.

    March 2005Page 12

    Second, click the save icon.Then, click the green arrow.

    First, enter the dataclass and size category.

  • 7/23/2019 Abap Data Dictionary Exercises 1

    13/25

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

    Question 2: What does the data class control? What does a value of USER indicate?

    Question 3: What does the size category control? In this case, what does a value of 0represent?

    Step 17: From the table definition screen, click the green arrow to return to the ABAPDictionary: Initial Screen.

    Exercise 2.2 Create Additional Tables

    Create the YXXHEALTH, YXXHOURLY, YXXSALARIED, and YXXPARTNER tables. Use thefollowing fields, data elements, and domains. The YXXHOURLY, YXXSALARIED, andYXXPARTNER tables will each have one entry for every employee assigned to that particulartype of earnings. Each employee must belong to one and only one type of earnings table. TheYXXHEALTH table has one entry for each type of health plan to which the employees could

    belong.

    Important Note: As of SAP Release 4.6C, you may nothave a table and a data elementwith the same name.

    YXXHEALTH

    Field Name Key

    Data Element Domain Type Length

    PLAN_ID X YXXHLTHPLN YXXHLTHPLN NUMC 4DESCR YXXDESCR YXXDESCR CHAR 80

    ANN_PREM YXXANNPREM YXXANNPREM DEC 6

    PLAN_ID is the health plan ID.

    DESCR is a description of the health plan.ANN_PREM is the annual premium for belonging to this health plan.

    YXXHOURLY

    Field Name Key Data Element Domain Type Length

    EMP_ID X YXXEMPID YXXEMPID CHAR 10HOUR_RATE YXXHOURRAT YXXHOURRAT NUMC 4

    Even though type CURR would be more appropriate for HOURLY_RAT, the system willnot administer a check on the fixed values that you will create in future exercises. Youwill learn how to perform necessary checks programmatically in the next module.EMP_ID is the employee ID.HOUR_RATE is the hourly rate the employee is paid.

    YXXSALARIED

    Field Name Key

    Data Element Domain Type Length

    EMP_ID X YXXEMPID YXXEMPID CHAR 10SALARY YXXSALARY YXXSALARY DEC 8

    EMP_ID is the employee ID.SALARY is the annual salary the employee is paid.

    March 2005Page 13

  • 7/23/2019 Abap Data Dictionary Exercises 1

    14/25

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

    YXXPARTNER

    Field Name Key

    Data Element Domain Type Length

    EMP_ID X YXXEMPID YXXEMPID CHAR 10NUM_SHARES YXXNUMSHAR DEC7 pre-defined pre-defined

    EMP_ID is the employee ID.NUM_SHARES is the number of shares the partner owns.

    Exercise 2.3 Explicitly Limit Values for Domains

    Valid values for domains can be restricted two ways: by explicitly listing (hard-coding) fixedvalues in the domain itself, and by specifying a value table.

    Hourly employees are always paid between $5.00 and $35.00 per hour. Explicitly list this

    restriction in the domain for the hourly rate.

    Step 1: From SAP Initial Screen -> Go to Tools -> ABAP Workbench -> Development -> ABAPDictionary (tcode: SE11) to go to the ABAP Dictionary Initial Screen.

    Step 2: Choose Domain and type YXXHOURRAT in the space provided (replacingXXwith your2-digit id).

    Step 3: Then click the Change button.

    Step 4: Go to the Value range tab.

    Step 5: Enter 5 as the lower limit and 35 as the upper limit. Enter a short text describing thelimit.

    Step 6: Click the Save icon to save your changes. Then click the green arrow to return to theprimary domain definition screen.

    Step 7: Click the activation symbol to re-activate your domain.

    Exercise 2.4 Limit a Domains Values by Using a Value Table

    March 2005Page 14

  • 7/23/2019 Abap Data Dictionary Exercises 1

    15/25

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

    The only valid employee IDs are the ones contains in the YXXEMP table. Change theYXXEMPID domain so that the value table is listed as YXXEMP.

    Step 1: Proceed to the definition screen for domain YXXEMPID. Enter change mode.

    Step 2: Enter YXXEMP as the value table in the space provided (about halfway down thescreen).

    Step 3: Re-activate your domain.

    Similarly, the only valid health plan IDs are those that are listed in the YXXHEALTH table.

    Step 4: Modify domain YXXHLTHPLN so that the value table is YXXHEALTH. Re-activate thedomain when you are finished.

    Chapter 3 Exercises

    In the previous exercises, you established the basic objects to be used for a simplified payrollprocessing system. In addition to establishing the tables, data elements, and domains, you alsoestablished value tables for certain domains in order to ensure data integrity within the system.Now you will take this a step further by establishing appropriate foreign keys in the ABAP

    Dictionary.

    Exercise 3.1 Establish a Foreign Key Relationship between the YXXEMPand the YXXHOURLY Tables

    Step 1: Proceed to the dictionary definition of the YXXHOURLY table. Enter change mode.

    Step 2: Establish a foreign key relationship to the YXXEMP table on the EMP_ID field. Be sureto specify the appropriate cardinality and foreign key field type

    Step 3: When you are finished, re-activate the YXXHOURLY table.

    March 2005Page 15

  • 7/23/2019 Abap Data Dictionary Exercises 1

    16/25

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

    Exercise 3.2 Establish Foreign Key Relationships from TablesYXXSALARY, YXXPARTNER, and YXXEMP

    Step 1: Establish the following foreign key relationships:

    From: To:Table Field Table Field

    YXXSALARIED EMP_ID YXXEMP EMP_IDYXXPARTNER EMP_ID YXXEMP EMP_IDYXXEMP HLTH_PLAN YXXHEALTH PLAN_ID

    Chapter 4 Exercises

    The purpose of these exercises is to give you familiarity with manipulating existing tables, theirstructures, and their data.

    Exercise 4.1 Use of the Table Copy Capability.

    Often times you must create a table and there is already a similar table on the database. So whyreinvent the wheel? In the ABAP Workbench you can create a table then copy the elements ofanother table into your new table. Additionally it is possible to copy complete tables and thenadd fields.

    Step 1: From SAP Initial Screen -> Go to Tools -> ABAP Workbench -> Development -> ABAPDictionary (tcode: SE11) to go to the ABAP Dictionary Initial Screen.

    Step 2: Choose Database table and type YXXEMP in the space provided (replacingXXwithyour 2-digit id).

    Step 3: Click the Copy icon on the application toolbar. In the dialog box that appears, enterYXXEMP_CP as the newtable name. Then click the green check mark.

    Step 4: Enter your package and change request when prompted.

    Step 5: Go to SE11 again and open the newly created table YXXEMP_CP and activate it.

    Question 1: To what package does the SAP standard table KUNNR belongs?

    March 2005Page 16

  • 7/23/2019 Abap Data Dictionary Exercises 1

    17/25

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

    Exercise 4.2 Creating Indexes

    Step 1: In the employee table (YXXEMP), there is often a need to access records by employeename. To improve the efficiency of this process, create a secondary index on the last name andfirst name fields. (Create one index NAM that sort by last name, then by first name.)

    Exercise 4.3 Adding Data to Your Table

    From SAP Initial Screen go to Tools --> ABAP Workbench --> Overview --> Data Browser(transaction SE16) to add records to your health plan and employee tables.

    Step 1: Create two fictitious health plans. Give them IDs, names (descriptions), and annualpremiums.

    Step 2: Create three fictitious employees. Make one a partner, one a salaried employee, and

    one an hourly employee. Give each one of them, appropriate pay information. (You will need toaccess four tables: YXXEMP, YXXPARTNER, YXXSALARIED, and YXXHOURLY.)

    Note: It is also possible to add entries to a table by accessing the table through your package.Go into the ABAP Dictionary: Change Table/Structure Fields screen and choose menu optionUtilities Table contents Create Entries.

    March 2005Page 17

  • 7/23/2019 Abap Data Dictionary Exercises 1

    18/25

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

    Chapter 5 Exercises

    The exercises for this chapter will familiarize you with creating and using structures (tables oftype INTTAB) in SAP.

    Exercise 5.1 Create an Address Structure

    Your employee table, YXXEMP, does not yet contain information about employees addresses.Because address information is likely to be stored in several tables (for example, in customerand vendor tables as well as the employee table), you will create a structure to provide theappropriate field definition. That structure can then be included into the employee table, as wellas into any other tables where it may be needed in the future.

    Step 1: Create the structure YXXADDR. (In SE11 select radio button Data Type and select

    Structure in the popup that appears.

    YXXADDR

    Field Name Data Element Domain Type Length

    ADDR1 YXXADDR1 CHAR50 Pre-defined Pre-definedADDR2 YXXADDR2 CHAR50 Pre-defined Pre-definedCITY YXXCITY CHAR50 Pre-defined Pre-definedREGION YXXEGION CHAR10 Pre-defined Pre-definedPOST_CODE YXXPOSTCD CHAR15 Pre-defined Pre-definedCOUNTRY LAND1_GP Pre-defined Pre-defined Pre-defined

    ADDR1 is the first line of the address.ADDR2 is the second line of the address.

    CITY is the city.REGION is the province or state.POST_CODE is the postal code.COUNTRY is the country.

    Step 2: Activate the structure

    Step 3: Include the structure YXXADDR in the table YXXEMP. Do not forget to re-activatetable YXXEMP.

    Exercise 5.2 Add Data to YXXEMP Using the Structure

    Step 1: Go to transaction SE16.

    Step 2: Enter YXXEMP as the table name and click the Display push button on the toolbar.

    Step 3: A selection screen appears. Click the Execute push button on the toolbar (or hit F8)withoutentering any selection criteria.

    Step 4: Choose one of your entries, and then click the Change push button on the toolbar.

    March 2005Page 18

  • 7/23/2019 Abap Data Dictionary Exercises 1

    19/25

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

    Step 5: Notice that you now have additional fields to enter the employees address. Enter anaddress, and then save your work.

    Chapter 6 Exercises

    The purpose of these exercises is to give you experience using the ABAP Repository InformationSystem. This facility can provide a great deal of information on objects created and maintainedwithin SAP.

    Exercise 6.1 Researching the University Data Model

    SAP provides a sample data model called the University Model. Corresponding dictionaryobjects have also been created by SAP for this data model.

    Step 1: Create and print a list of all tables in the university model. Tables in this data model allhave names beginning with the letter U. Their delivery class is A.

    Step 2: Choose one table from the result list for Step 1. For that table, find the list of all fields,domains, and data elements used in that table.

    Exercise 6.2 Miscellaneous Queries

    1) Search for all tables beginning with the string KNA*.2) Display field list fortable KNA1.3) Display only KNA1 fields with the string *Customer* in the short description.4) Display all fields in tables beginning with KNA*, with CHAR data types, lengths less than 20,and *Customer* in the short description.

    5) Display all tables that uses the check table UPERS.6) Display all search helps that begin with M*.7) Find a NUMC domain of field length 4, where the output length is different than the fieldlength.8) Find all data elements that use domain NUMC4.

    March 2005Page 19

  • 7/23/2019 Abap Data Dictionary Exercises 1

    20/25

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

    Exercise 6.3 Finding Tables that are related to One Another

    Step 1: In the customer master tables the country key is kept in table KNA1. Find the tablewhere the country description/name is kept (e.g., for country key US --> United States).

    Note: This exercise is especially similar to the type of research you may be required to do on aproject.

    Hints:1) Concentrate on the foreign key relationship.2) Related tables are often named with the same base prefix and a different suffix (i.e.TXXX, TXXXA, TXXXB would all be related text tables).

    March 2005Page 20

  • 7/23/2019 Abap Data Dictionary Exercises 1

    21/25

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

    Chapter 7 Exercises

    Exercise 7.1 Changing a Dictionary Structure

    Step 1: Shorten the City field in your YXXADDR structure. To do this, navigate to the YXXCITYdata element. Change the domain from CHAR50 to CHAR60.

    Step 2: Re-activate the YXXCITY data element. You may get a warning about the length of theheader label. If so, hit Enter to navigate past this warning.

    Step 3: Next you will see a warning that dependent tables may need to be converted. ClickContinue.

    Step 4: Next you will see a log of messages from the Database Utility. These messages will tellyou that it was possible to successfully alter/adjust the YXXADDR structure and the YXXEMPtable.

    Exercise 7.2 Changing a Table Type

    Step 1: Change the type of your table YXXEMP_CP from Transparent to Structure. You maydo this by selecting Extras -> Change table category from the menu in the table definitionscreen (you must be in change mode). Do not forget to re-activate the object.

    Exercise 7.3 Maintaining Versions

    Choose one of your transparent tables and maintain various versions of the object. Refer to

    Chapter 8 in your manual for additional guidance. Remember that only temporary versions ofactive objects can be stored. Therefore, in order to have different temporary versions, you willneed to 1) store a temporary version of your active object, 2) change that active object andreactivate it, 3) then store another temporary version.

    March 2005Page 21

  • 7/23/2019 Abap Data Dictionary Exercises 1

    22/25

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

    Chapter 8 Exercises

    Exercise 8.1 Creating a View

    Hint: Follow the step-by-step instructions contained in the appendices in your manual as youcomplete this exercise.

    Step 1: Using the University Data Model, create a view that provides an overview of courses(identified by course number), the course titles, faculties that offer them (need both facultynumber and name), and the professors (identified by professor number) responsible for teachingthose courses. Define a view (YXXKU) that fulfills those requirements.

    Choose the type of view carefully. The requirement calls for multiple tables to be included in theview. Maintenance status is R for read-only. The tables you will need to use are UKURS andUFACH.

    Step 2: Using the data that exists in the tables, test your view via one of the following methods:

    Method 1: Use a simple ABAP program.Refer to Appendix on view.

    Method 2: Execute the View.

    Go to SE16. Give the name of the view and click on the table contents push button in theapplication toolbar.

    March 2005Page 22

  • 7/23/2019 Abap Data Dictionary Exercises 1

    23/25

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

    Exercise 8.2 Changing a View

    Step 1: The view is now to include course descriptions as well as course titles. You will need toadd table UKRSB to your view. The course descriptions in table UKRSB are language-dependent. Establish selection criteria for the view so that course descriptions are limited toeither German or English (choose one).

    Note: Course titles, as well as faculty titles, are not language-dependent, and they only exist inGerman. Course descriptions, however, are in the database in both German and English. Youmust choose which language you would like to use in your view.

    March 2005Page 23

  • 7/23/2019 Abap Data Dictionary Exercises 1

    24/25

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

    Chapter 9 Exercises

    Exercise 9.1 Creating Search Help

    Lets assume your employee table is used in a transaction. More than likely, you will need toenter the employee ID number rather than the employee name on a screen. You want to providethe user with the ability to search for the appropriate employee ID based on the employee name.Design a search help to attach to the employee ID field.

    Step 1: Create an elementary search help using the workbench. Name your search helpYXX_SEARCH_HELP. The selection method should be your employee table (YXXEMP).

    Step 2: Indicate the dialog type setting that will create a complex dialog where you can narrowyour search.

    Step 3: Select the appropriate fields so that your search help will return the employee ID basedon the specified employee last or first name.

    Step 4: List the Employee ID and full name on this hit list.

    Step 5: Do not have Employee ID appear on the complex dialog.

    Step 6:Activate the search help.

    Step 7:Attach the search help to your employee ID field in the YXXEMP table.

    Step 8: Test your search help using the following method:

    Execute the Table.Go to SE16. Give the name of the table YXXEMP and click on the table contents push button

    in the application toolbar. The Selection screen appears. Place the cursor on Employee IDfield and hit the F4 function key.

    QUESTION: How would you design a search help to retrieve an employee ID only if theemployee is salaried?

    March 2005Page 24

  • 7/23/2019 Abap Data Dictionary Exercises 1

    25/25

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

    Chapter 10 Exercises

    Exercise 10.1 Create Data Element Documentation

    You will add documentation to your tables YXXEMP and YXXHEALTH. Pick a field from eachtable. (E.g. EMP_ID from YXXEMP and PLAN_ID from YXXHEALTH)

    Step 1: Maintain the documentation for the data elements. (E.g. YXXEMPID and YXXHLTHPLN)

    Step 2: Maintain supplemental documentation for the data element. Follow instructions inChapter 11 of your manual to create data element supplemental documentation.

    Exercise 10.2 Create a Type Group

    Step 1: Create a Type Group YTYXXin the ABAP Dictionary, which contains the fields shownbelow. This type group will be used later in the exercises for the programming portion of thecourse.

    Type Group Field Name Type LengthYTYXX YTYXX_PACK7 P 7

    YTYXX_PACK9 P 9 (Decimals = 2)

    March 2005