EXP_0002 - abap
-
Upload
gianfranco-cortegana-ysminio -
Category
Documents
-
view
225 -
download
0
Transcript of EXP_0002 - abap
-
7/21/2019 EXP_0002 - abap
1/27
0
SAP AG 1999
Client / server architecture
Sample program with data displayed in list form
Sample program with data displayed on a screen
Which ABAP program components are discussed in
which units?
Contents:
Program low in an ABAP Program
SAP AG BC400 2-1
-
7/21/2019 EXP_0002 - abap
2/27
0!"
SAP AG 1999
#verview
Client / server architectureClient / server architecture
Sample program with data displayed in list formSample program with data displayed in list form
Sample program with data displayed on the screenSample program with data displayed on the screen
Which ABAP program components are discussedWhich ABAP program components are discussed
in which units?in which units?
SAP AG BC400 2-2
-
7/21/2019 EXP_0002 - abap
3/27
0!$
SAP AG 1999
Client / Server Architecture
Presentation
Server
%ayer
Application
Server
%ayer
data&ase
'ispatcher
Wor(Process
SAP)*+ SAP)*+ SAP)*+ SAP)*+ SAP)*+ SAP)*+
Wor(Process
Wor(Process
Wor(Process
'ispatcher
Wor(
Process
Wor(
Process
Wor(
Process
Wor(
Process
The R/3 System has a modular software architecture that follows software-oriented client/server
principles.
The R/3 System allocates presentation, applications, and data storage to different computers. This
serves as the basis for the scalabilityof the R/3 system.
The lowest level is the database level. Here data is managed with the help of a relational database
management system (R!"S#. $n addition to master data and transaction data, programs and the
metadata that describe the R/3 System are stored and managed here.
%!%& programs run at the application level, both the applications provided by S%& and the ones
you develop yourself. %!%& programs wor' with data called up from the database level and store
new data there as well. The third level is the presentation level (S%&)$#. This level contains the user interface, in which
an end user can access an application, enter new data and receive the results of a wor' process.
The technical distribution of software is independent of its physical location on the hardware.
*ertically, all levels can be installed on top of each other on one computer or each level on a separate
computer. Hori+ontally, application and presentation level components can be divided among any
number of computers. The hori+ontal distribution of database components, however, depends on the
type of database installed.
SAP AG BC400 2-3
-
7/21/2019 EXP_0002 - abap
4/27
0!,
SAP AG 1999
*ser-#riented .iew
Presentation
Server
%ayer
Application
Server
%ayer
'ata&ase
Wor( Process
ABAP Program
This graphic can be simplified for most topics discussed during this course. The interaction between
%!%& programs and their users will be of primary interest to us during this course. The eact
processes involved in user dispatching on an application server are secondary to understanding how
to write an %!%& program. Therefore we will be wor'ing with a simplified graphic that does not
eplicitly show the dispatcher and the wor' process. -ertain slides will, however, be enhanced to
include these details whenever they are relevant to %!%& programming.
%!%& programs are processed on the application server. The design of the user dialogsand the
database dialogsis therefore of particular importance when writing application programs.
SAP AG BC400 2-4
-
7/21/2019 EXP_0002 - abap
5/27
0!
SAP AG 1999
Program low: What the *ser Sees
ime
Selection Screen
%ist
Blac
(Bo1
Screen
The user is primarily interested in how his or her business transaction flows and in how data can be
input into and displayed from the transaction. Technical details, such as whether a single program is
running or multiple programs are called implicitly, or the technical differences between the 'ind of
screens being displayed, are usually less important to the user. The user does not need to 'now the
precise flow of the %!%& program on the application server. )sers see the R/3 System with
application servers and database as a blac' bo.
There are, however, three technically distinct screen types (screens, selection screens, and lists# that
offer the user different services. $t is the developers ob to determine which type of user dialog is
most suitable to the users needs.
SAP AG BC400 2-5
-
7/21/2019 EXP_0002 - abap
6/27
0!2
SAP AG 1999
+nteraction Between Server %ayers
Program
Start
ABAP 3untime System
ABAP Program
ABAP
Processing
Bloc(
ABAPProcessing
Bloc(
'ata&ase
a&le
0hen the user performs a user action (choosingEnter,a function 'ey, a menu function or a
pushbutton, for eample#, control is handed over from the presentation server to the application
server and certain parts of the %!%& program are processed. $f further user dialog is triggered within
the %!%& program, the system sends a screen to the presentation server and control is once again
handed over to the presentation server.
SAP AG BC400 2-6
-
7/21/2019 EXP_0002 - abap
7/27
0!4
SAP AG 1999
#verview
Client / server architectureClient / server architecture
Sample program with data displayed in list formSample program with data displayed in list form
Sample program with data displayed on the screenSample program with data displayed on the screen
Which ABAP program components are discussedWhich ABAP program components are discussed
in which units?in which units?
$n this part of the unit, the user has chosen to start a program where an airline $ can be entered on
the initial selection screen. The program subse1uently uses this information to retrieve the 2ong
name of airline and the 2ocal currency of airline from the database and display them for the user in
list form.
SAP AG BC400 2-7
-
7/21/2019 EXP_0002 - abap
8/27
0!5
SAP AG 1999
Program
Start
Sample Program 6: Program Start
'ata&ase
a&le
3epository
ime
0henever a user logs on to the system, a screen is displayed. rom this screen, the user can start a
program by using its menu path.
SAP AG BC400 2-8
-
7/21/2019 EXP_0002 - abap
9/27
0!7
SAP AG 1999 ime
Program
Start
System %oads Program Conte1t
'ata #&8ects
ABAPProcessing
Bloc(
ABAP 3untime System
ABAP Program
Selection Screen
3epository
'ata&ase
a&le
$f the user has triggered a program with a user action, then the program contet is loaded on the
application server. The program contet contains memory areas for variables and comple data
obects, information on the screens for user dialogs and %!%& processing bloc's. The runtime
system gets the program information from the Repository, which is a special part of the database.
The sample program has a selection screen as the user dialog, a variable and a structure as data
obects and one %!%& processing bloc'. The list that is used to display the data is created
dynamically at runtime.
The subse1uent flow of the program is controlled by the %!%& runtime system.
SAP AG BC400 2-9
-
7/21/2019 EXP_0002 - abap
10/27
0!60
SAP AG 1999 ime
Program
Start
3untime System Sends Selection Screen
'ata #&8ects
ABAPProcessing
Bloc(
ABAP 3untime System
ABAP Program
'ata&ase
a&le
Since the program contains a selection screen, the %!%& runtime system sends it to the presentation
server at the beginning of program processing. The presentation server controls the program flow for
as long as the user fills in the input fields.
Selection screens allow users to enter selection criteria re1uired by the program.
SAP AG BC400 2-10
-
7/21/2019 EXP_0002 - abap
11/27
0!66
SAP AG 1999 ime
Program
Start
Selection Screen 9ntries +nserted into 'ata #&8ects
'ata o&8ects
ABAPProcessing
Bloc(
ABAP 3untime System
ABAP Program
'ata&ase
a&le
%s soon as the user has finished entering data on the selection screen, he or she can trigger further
processing by choosing 4ecute. %ll data input on the selection screen is the automatically placed in
its corresponding data obect in the program and the %!%& runtime system resumes control of
processing. 5ur sample program contains only one %!%& processing bloc'. The runtime system
triggers se1uential processing of this %!%& processing bloc'.
$f the entries made by the user do not have the correct type, then an error message is automatically
triggered. The user must correct his/her entries.
SAP AG BC400 2-11
-
7/21/2019 EXP_0002 - abap
12/27
0!6"
SAP AG 1999 ime
Program
Start
Program 3euests 'ata 3ecord from 'ata&ase
'ata&ase
a&le
ABAPProcessing
Bloc(
ABAP 3untime System
ABAP Program
'ata o&8ects
The %!%& processing bloc' contains a read access to the database that has been programmed into it.
The program also passes the database information about which database table to access and which
line in the table to read.
SAP AG BC400 2-12
-
7/21/2019 EXP_0002 - abap
13/27
0!6$
SAP AG 1999 ime
Program
Start
'ata&ase 3eturns 'ata 3ecord to Program
'ata&ase
a&le
'ata o&8ects
ABAPProcessing
Bloc(
ABAP 3untime System
ABAP Program
The database returns the re1uested data record to the program and the runtime system ensures that
this data is stored in the appropriate data obects. 6ormally a structure is the target field when a
single record is accessed. The structure contains variables for all fields re1uested from the database.
SAP AG BC400 2-13
-
7/21/2019 EXP_0002 - abap
14/27
0!6,
SAP AG 1999 ime
Program
Start
3untime System Sends %ist
'ata&ase
a&le
'ata o&8ects
ABAPProcessing
Bloc(
ABAP 3untime System
ABAP Program
The layout of the subse1uent list display has also been programmed into the processing bloc'. %fter
all processing has ended, the runtime system sends the list screen to the presentation server.
SAP AG BC400 2-14
-
7/21/2019 EXP_0002 - abap
15/27
0!6
SAP AG 1999
#verview
Client / server architectureClient / server architecture
Sample program with data displayed in list formSample program with data displayed in list form
Sample program with data displayed on the screenSample program with data displayed on the screen
Which ABAP program components are discussedWhich ABAP program components are discussed
in which units?in which units?
$n this part of the unit, the user starts a second sample program where an airline $ can be entered on
the initial selection screen. This program subse1uently uses the information input on the selection
screen to retrieve the 2ong name of airline and the 2ocal currency of airline from the database and
display them for the user on a screen.
SAP AG BC400 2-15
-
7/21/2019 EXP_0002 - abap
16/27
0!62
SAP AG 1999 ime
Sample Program ": Program Start
'ata&ase
a&le
'ata o&8ects
ABAP
Processing
Bloc(
ABAP 3untime System
ABAP ProgramProgram
Start3epository
Screen
0hen the user starts the program, the program contet is loaded first. This time, however, our
sample program contains three processing bloc's, a selection screen, and a screen, and a variable and
two structures as its data obects.
SAP AG BC400 2-16
-
7/21/2019 EXP_0002 - abap
17/27
0!64
SAP AG 1999 ime
'ata&ase
a&le
'ata o&8ects
ABAP
Processing
Bloc(
ABAP 3untime System
ABAP ProgramProgram
Start
Screen
ABAP 3untime System sends Screen
Since the program contains a selection screen, the %!%& runtime system sends it to the presentation
server at the beginning of program processing.
SAP AG BC400 2-17
-
7/21/2019 EXP_0002 - abap
18/27
0!65
SAP AG 1999 ime
*ser %eaves Selection Screen
'ata&ase
a&le
'ata o&8ects
ABAP
Processing
Bloc(
ABAP 3untime System
ABAP ProgramProgram
Start
Screen
%s soon as the user has finished entering data on the selection screen, he or she can trigger further
processing by choosing 4ecute. %ll data input on the selection screen is then automatically placed
in its corresponding data obect in the program and the %!%& runtime system resumes control of
processing. The runtime system then triggers se1uential processing of the %!%& processing bloc'
that comes after the selection screen.
SAP AG BC400 2-18
-
7/21/2019 EXP_0002 - abap
19/27
0!67
SAP AG 1999 ime
Program 3euests 'ata 3ecord from 'ata&ase
'ata&ase
a&le
'ata o&8ects
ABAP
Processing
Bloc(
ABAP 3untime System
ABAP ProgramProgram
Start
Screen
The %!%& processing bloc' contains a read access to the database that has been programmed into it.
The program also passes the database information about which database table to access and which
line in the table to read.
SAP AG BC400 2-19
-
7/21/2019 EXP_0002 - abap
20/27
0!"0
SAP AG 1999 ime
'ata&ase 3eturns 'ata 3ecord
'ata&ase
a&le
'ata o&8ects
ABAP
Processing
Bloc(
ABAP 3untime System
ABAP ProgramProgram
Start
Screen
The database returns the re1uested data record to the program and the runtime system ensures that
this data is stored in the appropriate data obects. 6ormally a structure is the target field when a
single record is accessed. The structure contains variables for all fields re1uested from the database.
SAP AG BC400 2-20
-
7/21/2019 EXP_0002 - abap
21/27
0!"6
SAP AG 1999
Screen
ime
Program Calls Screen
'ata&ase
a&le
'ata o&8ects
ABAP
Processing
Bloc(
ABAP 3untime System
ABAP Program
Process
Before#utput
Program
Start
The %!%& processing bloc' now triggers screen processing. This is often epressed simply by
saying The program calls the screen. However, in reality, each screen possesses its own processing
bloc' that is se1uentially processed before the runtime system sends the screen to the presentation
server (Process Before Output#. This allows screens to be used in a very fleible manner.
SAP AG BC400 2-21
-
7/21/2019 EXP_0002 - abap
22/27
0!""
SAP AG 1999 ime
ABAP 3untime System Sends Selection Screen
'ata&ase
a&le
'ata o&8ects
ABAP
Processing
Bloc(
ABAP 3untime System
ABAP ProgramProgram
Start
Screen
Process
Before#utput
%fter the screens processing bloc' has been processed, the %!%& runtime system sends the screen to
the presentation server. uring this process, data is transported into the screens fields from a
structure that serves as an interface for the screen.
SAP AG BC400 2-22
-
7/21/2019 EXP_0002 - abap
23/27
0!"$
SAP AG 1999 ime
*ser 91ecutes *ser Action
'ata&ase
a&le
'ata o&8ects
ABAP
Processing
Bloc(
ABAP 3untime System
ABAP ProgramProgram
Start
Screen
Process
Before#utput
Process
After
+nput
5nce the user performs a user action (choosingEnter, a function 'ey, a menu function or a
pushbutton, for eample#, control is handed over to the runtime system on the application server
again. The screen fields are transported into the structure that serves as the screens interface and a
special processing bloc' belonging to the screen is triggered. This processing bloc' is always
processed immediately following a user action (Process After Input#.
SAP AG BC400 2-23
-
7/21/2019 EXP_0002 - abap
24/27
0!",
SAP AG 1999 ime
Processing of the ABAP Processing Bloc(3esumes
'ata&ase
a&le
'ata o&8ects
ABAP
Processing
Bloc(
ABAP 3untime System
ABAP ProgramProgram
Start
Screen
Process
Before#utput
Process
After
+nput
%fter the &rocess %fter $nput processing bloc' has been processed, the sample program continues
processing the %!%& processing bloc' that called the screen in the first place.
SAP AG BC400 2-24
-
7/21/2019 EXP_0002 - abap
25/27
0!"
SAP AG 1999
#verview
Client / server architectureClient / server architecture
Sample program with data displayed in list formSample program with data displayed in list form
Sample program with data displayed on the screenSample program with data displayed on the screen
Which ABAP program components are discussedWhich ABAP program components are discussed
in which units?in which units?
SAP AG BC400 2-25
-
7/21/2019 EXP_0002 - abap
26/27
0!"2
SAP AG 1999
Unit 1 +ntroduction
Unit 2 Program low in an ABAP Program
Unit 3 +ntroduction to the ABAP Wor(&ench
Unit 4 ABAP Statements and 'ata 'eclarations
Unit 5 'ata&ase 'ialogs + ;3eading from the 'ata&aseation
Unit 7 *ser 'ialogs: %ist
Unit 8 *ser 'ialogs: Selection Screen
Unit 9 *ser 'ialogs: Screen
Unit 10 +nterfaces
Course Content
SAP AG BC400 2-26
-
7/21/2019 EXP_0002 - abap
27/27
0!"4
SAP AG 1999
Unit 11 3euse Components
Unit 12 'ata&ase 'ialogs ++ ;=a(ing Changes to the 'ata&ase