Professional Documents
Culture Documents
Exercise
Chapter 2
ABAP Exercises
Introduction to ABAP
ABAP Exercises
Introduction to ABAP
ABAP Exercises
Introduction to ABAP
ABAP Exercises
NOTE: When you hit the save button, do not use your previous Change Request.
Instead, when the Change Request Query Screen appears, click on the Create Request
pushbutton, enter a short description, such as Introduction to ABAP Change Request for
<your name>, and save.
Write down the number of your change request here: ____________________________
Use the green arrow to go back to your new Development Class, and ensure that all your
programs in the Introduction to ABAP section of the course are stored in this
Development Class.
IMPORTANT NOTE: The following exercises will at first use the YCONCERT and
YMOVIE tables. These are not SAP standard tables, as you can tell by their names,
which begin with a Y. The ABAP team created these tables for exercise purposes.
These tables are not representative of the tables you will come across when doing
development work. Usually, you will have to research tables to find out about the
information they contain. You can do this by going into the ABAP Dictionary and
displaying the table of interest. (Or use transaction SE11). Then go to Utilities Table
Contents Display, and hit Execute (F8). The later exercises will use SAP standard
tables, so try doing this research with some of those tables.
Introduction to ABAP
ABAP Exercises
Objectives
After completing this exercise, you will be able to:
Navigate through the ABAP Workbench
Estimated time to complete this exercise: 60 minutes
Exercises
The following exercise provides practice working with the concepts learned in Chapters 1
and 2.
Exercise 1: Introduction
List five components of the Workbench NOT mentioned in Chapter 1.
Exercise 2
What is the type of program consisting of a collection of one or more screens?
What kind of programs creates lists? Name the two types of that kind of programs and
describe the differences between them.
Exercise 3
This exercise is to help you practice some of the tools mentioned in Chapter 2. Please
refer to Program YIN001 in Development Class YINTRODUCTION.
1. Navigation
Please keep in mind that youll find many different ways of accomplishing the
same task in the system. These exercises will enumerate but a few. Please do not
assume that the methods listed in these exercises are comprehensive. To get to the
program, go into the ABAP Editor. Two ways that you could do this are:
1. From the SAP Easy Access Screen, go to Tools ABAP Workbench
Overview Object Navigator, then type in the Development Class
and press Enter. Expand the program list, double-click on the program
name, and in the next screen, double-click on the folder with the
program name.
2. In the command field, call transaction SE38 (ABAP Editor), type in
the name of the program, and choose Display
Introduction to ABAP
ABAP Exercises
You should now be in display mode of the ABAP Editor. The Display<>Change
button
is used to switch between display and edit mode, but you should not
be able to edit this program since it was created on another system.
2. Copying programs
Notice the structure of the program, the Program Name Area, then the
Declarations section, followed by the statement section. Notice the syntax: a
keyword followed by a parameter, field or constant, with colons used if the
statement is chained. Also, look at the program attributes screen by using Goto
Attributes and compare this information with the notes in your manuals.
After youve looked through the program, hit the green arrow back
(the
same as the function key F3), in order to get back to the ABAP Editor. (Look at
the titlebar for information as to where you are in SAP). If you used the Object
Navigator to view the program, youll need to use transaction SE38, to copy it.
Make sure the program name YIN001 is in the Program Name field before you
copy it.
Hit the copy pushbutton on the application toolbar and name the TARGET
PROGRAM YIN001_XX where XX are the last digits of your logon id. Then hit
the copy pushbutton. You will be prompted with checkboxes asking you if want to
copy the source programs documentation, variants, gui status, screens and
includes to the target program. Go ahead and check all of them and then hit the
copy pushbutton once again.
You will now be asked in which development class youd like to put the target
program. Enter your development class for these exercises (YXXB). Then hit the
save pushbutton. You will now be prompted for a change request number. Make
sure it is the change request you created for this development class. If not, and
youve already created a change request for this development class, hit the Own
Requests pushbutton to retrieve that change request. If you have not yet created a
change request for this development class you may do so now by hitting Create
Request and then following the directions on page 1 of this section. N.B.
Logically, development classes and change requests should have a one to one
relationship, though this is not mandatory. This is done for Correction and
Transport reasons. Change Requests and development classes will be discussed
further in the System Architecture section of the course.
3. Playing in the Editor
Hit the Change/Display pushbutton so that you may edit the code. (The screen in
the editor will change from gray to white). You can select multiple lines of code
by clicking and dragging your mouse over them. You can comment out lines of
Introduction to ABAP
ABAP Exercises
pushbutton.
Introduction to ABAP
ABAP Exercises