ABAP Programming
Creating a New ABAP Program
A new program is created and assigned to a development class from the Object Navigator.
According to SAP’s general naming conventions, the names of all programs created by the
developer of a SAP customer must begin with the letter Y or Z. Once a program object is
created, then the program code is entered in the object. Next, the program is saved and
tested.
To create a program:
1. Starting from the ABAP Object Navigator screen (transaction SE80), click the Object
Selector list button to display a list of objects that can be created (See Figure 1).
2. Click Program to specify that type of object, then in the Object Name textbox, type the
name for the program you are creating.
program object
selection
Figure 1. Object Selection menu
SAP R/3 – ABAP Steps: 09/04/01 p. 1
3. Press the Enter key to display the Create Object message box, then click Yes to indicate
that you want to create this object. The Create Program dialog box display with your
program name.
4. Click the With TOP INCL. check box to deselect it, if you are creating a Report
program and this is not needed. Then, click the Enter button to complete this
specification and display the ABAP: Program Attribute dialog box (See Figure 2).
title for your program
Figure 2. Program Attributes dialog box
5. In the Title textbox, type a descriptive title for your program, or leave the suggested title.
In the Attributes section, notice the program Type is an Executable program (type 1) and
the Application is blank. An executable program (type 1) is an ABAP Report program.
You can select both the Type and Application as appropriate. For many customer created
SAP R/3 – ABAP Steps: 09/04/01 p. 2
ABAP programs, a type of Executable program and an Application of Basis is specified.
You need to make the appropriate selection for your particular program.
6. Click the Save Enter button to save the program attributes and display the Create Object
Directory Entry dialog box. Once the attributes are save, the program exist in the R/3
Repository.
7. In the Development class textbox, type the name of your development class, then click
the Save button to display the Prompt for local Workbench request dialog box. The
R/3 System automatically generates the Request number.
8. Click the Enter button to accept the Request number and return to the Object
Navigator with newly create program name displayed under the Object name heading
(See Figure 3).
your program name
Figure 3. Object Navigator with new program
You are now ready to enter your ABAP program code, save that code, and perform a test on
your completed program.
To enter an ABAP Program:
1. Double-click the program name under the Object name heading to forward navigate to
your program object and open it the ABAP Editor.
SAP R/3 – ABAP Steps: 09/04/01 p. 3
2. Click the Display<->Change button to switch to the change mode so you can enter
your program code, then click the Full screen on/off button to display the program
in the full-screen mode for ease of entering your program.
3. Type your program using the ABAP Editor.
4. Click the Check button to check the syntax of your program. If any errors are
detected, then correct them.
Once you have entered your program, you are ready to save and execute it. A program
should be activated to insure that the most recent copy of the program is actually being
executed. The R/3 System automatically maintains a prior version and it is best to insure the
current version in the ABAP Editor is your active version.
To save and execute an ABAP program:
1. Click the Save button on the Standard toolbar to save the program.
2. Click the Activate button on the Application toolbar to activate this saved copy of
the program that is displayed in the ABAP Editor. The Inactive Objects dialog box
displays. Click the Enter button to complete the activation. “Active” now appears
to the right of the program name in the ABAP Editor.
3. Click the Test button on the Application toolbar to execute the program and
displays the various program screens.
4. Click the Exit button on the Standard toolbar after your program execution is
complete to return to the Object Navigator.
SAP R/3 – ABAP Steps: 09/04/01 p. 4