Professional Documents
Culture Documents
Prepared by J Kreie
New Mexico State University
ABAP Tables and Data
This lesson requires that you first complete the lesson ABAP Tables, Domains, and Data Elements. The
program you create here will use the tables created in the previous lesson.
Add/View Data in Tables
Open the Object Navigator. Create a new program named Z_$$$$_students without the TOP INCL. For the
program title enter: $$$$ Student Information. Assign it to your package and transport request.
Below are screen shots of the code with comments between the screen shots. Comments are also embedded in
the ABAP program. You dont have to type them but it is recommended. It will help you read and understand the
program if you refer to it later on.
Selection-screen
Youll create three selection screens in this program:
1st: Get the user input for what they want to doadd data to a table or view data in a table.
2nd: Get user input for data to add to the EDULEVEL table.
3rd: Get user input for data to add to the STUDENT table.
You can create input screens in ABAP using the selection-screen statement. A selection-screen is given a
number such as the 110 shown below. As you can see this is a block of code that starts with begin and ends
with the end statement. Within a selection-screen there can be one or more blocks (different sections on the
screen). All the examples here have one block.
The title of the screen frame is given a text symbol (text-001, in this case). You fill in the actual text for that later
on.
The parameters
here use radio
buttons in a
group.
Assigning them
all to a group
ensures that
only one choice
can be made.
Also, note that a
default choice is
set.
Page 1 of 10
Page 2 of 10
Page 3 of 10
Page 4 of 10
Page 5 of 10
This subroutine displays a message if the education level or student tables have no data.
Save and check your program. Youll probably need to do some debugging.
Save your changes, check again, and activate your program.
Page 6 of 10
to education level):
So, you can see that the text on the screens is based on parameters names. Use the text elements/selection
texts to clean up the initial input screen so regular English is shown instead of cryptic parameter names. Below
is example text for the screen text symbols and selection text. Remember to activate the symbols and text. Try
running your program again. Its easier to understand!
Page 7 of 10
Practice
Create a program that allows you to add data to or list data from the tables you created in the practice section
of the previous lesson.
Page 8 of 10
Terms to Know
check table............................................................................................................................................................. 4
embedded SQL...................................................................................................................................................... 3
external table.......................................................................................................................................................... 3
FORM..................................................................................................................................................................... 2
insert statement...................................................................................................................................................... 4
internal table........................................................................................................................................................... 3
PERFORM.............................................................................................................................................................. 2
reference table........................................................................................................................................................ 4
select statement..................................................................................................................................................... 3
selection-screen..................................................................................................................................................... 1
value search........................................................................................................................................................... 4
Page 9 of 10
References
ABAP Basics. Gnther Frber and Julia Kirchner, SAP Press - Galileo Press, 2007.
Discover ABAP. Karl-Heins Khnhauser, SAP Press, 2007.
ABAP Objects: An Introduction to Programming SAP Applications. Horst Keller and Sascha Kruger, SAP Press,
2002.