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
[email protected]
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 2
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 4
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.
© 1998 Florian Matthes, Stephan Ziemer - 5
EDBT’98 - Tutorial: Understanding SAP R/3
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, Germany
< 1 sec response time with 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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 6
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 8
4
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
The End-User's Perspective
© 1998 Florian Matthes, Stephan Ziemer - 9
EDBT’98 - Tutorial: Understanding SAP R/3
R/3 Applications and their Technological Basis
SD MM
Sales & Distr.
FI Finances
CO
Materialmanagment
Controlling
PP
R/3 Applications
AM
Production Plannig .
R/3 BASIS
QM
PS
Qualitymanagement.
Middleware
Project system
PM
WF Workflow
HR Human Resources
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
IS
Hardware, Network, Operating System, Database © 1998 Florian Matthes, Stephan Ziemer - 10
5
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
System Platforms Supported by R/3 UNIX Systems Bull IBM Digital SNI HP SUN
Hardware
Operating Systems
Bull/Zenith Compaq Data General ...
AIX Reliant Digital UNIX UNIX (SINIX) HP-UX SOLARIS
Databases
ADABAS D DB2 for AIX INFORMIX-OnLine ORACLE
Dialog SAPGUI
NCR Digital HP (Intel) Sequent IBM (Intel) SNI
Windows NT
ADABAS D MS SQL Server INFORMIX-OnLine ORACLE
IBM AS/400
IBM S/390
OS/400
OS/390
DB2 for OS/400
DB2 for OS/390
Windows 3.1, Windows 95, Windows NT, 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 © 1998 Florian Matthes, Stephan Ziemer - 11
EDBT’98 - Tutorial: Understanding SAP R/3
Three-Tier Client/Server-Architecture of R/3 Window manager SAPGUI process
PC
X-Terminals SAPGUI process
SAPGUI process
Presentation server
DynPro processor
Dispatcher
DynPro processor
ABAP/4 interpreter
ABAP/4 interpreter
Work process
Work process
Application server Central booking process EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
RDBMS
Database server © 1998 Florian Matthes, Stephan Ziemer - 12
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 14
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
FI
HR
TR
......
Repository
...
......
Runtime Environment © 1998 Florian Matthes, Stephan Ziemer - 15
EDBT’98 - Tutorial: Understanding SAP R/3
R/3 Tools
Customizing
R/3Tools
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
Development
Business Engineering
© 1998 Florian Matthes, Stephan Ziemer - 16
8
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Concepts and Languages of the R/3 Repository Analysis Level
Design Level
EventControlled Process Chain (EPC)
Implementation Level Development class
Business Engineering
} } }
[ Business Objects ]
SAP Module
ABAP/4
"Real World"
SAP SERM
Data Dictionary
Process View Function View
Data View
SQL
R/3 Repository Data Dictionary © 1998 Florian Matthes, Stephan Ziemer - 17
EDBT’98 - Tutorial: Understanding SAP R/3
Objects of the R/3 Repository Analysis Level
Design Level
Implementation Level
Workflow
Event, Function, ...
Transaction
Program, Report, ...
"Real World"
Table, Domain, Foreign Key, ...
Entity, Relationship
Manual
Manual
ABAP/4 Variable, SQL Table, ... ToolSupported
} } }
Process View Function View
Data View
Consistency Maintenance between Levels
}
R/3 Repository EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 18
9
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Repository Information System
© 1998 Florian Matthes, Stephan Ziemer - 19
EDBT’98 - Tutorial: Understanding SAP R/3
OMT-Notation Class:
Class Name
Generalization:
Superclass
Attributes Operations
Subclass-1 Instance:
Subclass-2
(Class Name) Instance Name
Multiplicity of associations:
Association: Class 1
Association name Role 1
Role 2
Class
Exactly one
Class
Many (≥0)
Class
Optional (0 oder 1)
+1
Class
One or more
1-2,4
Class
Numerically specified
Class 2
Aggregation: Assembly Class
Part-1-Class Part-2-Class EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 20
10
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
R/3 Repository and Data Dictionary Repository Data Dictionary
Application Object Name
Development Class
ABAP/4 Dictionary Object
Development Class Object
State
Transport()
Owner
Transport() © 1998 Florian Matthes, Stephan Ziemer - 21
EDBT’98 - Tutorial: Understanding SAP R/3
Clients in R/3
Client with separate data
Transport
Client with separate data
New Release from SAP
Client with separate data
R/3 system containing shared data Client with separate data
Naming Conventions! Client: A business entity in the R/3 system.
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 22
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 Data Element Matchcode Object Matchcode Id Pool-/Cluster Table Lock Object Structure Transparent Table Append Field View Help View
10 10 4 1 10 10 10 10 10 10 10 10
Y*, Z* Y*, Z* Y*, Z* A-Z,0-9 Y*, Z* EY*, EZ* Y*, Z*, T9*, P9* Y*, Z*, T9*, P9* Y*, Z* YY*, ZZ* Y*, Z* H_Y*, H_Z*
YNAME, Z1234 ZNAME, YNAME12 YMCO, ZMCO YMCO1, ZMCOG YPOOL, ZCLUSTER EYNAME, EZNAME YSTRUKT, ZSTR123 YTAB1, ZTAB2 ZAPPEND, YAPPEND ZZFELD, YYFELD YVIEW, ZVIEW H_YVIEW, H_ZVIEW
© 1998 Florian Matthes, Stephan Ziemer - 23
EDBT’98 - Tutorial: Understanding SAP R/3
Running Example: FM Areas and Funds Center Financial Management Area
Funds Center
e.g,, CS department
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 24
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
© 1998 Florian Matthes, Stephan Ziemer - 25
EDBT’98 - Tutorial: Understanding SAP R/3
Relationships in the SAP SERM Data Model A H
Hierarchical Aggregating
R
Referential
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
Is a
© 1998 Florian Matthes, Stephan Ziemer - 26
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
© 1998 Florian Matthes, Stephan Ziemer - 27
EDBT’98 - Tutorial: Understanding SAP R/3
R/3 Data Model for FM Areas No Updates through Applications Application Data Entity Number 19013 Language
V
View R
12340 Financial Management Area 19031 Currency
AV H
12410 AV Funds Center
AV R
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 28
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
Maintained by
AM
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 30
15
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Event-Controlled Process Chains
R Logical connectives
R Functions Function
R Events
/\
\/
\/
AND
OR
XOR
Event
R Organization Unit Types Organizational Unit
R Information Objects Input / Output © 1998 Florian Matthes, Stephan Ziemer - 31
EDBT’98 - Tutorial: Understanding SAP R/3
Example: Transaction-Level EPC new Funds center to be created choose FM area FM area exists /\ choose responsible person
choose superordinated funds center
choose fund
/\ new Funds center created EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 32
16
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Example: Workflow-Level EPC Finanzierungszweck ist anzulegen
TR Finanzierungszweckbearbeitung
Finanzierungszweck ist erzeugt
Budgets sind zu planen
Fonds ist anzulegen
Finanzposition ist anzulegen
Finanzstelle ist anzulegen
Budgetstatus ist zu pflegen
Budgetträger ist anzulegen
TR Finanzpositionsbearbeitung
TR Finanzstellenbearbeitung
TR Fondsbearbeitung
TR Statusverwaltung
TR Budgetträgerbearbeitung
Finanzposition ist erzeugt
Finanzstelle ist erzeugt
Fonds ist erzeugt
Anwenderstatus liegt vor
Budgetträger liegt vor
Budget wird nicht komplett benötigt
Budgetrückgabe ist durchzuführen
B u d g e t u m b u c h u ng ist durchzuführen
TR Budgetversionsbearbeitung
Weitere finanzielle Mittel erden benötigt
Budgetnachtrag ist durchzuführen
Budgetversion liegt vor
Budgets sind bewilligt
TR Originalbudgetpflege (alle Versionen)
TR Budgetrückgabe
TR B u d g e t u m b u c h u ng
TR Budgetnachtrag
Originalbudget liegt vor
Budgetrückgabe liegt vor
B u d g e t u m b u c h u ng ist abgeschlossen
Budgetnachtrag liegt vor
TR Budgetreigabe
Budgetfreigabe liegen vor
Kreditorenabwicklung
Debitorenabwicklung
XOR
XOR
Verbrauchsmaterialabwicklung
Lagermaterialabwicklung
Lohnbearbbeitungsabwicklung
Dienstleistungsabwicklung
Streckenabwicklung
XOR
XOR
XOR
KreditorAnzahlungsanforderung ist erstellt
Zahlung ist gebucht
BANF mit Lieferplannummer ist erstellt
Anzahlung ist gebucht
Jahresendbericht ist erforderlich
Monatsbericht ist erforderlich
BANF mit Kontraktnummer ist erstellt
BANF mit Lieferant ist erstellt
BANF ohne Bezugsquelle ist erstellt
Bestellun g ist angelegt
Material ist in Lagerbestand gebucht
Material ist in Verbaruch gebucht
Streckenwaren. eingang ist abgeschlossen
Rechnung ist gebucht und zur Zahlung freigegeben
Mittelreservierung ist durchzuführen
Buchungsfehler liegt vor
Individuelle toleranzen sind zuzuweisen
TR Mittelreservierung
TR Zahlungsumbuchung
TR Zuordnung individuelle Toleranzen
Mittelreservierung liegt vor
Umbuchung ist abgeschlossen
Toleranzen liegen vor
Ad hoc-Bericht ist erforderlich
Prozesswegweiser
Ereignis
TR Berichte
XOR
Budget-GrößenVergleich liegt vor
Budget-PeriodenVergleich liegt vor
Budget-JahresVergleich liegt vor
BudgettypenVergleich liegt vor
Budget/IstVergleich liegt vor
© 1998 Florian Matthes, Stephan Ziemer - 33
EDBT’98 - Tutorial: Understanding SAP R/3
SAP Transactions (Logical Unit of Work) BOT
EOT
Input Mask 1
Input Mask 2
Input Mask 3
DB-TA
DB-TA
DB-TA
Time
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 34
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
© 1998 Florian Matthes, Stephan Ziemer - 35
EDBT’98 - Tutorial: Understanding SAP R/3
Data Modeling Objects in the Data Dictionary Data Dictionary Object Status
...
View +1 Type Join-cond.
+1
Field
+1
Name
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
Domain
Data Element defines Values
Has check table
Table
© 1998 Florian Matthes, Stephan Ziemer - 36
18
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Domains and Data Elements
relevance for "business" Data Element
Data Element
sending account
receiving account
Data Element
Data Element
FIKRS
FM_FICTR
Domain
Domain
KOSTL
FIKRS
CHAR(10)
CHAR(4)
Domain FISTL CHAR(16)
relevance for "implementation"
© 1998 Florian Matthes, Stephan Ziemer - 37
EDBT’98 - Tutorial: Understanding SAP R/3
Types of Tables Table
Pool Table Transparent Table
+1
Table Pool
Cluster Table +1
Table Cluster
implemented by implemented by
implemented by
SQL-Table
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 38
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
} © 1998 Florian Matthes, Stephan Ziemer - 39
EDBT’98 - Tutorial: Understanding SAP R/3
Visibility of Tables Table A
Table A (transparent)
Table B
Table C
Table B (Cluster-Tab.)
Table C (Cluster-Tab.)
ABAP/4
Data Dictionary
Table-Cluster
Table A
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
Table
Database
© 1998 Florian Matthes, Stephan Ziemer - 40
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. © 1998 Florian Matthes, Stephan Ziemer - 41
EDBT’98 - Tutorial: Understanding SAP R/3
Example: Table FMFCTR (1) Field Name Key Type
Data Element Domain
Text
MANDT
X
CLNT
Length 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
DATS
8
FM_ERFDAT
DATUM
FIFM: Exists since
ERFDAT AENDAT
DATS
8
FM_AENDAT
DATUM
FIFM: Date of Change
BOSS_CO DE LAND1
NUMC
8
CHAR
3
FM_BOSSCO D LAND1
PS_VER NR LAND1
FIFM: Code of repsonible Person Country Key
TELEFAX
CHAR
31
TELEFX
TEXT31
Fax Number
...
...
...
...
...
...
Delivery Class: A Transparent Table EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 42
21
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Example: Table FMFCTR (2)
© 1998 Florian Matthes, Stephan Ziemer - 43
EDBT’98 - Tutorial: Understanding SAP R/3
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
LAND1
T005
1:1 (!?)
FIFM: Responsible Person for Fund Center FIFM: Country
...
...
...
...
12340 Data Model:
AV
H
FM Area
12410
AV
Funds Center
IFMFCTR is a structure complying with table FMFCTR. EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 44
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 46
23
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Data Types in the Data Dictionary Data Dictionary Object
...
... Type Groups
Domain Based on
Data Type
External Type
ABAP/4 Data Type
Header Line
Internal Table
FieldSymbol
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 CHAR CLNT CUKY CURR DATS DEC FLTP INT1 INT2 INT4 LANG LCHR LRAW NUMC PREC QUAN RAW TIMS UNIT VARC
6 <256 3 5 <18 8 <18 16 3 5 10 1 >255 >255 <256 2 17 <256 6 2 or 3
Posting period. The format is YYYYMM. Character string. Client. Currency key. Currency field. Must point to a field of type CUKY. Date. Counter or amount field. Floating-point number. 1-byte integer between 0 and 255. 2-byte integer between -32767 and 32767. 4-byte integer between -2177483647 and 2177483647. Language key. Character string of arbitrary length. Uninterpreted byte string of arbitrary length. Character field in which only numbers can be entered. Accuracy of a QUAN field. Quantity. Must always point to a units field with UNIT format Uninterpreted sequence of bytes. Time. Units key. No longer supported. (version 3.0)
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 48
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 CHAR n CLNT CUKY CURR n,m,s DATS DEC n,m,s FLTP INT1/2/4 LANG LCHAR LRAW NUMC n PREC QUAN n,m,s RAW n TIMS UNIT
N(6) C(n) C(3) C(5) P((n+2)/2) DECIMALS m (NO-SIGN) D(8) P((n+2)/2) DECIMALS m (NO-SIGN) F(8) I C(1) C(n) X(n) N(n) --P((n+2)/2) DECIMALS m (NO-SIGN) X(n) T(6) 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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 50
25
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Orthogonality of the Type Concept Atomic Type Header Line internal Tab. Naming Variable Declaration global local Parameter Passing by Value by Reference Embedding in Header Line Internal Table SQL-Table Copy as a whole Displayable
SQL-Table
X
X
X
--
X X
X X
X X
by Name
X X
X X
-X
---
X X X X X
X X X X --
---X --
--X ---
by Name
© 1998 Florian Matthes, Stephan Ziemer - 51
EDBT’98 - Tutorial: Understanding SAP R/3
Implementation-Oriented Objects Data Dictionary Object Status
... includes
Table
includes
Structure
Data Element
includes appends +1
+1
Field
Field
Name
Name
Lock Object has Primary Table
has Secondary Table
Matchcode Object has Primary Table
has Secondary Table
1-36
ID Projection Select condition
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 52
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, FMFCTRDATBIS
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 54
27
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Example: FIKR Input requested: Code for FM Area (FM01-FIKRS).
Computer Science F18
FM Area:
FM Area:
F18
Eingabehilfe (F4) Uses Tables: FM01: FM Areas MANDT
... 010 ...
FM01T: Descriptions of FM Areas
FIKRS
...
...
...
...
F18 ...
... ...
010 ...
EDBT’98 - Tutorial: Understanding SAP R/3
MANDT FIKRS SPRAS
...
...
F18 ...
D ...
FIXTXT
...
...
...
Comp.Sc. ... ... ... © 1998 Florian Matthes, Stephan Ziemer - 55
Example: FIKR
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 56
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 FM01 * Secondary Table
SELECT FM01.FIKRS,FM01T.SPRAS, FM01T.FIXTXT FROM FM01, FM01T WHERE FM01.FIKRS=FM01T.FIKRS AND FM01.MANDT=FM01T.MANDT (INTO M_FIKR)
FM01T *FM01-FIKRS is a foreign key for FM01T-FIKRS • Fields used by Matchcode: Table Fieldname FM01 MANDT FM01 FIKRS FM01T SPRAS FM01T FIXTXT FM01T SPRAS
MC-Field MANDT FIKRS SPRAS FIXTXT SPRAS3
EDBT’98 - Tutorial: Understanding SAP R/3
Search field X
Key X X X
© 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 • Secondary Tables: FM01T • MC-View Name: M_FIKRB • Fields: FM01-MANDT, FM01T-FIXTXT, FM01TSPRAS, FM01-FIKR • No selection
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
SELECT FIXTXT,SPRAS,FIKRS FROM M_FIKR
© 1998 Florian Matthes, Stephan Ziemer - 58
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 60
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
INTO .
© 1998 Florian Matthes, Stephan Ziemer - 61
EDBT’98 - Tutorial: Understanding SAP R/3
Development Class Objects Development Class Object Generate
..... Transaction
starts
Code
Function Group
Program object Version
Message Class
Logical Database
uses
Message
Authorization Object Report (REPORT/PROGRAM)
Number Function module (FUNCTION-POOL) Interface
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 62
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)
© 1998 Florian Matthes, Stephan Ziemer - 63
EDBT’98 - Tutorial: Understanding SAP R/3
Development Class Objects (continued) Development Class Object Generate
... Business EngeneeringObjekt
Dialog Box
SET-/GETParameter
Area Menu
Interface
calls
uses Program Object
Workflow
CATT Procedure
+1 GUI Status
Transaction
Data Model
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 64
32
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
GUI Status Object GUI Status
GUI Status Object
Function Key Assignment
Menu Bar
Standard Tool Bar
Application Tool Bar
Menu
Function Key
Function Key
Code
Code
+1 +1
Menu item
references
Code
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 66
33
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
R/3 Model for Interactive Transactions
...
DynPro A PBOEvent
DynPro A PAIEvent
DynPro B PBOEvent
DynPro B PAIEvent
ABAP/4Modules
ABAP/4Modules
ABAP/4Modules
ABAP/4Modules
DynPro A DB-TA
...
DynPro B DB-TA
DB-TA
DB-TA
Time © 1998 Florian Matthes, Stephan Ziemer - 67
EDBT’98 - Tutorial: Understanding SAP R/3
States of the R/3 DynPro Interpreter Leave to Transaction
Process Screen OK-CODE type T?
AT EXIT COMMAND
F4? F1? Execute PBO Modules
Transfer Data from ABAP/4 Variables into DynPro Fields
Subroutines
Offer Help
Transfer Data from DynPro Fields into ABAP/4 Variables
Lock certain DynPro Fields
OK-CODE type E?
Next
PBO
Execute PAI Modules MESSAGE type E? Subroutines
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 68
34
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Program Objects in Detail imports
Program Object Type, Version
Transaction
Logical Database
Starts with
Code Module Pool in ABAP/4
+1 PBO Module
DynPro Number
PAI Module
Subroutine (Form)
Screen Flow Logic
Global Data Type
GUI Title
GUI Status
Code
calls executes
+1 DynPro Field
exchange Data (equal Names)
EDBT’98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer - 69
Transaction FM2I, DynPro 100
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 70
35
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Transaction FM2I, DynPro 200
© 1998 Florian Matthes, Stephan Ziemer - 71
EDBT’98 - Tutorial: Understanding SAP R/3
Dialog-Oriented Programming in R/3
create Fund Center
PAI
PBO
Transaction FMI2
{
ABAP/4
Zeit
DynPro 100
next DynPro
MODULE D0100_INDEPENDENT
MODULE FM_FCTR_LESEN
MODULE D0100_MODIFY_SCREEN
MODULE D100_OK_CODE
MODULE D0100_SET_PF-STATUS
MODULE ...
Function Module SAPLFM22
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 72
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 74
37
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
DynPro Fields Field Name IFMFCTR-FIKRS IFMFCTR-FIKRS
Field Type Text I/O
Format CHAR CHAR
Length 15 4
IFMFCTR-FICTR IFMFCTR-FICTR
Text I/O
CHAR CHAR
15 10
OK_CODE
OKCODE
EDBT’98 - Tutorial: Understanding SAP R/3
Explanation shows "Finanzkreis" The superordinated FM Area is typed in here. Matchcode FIKR is used to provide help. shows "Finanzstelle" The funds center is typed in here. Matchcode FIST is used to provide help.
© 1998 Florian Matthes, Stephan Ziemer - 75
DynPro Attributes
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 76
38
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Flow Logic PROCESS BEFORE OUTPUT. MODULE D0100_INDEPENDENT. MODULE D0100_MOFIFY_SCREEN. MODULE D0110_SET_PF-STATUS.
PROCESS AFTER INPUT. MODULE D0100_EXIT AT EXIT-COMMAND. 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
PBO-Event
PAI-Event
© 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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 78
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. © 1998 Florian Matthes, Stephan Ziemer - 79
EDBT’98 - Tutorial: Understanding SAP R/3
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
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
}
Header Line A
Table }
Header Line B
© 1998 Florian Matthes, Stephan Ziemer - 80
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
move it1[] to it2[].
Set-Oriented
iterative
read it index 42.
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 82
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 84
42
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Branching in ABAP/4 DynPro PBO
PAI
DynPro default
PBO
PAI
DynPro default
PBO
PAI
SET SCREEN 200 LEAVE SCREEN
“GOTO”
DynPro PBO
DynPro PBO
PAI
default
PAI
PBO
DynPro default
PBO
PAI
DynPro
DynPro default
PBO
CALL SCREEN 200 LEAVE SCREEN
DynPro PBO
PAI SET SCREEN 0 LEAVE SCREEN
“GOSUB”
= is executed
PAI
default
PAI
EDBT’98 - Tutorial: Understanding SAP R/3
DynPro PBO
PAI
© 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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 86
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 88
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 90
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 92
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
© 1998 Florian Matthes, Stephan Ziemer - 93
EDBT’98 - Tutorial: Understanding SAP R/3
R/3 Layered Architecture
ABAP/4 Developm. Workbench Function Modules
R/3 Business Applications Workflow
CCMS
R/3 Middleware
System Software
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 94
47
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Three-Tier Client/Server-Architecture of R/3 Window manager SAPGUI process
PC
X-Terminals SAPGUI process
SAPGUI process Presentation server
Dispatcher
DynPro processor
DynPro processor
ABAP/4 interpreter
ABAP/4 interpreter
Workprocess
Workprocess Application server
Central booking process
RDBMS Database server © 1998 Florian Matthes, Stephan Ziemer - 95
EDBT’98 - Tutorial: Understanding SAP R/3
Communication Protocols in R/3 Application layer RFC (remote function calls)
Presentation layer
CPI-C (SAP implementation)
Session layer APPC Transport layer
LU 6.2 TCP/IP
Network layer Data Link layer Physical layer
X.25 Ethernet
...
EDBT’98 - Tutorial: Understanding SAP R/3
www.sts.tu-harburg.de/~f.matthes/r3.html
Tokenring
Ethernet
...
Tokenring
© 1998 Florian Matthes, Stephan Ziemer - 96
48
EDBT‘98 - Tutorial: Understanding SAP R/3
© 1998 Florian Matthes, Stephan Ziemer
Process Architecture R/3 system
+1
+1
Presentation server
Application server
Dispatcher
Message server
Database server
Gateway server
+1
Work Process
© 1998 Florian Matthes, Stephan Ziemer - 97
EDBT’98 - Tutorial: Understanding SAP R/3
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
www.sts.tu-harburg.de/~f.matthes/r3.html
© 1998 Florian Matthes, Stephan Ziemer - 98
49