Sie sind auf Seite 1von 49

EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Understanding SAP R/3


A Tutorial for Computer Scientists
Florian Matthes Stephan Ziemer

Technical University Hamburg-Harburg

EDBT'98 Valencia
March 1998

Learning Objectives
Participants will
R break the "language barrier" of R/3 terminology
R understand R/3's fundamental architectural, database and language concepts
R be able to relate R/3 to their own research and development work
R have a conceptual basis and reference material for a further study of R/3

f.matthes@tu-harburg.de http://www.sts.tu-harburg.de/~f.matthes/r3.html

Tutorial Outline
1. SAP R/3: Past, Presence and Future 15"
2. The Integrated R/3 Repository 15"
3. Enterprise Modeling with R/3 15"
4. Objects of the R/3 Data Dictionary 45"
coffee break
5. Programming with ABAP/4 and the DynPro Concept 60"
6. Customizing R/3: Concepts and Techniques 15"
7. Process and System Architecture 15"

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 2

www.sts.tu-harburg.de/~f.matthes/r3.html 1
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Motivation for Standard Software

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 3

History of SAP Software


R 1972 SAP “R/1”
• Innovation = Standard Software and Real Time Computing
R 1983 SAP R/2
• Innovation = Integration of Applications (Mainframe-based)
R 1989 SAP R/3
• Innovation = Relational Database, Client-/Server-Architecture,
Platform Independence

"There are no plans for R/4 today"

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 4

www.sts.tu-harburg.de/~f.matthes/r3.html 2
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Characteristics of SAP R/3


R Coverage and integration of a wide range of business functionality
("standard" system and industry solutions)
R High degree of customizability
R Coexistence of multiple clients
R Platform independence
R Integrated development environment
R Modeling of modern business structures
R Sheer size
• 15 GB per installation without any operational data (6 CDs minimum)
• 7 Millions LOC in 1994. Annual growth of the core software by 10-15% (600
developers at SAP)

“R/3” stands for real time system, version 3.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 5

Performance Highlights of Productive Sites

BASF, Germany 600 warehouses, 600,000 articles


1,500 named users, 22 GB customer data

Chevron, USA 80,000 orders / 3 hours


2,500 active users

Eduscho Germany 1,000,000 invoice line items / week


1,000,000 order line items / week

Kaeser Compressors, < 1 sec response time with


Germany 300,000 transactions daily along with
350 - 400 active users

Keebler, USA 2,000,000 invoice line items / week


2,000,000 order line items / week

Swiss PPT, CH Phase 1: 1,891 named users, 855 active users


Phase 2: 3,232 named users, 1,720 active users

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 6

www.sts.tu-harburg.de/~f.matthes/r3.html 3
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

SAP Today
R 4th largest software vendor in the world
R Market leader with 29% market share in
Enterprise Business Solutions (IDC, 1996)

R 25+ years of business experience


R 7,500+ customers in 90+ countries
• 13,000+ R/3 installations

• 1,400+ R/2 installations

R ~13,000 employees
R Worldwide presence in over 50 countries
R Group sales totaled over USD 3.46 billion in 1997, 81% of which was generated
outside Germany

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 7

The Fortune 500 and SAP


R 6 out of the top 10 companies use SAP software.
R 7of the 10 most profitable companies use SAP software.
R 9 of the 10 companies with the highest market value use SAP
software.

R 7 of the top 10 pharmaceutical companies use SAP software.


R 7 of the top 10 computer companies use SAP software.
R 7 of the top 10 petroleum companies use SAP software.
R 6 of the top 10 electronics companies use SAP software.
R 8 of the top 10 chemical companies use SAP software.
R 8 of the top 10 food companies use SAP software.

But: More than 2/3 of SAP’s customers are not in the Fortune 500.
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 8

www.sts.tu-harburg.de/~f.matthes/r3.html 4
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

The End-User's Perspective

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 9

R/3 Applications and their Technological Basis

SD FI
Sales &
Finances R/3 -
Distr.
MM CO Applications
Material-
managment Controlling
PP AM
Production
Plannig
.

QM R/3 BASIS Middleware


PS
Quality- Project
management. system
PM WF
Workflow
HR IS Hardware,
Human
Resources Network,
Operating System,
Database

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 10

www.sts.tu-harburg.de/~f.matthes/r3.html 5
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

System Platforms Supported by R/3


Hardware UNIX Systems Bull/Zenith Digital NCR
Bull IBM Compaq HP (Intel) Sequent IBM IBM
Digital SNI Data General IBM (Intel) SNI AS/400 S/390
HP SUN ...

Operating AIX Reliant


Systems Digital UNIX UNIX (SINIX) Windows NT OS/400 OS/390
HP-UX SOLARIS

Databases ADABAS D ADABAS D


DB2 for AIX MS SQL Server DB2 for DB2 for
INFORMIX-OnLine INFORMIX-OnLine OS/400 OS/390
ORACLE ORACLE

Dialog
Windows 3.1, Windows 95, Windows NT,
SAPGUI OSF/Motif *, OS/2 Presentation Manager (PM),
Macintosh *, Java
Languages
ABAP/4, C, C++, HTML, Java

* not supported as frontend to AS/400


© 1997 SAP AG
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 11

Three-Tier Client/Server-Architecture of R/3


Window
manager X-Terminals

SAPGUI SAPGUI SAPGUI


PC process process
process
Presentation server

DynPro processor Dispatcher DynPro processor


ABAP/4 interpreter ABAP/4 interpreter
Work process Work process

Application server

Central
booking RDBMS
process Database server
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 12

www.sts.tu-harburg.de/~f.matthes/r3.html 6
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Future Trends, New Buzzwords

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 13

Overview
1. SAP R/3: Past, Presence and Future
2. The Integrated R/3 Repository
2.1 Integrated Analysis, Design and Implementation
2.2 Coexistence of Multiple R/3 Clients
2.3 Application and System Evolution
2.4 Running Example: FM Areas and Funds Centers
3. Enterprise Modeling with R/3
4. Objects of the R/3 Data Dictionary
5. Programming with ABAP/4 and the DynPro Concept
6. Customizing R/3: Concepts and Techniques
7. Process and System Architecture

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 14

www.sts.tu-harburg.de/~f.matthes/r3.html 7
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

R/3 User Groups and Views


Developer, Consultant, Administrator,...

End User
R/3-Tools
uses
manipulates

TR ... Repository
FI HR
......

......

Runtime Environment

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 15

R/3 Tools

Customizing Development

R/3-
Tools Business
Engineering

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 16

www.sts.tu-harburg.de/~f.matthes/r3.html 8
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Concepts and Languages of the R/3 Repository


Analysis Design Implementation
Level Level Level
Event- Business Development
Controlled
Process
Chain (EPC)
Engineering

[ Business
class
} Process
View

SAP Module Objects ]


ABAP/4
} Function
View

"Real World" SAP SERM Data


Dictionary
SQL } Data
View

R/3 Repository
Data Dictionary
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 17

Objects of the R/3 Repository


Analysis Design Implementation
Level Level Level

Event, Workflow Transaction


Function,
...
} Process
View

}
Program,
Report, Function
... View

Entity, Table, ABAP/4


"Real World" Relationship Domain,
Foreign Key,
...
Variable,
SQL Table,
... } Data
View

Manual Manual Tool- Consistency


Supported } Maintenance
between Levels

R/3 Repository
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 18

www.sts.tu-harburg.de/~f.matthes/r3.html 9
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Repository Information System

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 19

OMT-Notation
Class: Class Name Generalization: Superclass
Attributes

Operations
Subclass-1 Subclass-2
Instance:
(Class Name)
Instance Name
Multiplicity of associations:
Association:
Association name Class Exactly one
Class 1 Class 2
Role 1 Role 2
Class Many (≥0)

Aggregation: Class Optional (0 oder 1)


Assembly Class
+1 Class One or more
1-2,4 Class Numerically
specified
Part-1-Class Part-2-Class
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 20

www.sts.tu-harburg.de/~f.matthes/r3.html 10
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

R/3 Repository and Data Dictionary


Repository

Data Application
Dictionary

Object
Name
Development Class

ABAP/4 Development Class


Dictionary Object
Object
Owner

State Transport()

Transport()

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 21

Clients in R/3

Client
Client Transport with
with separate
separate data
data
R/3 system
containing
shared
data
Client
Client with
with separate
separate data
data

Naming Conventions!
New Release
from SAP Client: A business entity in the R/3 system.
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 22

www.sts.tu-harburg.de/~f.matthes/r3.html 11
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Naming Conventions in R/3


R For most customer-created objects the name has to start with either a Y or a Z.

Object Length Name Example

Domain 10 Y*, Z* YNAME, Z1234


Data Element 10 Y*, Z* ZNAME, YNAME12
Matchcode Object 4 Y*, Z* YMCO, ZMCO
Matchcode Id 1 A-Z,0-9 YMCO1, ZMCOG
Pool-/Cluster Table 10 Y*, Z* YPOOL, ZCLUSTER
Lock Object 10 EY*, EZ* EYNAME, EZNAME
Structure 10 Y*, Z*, T9*, P9* YSTRUKT, ZSTR123
Transparent Table 10 Y*, Z*, T9*, P9* YTAB1, ZTAB2
Append 10 Y*, Z* ZAPPEND, YAPPEND
Field 10 YY*, ZZ* ZZFELD, YYFELD
View 10 Y*, Z* YVIEW, ZVIEW
Help View 10 H_Y*, H_Z* H_YVIEW, H_ZVIEW

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 23

Running Example: FM Areas and Funds Center


Financial Management Area e.g,, CS department

Funds Center e.g., groups within


the department

Financial Management Area (FM Area):


The FM area is the commercial organizational unit, within which commitment accounting
is conducted.

Funds Center:
A funds center is a commercial responsibility area to which a budget is assigned.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 24

www.sts.tu-harburg.de/~f.matthes/r3.html 12
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Overview
1. SAP R/3: Past, Presence and Future
2. The Integrated R/3 Repository
3. Enterprise Modeling with R/3
3.1 Data Modeling : Entities and Relationships
3.2 Functional Decomposition: R/3 Modules
3.3 Process Modeling: R/3 Reference Model, EPCs and SAP Transactions
4. Objects of the R/3 Data Dictionary
5. Programming with ABAP/4 and the DynPro Concept
6. Customizing R/3: Concepts and Techniques
7. Process and System Architecture

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 25

Relationships in the SAP SERM Data Model

A
H

Hierarchical
Aggregating

Referential Is a

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 26

www.sts.tu-harburg.de/~f.matthes/r3.html 13
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Cardinalities of Relationships in SAP SERM


Each entity of the source entity type has exactly one dependent entity:

1:1

Each entity of the source entity type has at most one dependent entity:

1:C

Each entity of the source entity type has at least one dependent entity:

1:M

Each entity of the source entity type can have any number of dependent entities:

1 : CM

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 27

R/3 Data Model for FM Areas


No Updates
through Applications
Application Data
Entity Number
19013 V View
Language R

12340 AV 12410 AV
Financial H Funds Center
Management
Area
19031 AV
Currency
R

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 28

www.sts.tu-harburg.de/~f.matthes/r3.html 14
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Logical Partition of R/3 into Modules

FI HR TR SD MM PP QM PM IS WF PS CO AM
Maintained
by Program
Objects
SAP

Consultant Customizing
Data Data
Objects
Company Application
Data

System R/3

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 29

Future: BAPIS and Business Objects

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 30

www.sts.tu-harburg.de/~f.matthes/r3.html 15
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Event-Controlled Process Chains


R Functions R Logical connectives
Function /\ \/ \/

R Events AND OR XOR

Event

R Organization Unit Types


Organizational
Unit

R Information Objects
Input /
Output

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 31

Example: Transaction-Level EPC


new Funds center
to be created

choose
FM area

FM area
exists

/\

choose choose choose


responsible superordinated
person funds center fund

/\

new Funds center


created
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 32

www.sts.tu-harburg.de/~f.matthes/r3.html 16
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Example: Workflow-Level EPC


Finanzierungs-
zweck ist
anzulegen

TR
Finanzierungs-
zweckbearbeitung

Finanzierungs-
zweck ist Fonds
erzeugt ist anzulegen

Finanzposition Finanzstelle Budgetstatus Budgetträger


ist anzulegen ist anzulegen ist zu pflegen ist anzulegen

TR TR TR TR
Finanzpositions- Finanzstellen- Fonds- TR
Budgetträger-
Statusverwaltung
bearbeitung bearbeitung bearbeitung bearbeitung

Budgets sind Finanzposition Finanzstelle Fonds ist Anwenderstatus Budgetträger


zu planen ist erzeugt ist erzeugt erzeugt liegt vor liegt vor

TR
Budgetversions-
bearbeitung

Budget wird Weitere finanzielle


Budgetrückgabe B u d g e t u m b u c h u ng Budgetnachtrag ist
nicht komplett Mittel erden
ist durchzuführen ist durchzuführen durchzuführen
benötigt benötigt
Budgetversion
liegt vor

TR
Originalbudget-
pflege (alle TR TR TR
Versionen) Budgetrückgabe B u d g e t u m b u c h u ng Budgetnachtrag

Budgets Originalbudget Budgetrückgabe B u d g e t u m b u c h u ng Budgetnachtrag


sind bewilligt liegt vor liegt vor ist abgeschlossen liegt vor

TR
Budgetreigabe

Budgetfreigabe
liegen vor

Verbrauchs- Lohnbearb-
Kreditoren- Debitoren- Lagermaterial- Dienstleistungs- Strecken-
material- beitungs-
abwicklung abwicklung abwicklung abwicklung abwicklung
abwicklung abwicklung

Individuelle
Mittelreservierung Buchungsfehler
toleranzen
XOR ist durchzuführen liegt vor
sind zuzuweisen
XOR XOR

TR
TR
TR Zuordnung
Zahlungs-
Mittelreservierung individuelle
XOR umbuchung
XOR Toleranzen

Kreditor- BANF mit Rechnung ist


BANF mit BANF ohne Material ist Material ist in Streckenwaren.
Anzahlungs- Zahlung Anzahlung Kontrakt- BANF mit Lieferant Bestellun g gebucht und Mittelreservierung Umbuchung Toleranzen
Lieferplannummer Bezugsquelle in Lagerbestand Verbaruch eingang ist
anforderung ist gebucht ist gebucht nummer ist ist erstellt ist angelegt zur Zahlung liegt vor ist abgeschlossen liegen vor
ist erstellt ist erstellt gebucht gebucht abgeschlossen
ist erstellt erstellt freigegeben

Jahresendbericht Monatsbericht Ad hoc-Bericht


ist erforderlich ist erforderlich ist erforderlich

Prozess-
wegweiser

Ereignis
TR
Berichte

XOR

Budget-Größen- Budget-Perioden- Budget-Jahres- Budgettypen- Budget/Ist-


Vergleich liegt Vergleich liegt Vergleich liegt Vergleich liegt Vergleich liegt
vor vor vor vor vor

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 33

SAP Transactions (Logical Unit of Work)

BOT EOT

Input Input Input


Mask 1 Mask 2 Mask 3

Time

DB-TA DB-TA DB-TA

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 34

www.sts.tu-harburg.de/~f.matthes/r3.html 17
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Overview
1. SAP R/3: Past, Presence and Future
2. The Integrated R/3 Repository
3. Enterprise Modeling with R/3
4. Objects of the R/3 Data Dictionary
4.1 Data Modeling: Selected Data Dictionary Objects
[ 4.2 Functional Modeling: Business Objects]
4.3 Process Modeling: Workflows
5. Programming with ABAP/4 and the DynPro Concept
6. Customizing R/3: Concepts and Techniques
7. Process and System Architecture

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 35

Data Modeling Objects in the Data Dictionary


Data Dictionary Object
Status

...

Table View Data Domain


+1 Element
Has check table

Type
defines Values

Join-cond.

+1
Field +1
Name

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 36

www.sts.tu-harburg.de/~f.matthes/r3.html 18
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Domains and Data Elements

relevance for "business"


Data Element Data Element Data Element Data Element
sending receiving FIKRS FM_FICTR
account account

Domain Domain Domain


KOSTL FIKRS FISTL
CHAR(10) CHAR(4) CHAR(16)

relevance for "implementation"

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 37

Types of Tables

Table

Pool Table Cluster Table


Transparent +1 +1
Table

Table Pool Table Cluster


implemented by

implemented by implemented by

SQL-Table

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 38

www.sts.tu-harburg.de/~f.matthes/r3.html 19
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Pool and Cluster Tables


Pool Table SQL Table

Cluster Table SQL Table

}
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 39

Visibility of Tables

Table A Table B Table C ABAP/4

Table B Table C
Table A (Cluster-Tab.) (Cluster-Tab.) Data Dictionary
(transparent)
Table-Cluster

Table A Table Database

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 40

www.sts.tu-harburg.de/~f.matthes/r3.html 20
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Delivery Classes of Tables


R Class A: Application table (master or transaction data). Maintained by the customer
using application transactions. Supplied empty. Example: material master.
R Class C: Customer table. Maintained only by the customer. Supplied with SAP
model entries. Tables of this delivery class are never overwritten when upgrades
are performed. Example: company code tables.
R Class G: Customer table with protected content. Like class C, but SAP can add new
entries. Existing customer entries are not overwritten. Supplied with SAP model
entries. Example: number ranges.
R Class L: Table for storing temporary data which can be interpreted as intermediate
results with limited time validity. Supplied empty. Example: employee groups.
R Class E: System table (control table) with separate name ranges for customer
entries. The customer entries remain unchanged when upgrades are performed.
Example: special stock indicator.
R Class S: System table of program nature. Maintained only by SAP. Table is filled
with system settings on delivery. Example: codes for SAP transactions.
R Class W: System table for system operation and maintenance. Contents are
maintained directly by maintenance transactions. Example: function module table.
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 41

Example: Table FMFCTR (1)


Field Name Key Type Length Data Element Domain Text
MANDT X CLNT 3 MANDT MANDT Client
FIKRS X CHAR 4 FIKRS FIKRS FM Area
FICTR X CHAR 16 FM_FICTR FISTL Funds Center
DATBIS X DATS 8 DATBI DATUM Valid until
ERFDAT DATS 8 FM_ERFDAT DATUM FIFM: Exists since
AENDAT DATS 8 FM_AENDAT DATUM FIFM: Date of Change
BOSS_CO NUMC 8 FM_BOSSCO PS_VER FIFM: Code of repsonible
DE D NR Person
LAND1 CHAR 3 LAND1 LAND1 Country Key
TELEFAX CHAR 31 TELEFX TEXT31 Fax Number
... ... ... ... ... ...

Delivery Class: A
Transparent Table

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 42

www.sts.tu-harburg.de/~f.matthes/r3.html 21
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Example: Table FMFCTR (2)

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 43

Foreign Keys in FMFCTR


Field Name Check Table Cardinality Text
MANDT T000 1:CN FIFM: Client
FIKRS FM01 1:CN FIFM: FM Area
BOSS_CODE TCJ04 1:CN FIFM: Responsible Person for Fund
Center
LAND1 T005 1:1 (!?) FIFM: Country
... ... ... ...

12340 AV 12410 AV
Data Model: H
FM Area Funds Center

IFMFCTR is a structure complying with table FMFCTR.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 44

www.sts.tu-harburg.de/~f.matthes/r3.html 22
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

SAP Business Workflow


R allows users to define business workflows on top of SAP transactions
R EPCs used as modeling technique
R Coordination of
• the persons involved
• the work steps required
• the data to be processed (business objects)

R not (yet) part of the data dictionary (but of the repository)

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 45

Overview
1. SAP R/3: Past, Presence and Future
2. The Integrated R/3-Repository
3. Enterprise Modeling with R/3
4. Objects of the R/3 Data Dictionary
5. Programming with ABAP/4 and the DynPro Concept
5.1 Implementation-Oriented Data Dictionary Objects
5.2 Programming in the Large: Development Class Objects
5.3 Programming in the Small: Program Objects
6. Customizing R/3: Concepts and Techniques
7. Process and System Architecture

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 46

www.sts.tu-harburg.de/~f.matthes/r3.html 23
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Data Types in the Data Dictionary


Data Dictionary Object

... ...

Domain Type
Groups
Based
on
Data Type

External ABAP/4 Header Internal Field-


Type Data Type Line Table Symbol
Projected to

SQL Type Field


Name
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 47

External Data Types


External Type Description output length
ACCP Posting period. The format is YYYYMM. 6
CHAR Character string. <256
CLNT Client. 3
CUKY Currency key. 5
CURR Currency field. Must point to a field of type CUKY. <18
DATS Date. 8
DEC Counter or amount field. <18
FLTP Floating-point number. 16
INT1 1-byte integer between 0 and 255. 3
INT2 2-byte integer between -32767 and 32767. 5
INT4 4-byte integer between -2177483647 and 2177483647. 10
LANG Language key. 1
LCHR Character string of arbitrary length. >255
LRAW Uninterpreted byte string of arbitrary length. >255
NUMC Character field in which only numbers can be entered. <256
PREC Accuracy of a QUAN field. 2
QUAN Quantity. Must always point to a units field with UNIT format 17
RAW Uninterpreted sequence of bytes. <256
TIMS Time. 6
UNIT Units key. 2 or 3
VARC No longer supported. (version 3.0)
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 48

www.sts.tu-harburg.de/~f.matthes/r3.html 24
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Mapping External Types to ABAP/4 Data Types


External Type ABAP/4 Data Type

ACCP N(6)
CHAR n C(n)
CLNT C(3)
CUKY C(5)
CURR n,m,s P((n+2)/2) DECIMALS m (NO-SIGN)
DATS D(8)
DEC n,m,s P((n+2)/2) DECIMALS m (NO-SIGN)
FLTP F(8)
INT1/2/4 I
LANG C(1)
LCHAR C(n)
LRAW X(n)
NUMC n N(n)
PREC ---
QUAN n,m,s P((n+2)/2) DECIMALS m (NO-SIGN)
RAW n X(n)
TIMS T(6)
UNIT C(n)

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 49

Example: Type Group


TYPE-POOL YYY.
* Header Type YYY_FMAREA_TYPE
TYPES: BEGIN OF YYY_FMAREA_TYPE,
FMAREA LIKE FM01-FIKR,
FUNDSCENTER LIKE FMFCTR-FIFCTR,
DESCRIPTION(30) TYPE C,
END OF YYY_FMAREA_TYPE.
* Internal Table
TYPES YYY_INTERNAL_INTEGER_TAB_TYPE TYPE I OCCURS 10.

Type Groups are stored in the Data Dictionary for cross-program use.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 50

www.sts.tu-harburg.de/~f.matthes/r3.html 25
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Orthogonality of the Type Concept


Atomic Type Header Line internal Tab. SQL-Table

Naming X X X --
Variable Declaration
global X X X by Name
local X X X by Name
Parameter Passing
by Value X X -- --
by Reference X X X --
Embedding in
Header Line X X -- --
Internal Table X X -- --
SQL-Table X X -- X
Copy as a whole X X X --
Displayable X -- -- --

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 51

Implementation-Oriented Objects
Data Dictionary Object
Status

...
includes includes

Table Structure Data Lock Match-


Element Object code
includes
has has
Object
appends Primary Secondary has has
Table Table Primary Secondary
+1 +1 Table 1-36
Table
Field Field ID
Name Name
Projection
Select
condition

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 52

www.sts.tu-harburg.de/~f.matthes/r3.html 26
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Lock Object
R A lock object stores persistent locks on table rows that outlive a single database
transaction.
R Lock modes:
• E (Exclusive, cumulative)
• S (Shared)
• X (Exclusive, not cumulative)

Example EFMFCTR
R Primary Table: FMFCTR and no Secondary Tables
R Lock arguments: FMFCTR-MANDT, FMFCTR- FIKRS, FMFCTR- FICTR, FMFCTR-
DATBIS
R Lock mode: E
R Invoke object with Function Modules: ENQUEUE_EFMFCTR,
DEQUEUE_EFMFCTR
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 53

Matchcodes

R Help the user to find the identifying tulpe value of an existing tuple.
R Different sets of attributes can be shown, each constituting a Matchcode-Id.

Differences between database indexes and matchcodes


R A matchcode can contain fields from several tables. An index contains fields from
only one table.
R Matchcodes can be built on the basis of both transparent tables stored in the
underlying database and using the special table types pool and cluster.
R The matchcode structure can be restricted by stipulating selection conditions.
R Matchcodes can be used as entry aids in the context of the SAP help system.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 54

www.sts.tu-harburg.de/~f.matthes/r3.html 27
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Example: FIKR
Input requested: Code for FM Area (FM01-FIKRS).

FM Area: Computer Science F18 FM Area: F18

Eingabe-
hilfe (F4)

Uses Tables:
FM01: FM Areas FM01T: Descriptions of FM Areas

MANDT FIKRS ... MANDT FIKRS SPRAS FIXTXT ...


... ... ... ... ... ... ... ...
010 F18 ... 010 F18 D Comp.Sc. ...
... ... ... ... ... ... ... ...

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 55

Example: FIKR

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 56

www.sts.tu-harburg.de/~f.matthes/r3.html 28
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Example: Definition of a Matchcode


Step 1: Definition of Matchcode-Object FIKR
• Primary Table and Secondary Table

Primary Table
SELECT FM01.FIKRS,FM01T.SPRAS,
FM01 FM01T.FIXTXT
FROM FM01, FM01T
* WHERE FM01.FIKRS=FM01T.FIKRS
Secondary Table AND FM01.MANDT=FM01T.MANDT
(INTO M_FIKR)
FM01T
*FM01-FIKRS is a foreign key for FM01T-FIKRS
• Fields used by Matchcode:
Table Fieldname MC-Field Search field Key
FM01 MANDT MANDT X
FM01 FIKRS FIKRS X X
FM01T SPRAS SPRAS X
FM01T FIXTXT FIXTXT
FM01T SPRAS SPRAS3
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 57

Example: Definition of a Matchcode (cont.)


Step 2: Definition of a Matchcode-ID

Matchcode-Id B:
• Primary Table: FM01 SELECT FIXTXT,SPRAS,FIKRS
• Secondary Tables: FM01T FROM M_FIKR
• MC-View Name: M_FIKRB
• Fields: FM01-MANDT, FM01T-FIXTXT, FM01T-
SPRAS, FM01-FIKR
• No selection

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 58

www.sts.tu-harburg.de/~f.matthes/r3.html 29
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Tools to Manipulate Development Class Objects


Workbench Organizer
R Object Browser
R Screen Painter
R Menu Painter
R CATT
R Data Modeler
R ABAP/4 Editor

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 59

Object Browser

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 60

www.sts.tu-harburg.de/~f.matthes/r3.html 30
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Reflexivity of R/3
R Initiation of a program
SUBMIT <program>
R Creation of a new program
DATA CODE(72) OCCURS 10
APPEND: ‘REPORT ZRFC1.’ TO CODE,
‘WRITE / “Hello World!”’ TO CODE.
INSERT REPORT ‘ZRFC1’ FROM CODE.
R “Loading” a program into a table
READ REPORT <name> INTO <itab>.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 61

Development Class Objects

Development Class Object


Generate

.....
Transaction starts Program object Function Message Logical
Version Group Class Database
Code

uses

Authorization Message
Object
Number

Report Function module


(REPORT/PROGRAM) (FUNCTION-POOL)
Interface

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 62

www.sts.tu-harburg.de/~f.matthes/r3.html 31
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Function Modules
R Central concept for many R/3 features.
R Reminds on the Module concept in programming languages.

Different kinds of function modules, called process types:


R Normal
R RFC supported
R Update with start immediately (V1-booking)
R Update immediately (V1-booking)
R Update with start delayed (V2-booking)
R Sammellauf (V2-booking)

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 63

Development Class Objects (continued)

Development Class Object


Generate

...

Business Dialog Box SET-/GET- Area Menu CATT Procedure


Engeneering- Parameter
Objekt Interface
calls
uses +1
Program Object GUI Status Transaction

Workflow Data Model

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 64

www.sts.tu-harburg.de/~f.matthes/r3.html 32
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

GUI Status Object


GUI Status

GUI Status Object

Function Key Standard Application


Menu Bar
Assignment Tool Bar Tool Bar
Code

Menu Function Key Function Key


references
+1 Code Code
+1
Menu item
Code

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 65

Area Menu TCMN (Development Class FMBS)


Menu Bar

Standard
Tool Bar

Application
Tool Bar

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 66

www.sts.tu-harburg.de/~f.matthes/r3.html 33
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

R/3 Model for Interactive Transactions

DynPro A DynPro A DynPro B DynPro B ...


... PBO- PAI- PBO- PAI-
Event Event Event Event

ABAP/4- ABAP/4- ABAP/4- ABAP/4-


Modules Modules Modules Modules

DynPro A DynPro B

DB-TA DB-TA DB-TA DB-TA

Time
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 67

States of the R/3 DynPro Interpreter

Leave to
Process Transaction
Screen
OK-CODE
type T?
AT EXIT
F4? COMM-
F1?
AND
OK-CODE
Transfer Data type E?
Execute Transfer Data from
from ABAP/4 Offer Next
PBO DynPro Fields into
Variables into Help
Modules
DynPro Fields
ABAP/4 Variables PBO

Execute
Sub-
PAI
routines
Lock certain Modules
DynPro Fields MESSAGE
type E?

Sub-
routines

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 68

www.sts.tu-harburg.de/~f.matthes/r3.html 34
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Program Objects in Detail


Program Object imports Logical
Transaction Database
Type, Version
Code
Starts with

Module Pool
in ABAP/4

+1
DynPro PBO PAI Subroutine Global GUI GUI
Module Module (Form) Data Title Status
Number Type Code
Screen
calls
Flow Logic
executes

+1
exchange Data (equal Names)
DynPro Field

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 69

Transaction FM2I, DynPro 100

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 70

www.sts.tu-harburg.de/~f.matthes/r3.html 35
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Transaction FM2I, DynPro 200

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 71

Dialog-Oriented Programming in R/3

create
Fund Center PAI
PBO

Transaction DynPro next


FMI2 100 DynPro

MODULE MODULE
D0100_INDEPENDENT FM_FCTR_LESEN

ABAP/4
{ MODULE
D0100_MODIFY_SCREEN

MODULE
D0100_SET_PF-STATUS
MODULE
D100_OK_CODE

MODULE
...

Zeit Function Module SAPLFM22

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 72

www.sts.tu-harburg.de/~f.matthes/r3.html 36
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Components of a DynPro
R Screen Layout
R Fields
R Attributes
R Flow Logic

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 73

Creating Masks: Screen Painter

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 74

www.sts.tu-harburg.de/~f.matthes/r3.html 37
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

DynPro Fields
Field Name Field Type Format Length Explanation
IFMFCTR-FIKRS Text CHAR 15 shows "Finanzkreis"
IFMFCTR-FIKRS I/O CHAR 4 The superordinated FM Area is
typed in here. Matchcode FIKR
is used to provide help.
IFMFCTR-FICTR Text CHAR 15 shows "Finanzstelle"
IFMFCTR-FICTR I/O CHAR 10 The funds center is typed in here.
Matchcode FIST is used to
provide help.
OK_CODE OKCODE

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 75

DynPro Attributes

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 76

www.sts.tu-harburg.de/~f.matthes/r3.html 38
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Flow Logic
PROCESS BEFORE OUTPUT.
MODULE D0100_INDEPENDENT. PBO-Event
MODULE D0100_MOFIFY_SCREEN.
MODULE D0110_SET_PF-STATUS.

PROCESS AFTER INPUT.


MODULE D0100_EXIT AT EXIT-COMMAND. PAI-Event
CHAIN.
FIELD: IFMFCTR-FIKRS,
IFMFCTR-FICTR.
MODULE CHECK_SONDERZEICHEN.
MODULE D0100_DB_KEY_NOTICE.
MODULE AUTHORITY_CHECK.
MODULE FMFCTR_ENQUEUE.
MODULE FMFCTR_LESEN.
ENDCHAIN.
FIELD OK_CODE MODULE D0100_OK_CODE.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 77

Function Pool FM22


* Programmkopf
FUNCTION-POOL FM22 MESSAGE-ID FI.
...
*-----------------------------------------------------------------------
* DEC - lokale Datenbeschreibungen Tabellen / Daten / Field-Symbols
*-----------------------------------------------------------------------
INCLUDE LFM22DEC.
...
*-----------------------------------------------------------------------
* Interne Tabellen
*-----------------------------------------------------------------------

* Interne Tabelle für die Finanzstelle zur Datenhaltung


* und zur Datenübergabe zwischen den Dynpros
DATA: BEGIN OF I_FMFCTR OCCURS 10.
INCLUDE STRUCTURE IFMFCTR.
DATA: END OF I_FMFCTR.

* Sicherung unbearbeitetes Dynpro


DATA: BEGIN OF I_OLD_FMFCTR.
INCLUDE STRUCTURE IFMFCTR.
DATA: END OF I_OLD_FMFCTR.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 78

www.sts.tu-harburg.de/~f.matthes/r3.html 39
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Data Declaration (Include LFM22DEC)


TABLES:
"/ Finanzkreis
FM01,
"/ Texte zum Finanzkreis
FM01T,
"/ Finanzstelle
FMFCTR,
"/ Interne Tabelle für die Dynprofelder der Finanzstelle
IFMFCTR.

* Feldleiste für die Finanzstelle


DATA: BEGIN OF FFMFCTR.
INCLUDE STRUCTURE IFMFCTR.
DATA: END OF FFMFCTR.

DATA:
"/Finanzkreis
G_FIKRS LIKE FM01-FIKRS,
"/Finanzstelle
G_FICTR LIKE FMFCTR-FICTR,
"/Transaktionscode
G_TCODE LIKE SY-TCODE,
"/Flag um zu signalisieren, ob die TA / Function abhängig aufgerufen wurde.
FLG_CALLD LIKE SY-CALLD VALUE 0.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 79

Header Lines and Internal Tables


Problem: How to access data in the data base?

a) Typically: Definition of a fixed header line for data exchange with the table

} Header Line

} Table

b) Alternative: Specification of the Header Line with every access

}
} Header Line A

Table
} Header Line B

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 80

www.sts.tu-harburg.de/~f.matthes/r3.html 40
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Access to Internal Tables

associative it-name=“x”. READ it.

Element-Oriented
positional read it index 42.

Set-Oriented move it1[] to it2[].

iterative loop at it. ... endloop.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 81

Access to the Database


R Access through Native-SQL or Open-SQL
R Open-SQL:
• SELECT, INSERT, UPDATE, MODIFY, DELETE
• OPEN CURSOR, FETCH, CLOSE CURSOR
• COMMIT WORK, ROLLBACK WORK
R Native-SQL: Database dependent.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 82

www.sts.tu-harburg.de/~f.matthes/r3.html 41
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Dynamic Screen Modification


MODULE D0100_MODIFY_SCREEN.
*----------------------------------------------------------------------*
* Dynamische Bildmodifikation für Dynpro 0100: *
* - Feld 'Finanzstelle' auf Länge 10 reduzieren *
* - Feld 'Finanzkreis' ist bei Neuanlage aus der Grafik heraus *
* nur ein Anzeigefeld *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*

"/ Schleife über alle Dynprofelder


LOOP AT SCREEN.
"/ if (( Feldname = 'Finanzkreis' ) und ( TA ist abhängig ) )
IF ( ( SCREEN-NAME = 'IFMFCTR-FIKRS' )
AND ( FLG_CALLD = CON_DEPENDANT_TA ) ).
"/ Feld dient nur zur Anzeige
SCREEN-INPUT = 0. "/'0A' in HEX
MODIFY SCREEN.
ENDIF. "/ SCREEN-NAME
ENDLOOP. "/ SCREEN.

ENDMODULE. "/ D0100_MODIFY_SCREEN

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 83

Exit-Module (no Execution of PAI-Modules)


MODULE D0100_EXIT.
*----------------------------------------------------------------------*
* Funktionen, die die aktuelle Bearbeitung beenden *
* ohne die PAI-Module, -Prüfungen zu aktivieren. *
* LEAVE TO TRANSACTION löst automatisch das Freigeben aller *
* Sperren der Transaktion aus! *
*----------------------------------------------------------------------*
"/ Zwischenspeichern des OK_CODE
SAV_OK_CODE = OK_CODE.
CLEAR OK_CODE.
"/ Auswerten des OK_CODE
CASE SAV_OK_CODE.
"/ ENDE = Beenden
WHEN 'ENDE'.
SET SCREEN 0.
LEAVE SCREEN.
"/ EINS = In Anlegen-TA verzweigen
WHEN 'EINS'.
"/ Rufe Transaktion 'Anlegen'
LEAVE TO TRANSACTION TR_FICTR_INS.
ENDCASE.

ENDMODULE. "/ D0100_EXIT

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 84

www.sts.tu-harburg.de/~f.matthes/r3.html 42
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Branching in ABAP/4
DynPro DynPro DynPro
default default
PBO PAI PBO PAI PBO PAI
SET SCREEN 200
LEAVE SCREEN

“GOTO”
DynPro DynPro
default
PBO PAI PBO PAI

DynPro DynPro DynPro


default default
PBO PAI PBO PAI PBO PAI
CALL SCREEN 200 SET SCREEN 0
LEAVE SCREEN LEAVE SCREEN
“GOSUB”
DynPro DynPro
default
PBO PAI PBO PAI
= is executed
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 85

Call of a Lock Object (EFMFCTR)


MODULE FMFCTR_ENQUEUE INPUT. "/Prozedur zum Sperren einer Finanzstelle aufrufen
PERFORM FMCTR_ENQUEUE.
ENDMODULE. "/ FMFCTR_ENQUEUE

FORM FMFCTR_ENQUEUE.
"/ if ( Anlegen oder ändern einer Finanzstelle )
CHECK ( ( G_TCODE = TR_FICTR_INS )
OR ( G_TCODE = TR_FICTR_UPD ) ).
"/ Sperre für eine Finanzstelle anfordern
CALL FUNCTION 'ENQUEUE_EFMFCTR'
EXPORTING
FIKRS = G_FIKRS
FICTR = G_FICTR
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2.
CASE SY-SUBRC. "/ Fehlerbehandlung
WHEN 1. "/bereits von anderem User gesperrt (FOREIGN_LOCK)
MESSAGE E641 WITH G_FICTR.
WHEN 2. "/ SYSTEM_FAILURE bei einer Sperranforderung
MESSAGE A521 WITH G_FICTR.
ENDCASE. "/ SY-SUBRC
ENDFORM. "/ FMFCTR_ENQUEUE

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 86

www.sts.tu-harburg.de/~f.matthes/r3.html 43
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

“Normal” Exit Module


MODULE D0100_OK_CODE INPUT.
*----------------------------------------------------------------------*
* Auswertung der Benutzerkommandos im Dynpro 100 *
*----------------------------------------------------------------------*

"/ Zwischenspeichern des OK_CODE


SAV_OK_CODE = OK_CODE.
CLEAR OK_CODE.

"/ Auswerten des OK_CODE


CASE SAV_OK_CODE.
"/ ENTER
WHEN SPACE.
"/ Folgedynpro 200 aufrufen
SET SCREEN 200.
LEAVE SCREEN.
ENDCASE.

ENDMODULE. "/ D0100_OK_CODE


*----------------------------------------------------------------------*

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 87

Overview
1. SAP R/3: Past, Presence and Future
2. The Integrated R/3-Repository
3. Enterprise Modeling with R/3
4. Objects of the R/3 Data Dictionary
5. Programming with ABAP/4 and the DynPro Concept
6. Customizing R/3: Concepts and Techniques
7. Process and System Architecture

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 88

www.sts.tu-harburg.de/~f.matthes/r3.html 44
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Procedure Model

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 89

Implementation Guide

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 90

www.sts.tu-harburg.de/~f.matthes/r3.html 45
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Implementation Guide (cont.)

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 91

Technical Implementation
R NO ABAP/4 standard code is changed !
R Reaction to contents of tables:
• dynamic screen modification in PBO-Modules
• CASE/IF/CHECK -statements in ABAP/4
• change of screen appearance, e.g. through SET SCREEN
• ...
R “Customizing Slots” in ABAP/4 standard modules:
• ABAP/4 Modules with certain names will be called by the standard code - the
module implementation is to be done during the customizing process.
R Attributes in Include- and Append-Tables.

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 92

www.sts.tu-harburg.de/~f.matthes/r3.html 46
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Overview
1. SAP R/3: Past, Presence and Future
2. The Integrated R/3-Repository
3. Enterprise Modeling with R/3
4. Objects of the R/3 Data Dictionary
5. Programming with ABAP/4 and the DynPro Concept
6. Customizing R/3: Concepts and Techniques
7. Process and System Architecture

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 93

R/3 Layered Architecture

R/3 Business
ABAP/4 Applications
Developm.
Work-
Workbench CCMS
flow
Function
Modules

R/3 Middleware

System Software

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 94

www.sts.tu-harburg.de/~f.matthes/r3.html 47
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Three-Tier Client/Server-Architecture of R/3


Window
manager X-Terminals

SAPGUI SAPGUI SAPGUI


PC process process
process
Presentation server

DynPro processor Dispatcher DynPro processor


ABAP/4 interpreter ABAP/4 interpreter
Workprocess Workprocess

Application server

Central
booking RDBMS
process Database server
EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 95

Communication Protocols in R/3


Application
layer
Presentation RFC (remote function calls)
layer CPI-C (SAP implementation)
Session
layer
APPC
Transport
layer LU 6.2
TCP/IP
Network
layer

Data Link X.25


layer
Ether- ... Token- Ether- ... Token-
Physical net ring net ring
layer

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 96

www.sts.tu-harburg.de/~f.matthes/r3.html 48
EDBT‘98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer

Process Architecture

R/3 system

+1 +1

Presentation server Application server Database server

Dispatcher Message server Gateway server

+1

Work Process

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 97

Work Process
Dialog

Batch

Work Process Spool

Enqueue
Task Handler
Booking
DynPro
processor
Message
ABAP/4
processor

Database
interface

EDBT’98 - Tutorial: Understanding SAP R/3 © 1998 Florian Matthes, Stephan Ziemer - 98

www.sts.tu-harburg.de/~f.matthes/r3.html 49

Das könnte Ihnen auch gefallen