Inhaltsverzeichnis

Alle Kapitel aufklappen
Alle Kapitel zuklappen
Acknowledgments
21
Preface
23
The Objective of this Book
23
Target Audience
24
Structure of this Book
24
1 Introduction to ERP and SAP
29
1.1 Historical Overview
29
1.2 Understanding an ERP System
32
1.2.1 What Is ERP?
32
1.2.2 ERP vs. Non-ERP Systems
33
1.2.3 Advantages of an ERP System
35
1.3 Introduction to SAP
36
1.3.1 Modules in SAP
36
1.3.2 Types of Users
37
1.3.3 Role of an ABAP Consultant
38
1.3.4 Changing and Adapting the Data Structure
40
1.4 ABAP Overview
43
1.4.1 Types of Applications
43
1.4.2 RICEF Overview
43
1.5 System Requirements
48
1.6 Summary
48
2 Architecture of an SAP System
49
2.1 Introduction to the Three-Tier Architecture
49
2.2 SAP Implementation Overview
52
2.2.1 SAP GUI: Presentation Layer
52
2.2.2 Application Servers and Message Servers: Application Layer
54
2.2.3 Database Server/RDBMS: Database Layer
61
2.3 Data Structures
64
2.3.1 Client Overview
64
2.3.2 Client-Specific and Cross-Client Data
65
2.3.3 Repository
68
2.3.4 Packages
68
2.3.5 Transport Organizer
70
2.4 Summary
75
3 Introduction to the ABAP Environment
77
3.1 SAP Environment
78
3.1.1 ABAP Programming Environment
78
3.1.2 Logging On to the SAP Environment
78
3.1.3 Elements of the SAP Screen
79
3.1.4 Transaction Codes
82
3.1.5 Navigating and Opening Transactions
83
3.2 ABAP Workbench Overview
87
3.2.1 ABAP Editor
88
3.2.2 Function Builder
90
3.2.3 Class Builder
91
3.2.4 Screen Painter
92
3.2.5 Menu Painter
95
3.2.6 ABAP Data Dictionary
96
3.2.7 Object Navigator
98
3.3 Eclipse IDE Overview
99
3.4 Summary
105
4 ABAP Programming Concepts
107
4.1 General Program Structure
108
4.1.1 Global Declarations
108
4.1.2 Procedural
109
4.2 ABAP Syntax
110
4.2.1 Basic Syntax Rules
110
4.2.2 Chained Statements
111
4.2.3 Comment Lines
112
4.3 ABAP Keywords
113
4.4 Introduction to the TYPE Concept
114
4.4.1 Data Types
115
4.4.2 Data Elements
130
4.4.3 Domains
134
4.4.4 Data Objects
137
4.5 ABAP Statements
141
4.6 Creating Your First ABAP Program
143
4.7 Summary
149
5 Structures and Internal Tables
151
5.1 Defining Structures
152
5.1.1 When to Define Structures
154
5.1.2 Local Structures
155
5.1.3 Global Structures
158
5.1.4 Working with Structures
162
5.1.5 Use Cases
163
5.2 Internal Tables
164
5.2.1 Defining Internal Tables
164
5.2.2 Types of Internal Tables
167
5.2.3 Table Keys
171
5.2.4 Working with Internal Tables
175
5.2.5 Control Break Statements
182
5.3 Introduction to Open SQL Statements
187
5.3.1 Database Overview
189
5.3.2 Selecting Data from Database Tables
198
5.3.3 Selecting Data from Multiple Tables
200
5.4 Processing Data from Database via Internal Tables and Structures
203
5.5 Introduction to the Debugger
205
5.6 Practice
209
5.7 Summary
209
6 User Interaction
211
6.1 Selection Screen Overview
212
6.1.1 PARAMETERS
214
6.1.2 SELECT-OPTIONS
221
6.1.3 SELECTION-SCREEN
229
6.1.4 Selection Texts
230
6.2 Messages
231
6.2.1 Types of Messages
231
6.2.2 Messages Using Text Symbols
233
6.2.3 Messages Using Message Classes
235
6.2.4 Dynamic Messages
237
6.2.5 Translation
238
6.3 Summary
239
7 Modularization Techniques
241
7.1 Modularization Overview
242
7.2 Program Structure
245
7.2.1 Processing Blocks
246
7.2.2 Event Blocks
258
7.2.3 Dialog Modules
260
7.2.4 Procedures
261
7.3 Events
261
7.3.1 Program Constructor Events
262
7.3.2 Reporting Events
262
7.3.3 Selection Screen Events
269
7.3.4 List Events
270
7.3.5 Screen Events
271
7.4 Procedures
272
7.4.1 Subroutines
274
7.4.2 Function Modules
284
7.4.3 Methods
293
7.5 Inline Declarations
300
7.5.1 Assigning Values to Data Objects
301
7.5.2 Using Inline Declarations with Table Work Areas
301
7.5.3 Avoiding Helper Variables
302
7.5.4 Declaring Actual Parameters
302
7.6 Summary
303
8 Object-Oriented ABAP
305
8.1 Introduction to Object-Oriented Programming
305
8.1.1 Classes
308
8.1.2 Methods
313
8.1.3 Instance and Static Components
320
8.1.4 Events
322
8.2 Encapsulation
325
8.2.1 Component Visibility
326
8.2.2 Friends
329
8.2.3 Implementation Hiding
332
8.3 Inheritance
335
8.3.1 Inheriting Components
336
8.3.2 Abstract Classes and Methods
341
8.3.3 Final Classes and Methods
344
8.3.4 Composition
345
8.3.5 Refactoring Assistant
346
8.4 Polymorphism
347
8.4.1 Static and Dynamic Types
348
8.4.2 Casting
350
8.4.3 Dynamic Binding with the CALL Method
354
8.4.4 Interfaces
357
8.5 Working with XML
362
8.5.1 XML Overview
362
8.5.2 XML Processing Concepts
364
8.6 Summary
366
9 Exception Handling
369
9.1 Exceptions Overview
369
9.2 Procedural Exception Handling
370
9.2.1 Maintaining Exceptions Using Function Modules
370
9.2.2 Maintaining Exceptions Using Methods
373
9.2.3 Maintaining Exceptions for Local Classes
374
9.3 Class-Based Exception Handling
375
9.3.1 Raising Exceptions
376
9.3.2 Catchable and Non-Catchable Exceptions
378
9.3.3 Defining Exception Classes Globally
383
9.3.4 Defining Exception Classes Locally
386
9.4 Messages in Exception Classes
387
9.4.1 Using the Online Text Repository
387
9.4.2 Using Messages from a Message Class
390
9.4.3 Using the MESSAGE Addition to Raise an Exception
393
9.5 Summary
393
10 ABAP Data Dictionary
395
10.1 Database Tables
396
10.1.1 Creating a Database Table
399
10.1.2 Indexes
409
10.1.3 Table Maintenance Generator
414
10.1.4 Foreign Keys
418
10.1.5 Include Structure
422
10.1.6 Append Structure
424
10.2 Views
426
10.2.1 Database Views
427
10.2.2 Projection Views
429
10.2.3 Maintenance Views
431
10.2.4 Help Views
433
10.2.5 ABAP CDS Views
434
10.3 Data Types
438
10.3.1 Data Elements
439
10.3.2 Structures
443
10.3.3 Table Types
446
10.4 Type Groups
450
10.5 Domains
451
10.6 Search Helps
455
10.6.1 Elementary Search Helps
457
10.6.2 Collective Search Helps
461
10.6.3 Assigning a Search Help
463
10.6.4 Search Help Exits
464
10.7 Lock Objects
465
10.8 Summary
469
11 Persistent Data
471
11.1 Working with Data in Databases
472
11.1.1 Open SQL
474
11.1.2 Logical Unit of Work
485
11.2 ABAP Object Services
492
11.2.1 Persistence Service Overview
493
11.2.2 Building Persistent Classes
493
11.2.3 Working with Persistent Objects
498
11.3 File Interfaces
498
11.3.1 Working with Files in the Application Server
499
11.3.2 Working with Files in the Presentation Layer
501
11.4 Data Clusters
503
11.4.1 Exporting Data Clusters to Databases
505
11.4.2 Importing Data Clusters
506
11.5 Security Concepts
506
11.6 Summary
508
12 Dialog Programming
509
12.1 Screen Events
510
12.2 Screen Elements and Flow Logic
513
12.2.1 Components of a Dialog Program
515
12.2.2 Screens
520
12.2.3 Screen Elements
525
12.3 Basic Screen Elements
529
12.3.1 Text Fields
530
12.3.2 Checkboxes and Radio Buttons
531
12.3.3 Push Button
533
12.4 Input/Output Fields
534
12.5 List Box
536
12.6 Table Controls
537
12.6.1 Create a Table Control without a Wizard
538
12.6.2 Create a Table Control with a Wizard
542
12.7 Tabstrip Controls
544
12.8 Subscreens
545
12.9 Working with Screens
547
12.9.1 Screen Flow Logic
548
12.9.2 GUI Status
550
12.9.3 GUI Title
552
12.9.4 Modifying Screen Fields Dynamically
553
12.9.5 Field Help and Input Help
555
12.9.6 Screen Sequence
556
12.9.7 Assigning Transaction Codes
558
12.10 Control Framework
560
12.10.1 Using Container Controls
561
12.10.2 Implementing Custom Controls
562
12.11 Practice
564
12.11.1 Application Flow
566
12.11.2 Delete Functionality
567
12.11.3 Validations and Autofills
567
12.12 Summary
568
13 List Screens
569
13.1 Program Types
570
13.1.1 Executable Programs
571
13.1.2 Module Pool Programs
572
13.1.3 Function Groups
572
13.1.4 Class Pools
573
13.1.5 Interface Pools
573
13.1.6 Subroutine Pools
573
13.1.7 Type Pools
574
13.1.8 Include Programs
574
13.2 Program Execution
574
13.2.1 Executable Program Flow
575
13.2.2 Module Pool Program Flow
576
13.2.3 Calling Programs Internally
577
13.3 Memory Organization
578
13.4 List Events
582
13.4.1 TOP-OF-PAGE
583
13.4.2 END-OF-PAGE
585
13.4.3 AT LINE-SELECTION
586
13.4.4 AT USER-COMMAND
586
13.5 Basic Lists and Detail Lists
588
13.6 Classical Reports
592
13.7 Interactive Reports
592
13.7.1 HIDE
592
13.7.2 READ LINE
596
13.7.3 GET CURSOR
597
13.7.4 DESCRIBE LIST
597
13.8 Practice
598
13.9 Summary
599
14 Selection Screens
601
14.1 Defining Selection Screens
602
14.2 Selection Screen Events
604
14.3 Input Validations
606
14.4 Selection Screen Variants
608
14.4.1 Creating a Variant
609
14.4.2 Variant Attributes
613
14.4.3 Table Variables from Table TVARVC
614
14.4.4 Dynamic Date Calculation
616
14.4.5 Dynamic Time Calculation
617
14.4.6 User-Specific Variables
618
14.5 Executing Programs in the Background
619
14.6 Displaying and Hiding Screen Elements Dynamically
621
14.7 Calling Programs via Selection Screens
623
14.8 Summary
623
15 ALV Reports
625
15.1 Standard ALV Reports Using the Reuse Library
626
15.1.1 List and Grid Display: Simple Reports
627
15.1.2 Block Display
636
15.1.3 Hierarchical Sequential Display
640
15.2 Interactive Reports
644
15.2.1 Loading a Custom SAP GUI Status
645
15.2.2 Reacting to User Actions
649
15.2.3 Printing TOP-OF-PAGE
650
15.3 ALV Reports Using the Control Framework
650
15.4 ALV Object Model
653
15.4.1 Table Display
654
15.4.2 Hierarchical Display
655
15.4.3 Tree Object Model
659
15.5 Summary
661
16 Dynamic Programming
663
16.1 Field Symbols
665
16.1.1 Using Field Symbols to Make Programs Dynamic
666
16.1.2 Defining Field Symbols
673
16.1.3 Assigning a Data Object
674
16.1.4 Checking if a Field Symbol is Assigned
677
16.1.5 Unassigning a Field Symbol
678
16.1.6 Casting
678
16.2 Data References
679
16.2.1 Defining Reference Variables
680
16.2.2 Getting Data References
681
16.2.3 Anonymous Data Objects
682
16.2.4 Assignment between Reference Variables
684
16.3 Runtime Type Services
685
16.3.1 Runtime Type Information
686
16.3.2 Runtime Type Creation
687
16.4 Dynamic Token Specification
691
16.5 Dynamic Procedure Calls
693
16.6 Dynamic Program Generation
695
16.7 Summary
697
17 Debugging
699
17.1 Classic Debugger
700
17.1.1 Activating and Using the Classic Debugger
701
17.1.2 Field View
705
17.1.3 Table View
705
17.1.4 Breakpoints View
706
17.1.5 Watchpoints View
707
17.1.6 Calls View
708
17.1.7 Overview View
708
17.1.8 Settings View
708
17.1.9 Additional Features
710
17.2 New Debugger
714
17.2.1 UI and Tools
714
17.2.2 Layout and Sessions
717
17.3 AMDP Debugger
718
17.4 Using the Debugger to Troubleshoot
719
17.5 Using the Debugger as a Learning Tool
721
17.6 Summary
722
18 Forms
723
18.1 SAPscripts
725
18.1.1 Overview and Layout
725
18.1.2 Creating the Form Layout
729
18.1.3 Maintaining Window Details
736
18.1.4 Processing Forms with Function Modules
741
18.2 Smart Forms
749
18.2.1 Overview and Layout
750
18.2.2 Maintaining the Global Settings
753
18.2.3 Maintaining Elements
756
18.2.4 Driver Program
774
18.3 SAP Interactive Forms by Adobe
777
18.3.1 Form Interface
778
18.3.2 Form Context and Layout
785
18.3.3 Driver Program
797
18.3.4 Downloading the Form as a PDF
799
18.4 Summary
800
19 Interfaces
803
19.1 Batch Data Communication
804
19.1.1 Direct Input
806
19.1.2 Batch Input
807
19.2 Business Application Programming Interface
819
19.2.1 Business Object Types and Business Components
819
19.2.2 BAPI Development via BAPI Explorer
820
19.2.3 Standardized BAPIs
823
19.2.4 Standardized Parameters
824
19.2.5 Implementing BAPIs
826
19.3 EDI/ALE/IDocs
835
19.3.1 Electronic Data Interchange
836
19.3.2 Application Link Enabling
841
19.3.3 Intermediate Documents
844
19.3.4 System Configurations
856
19.3.5 Inbound/Outbound Programs
863
19.4 Legacy System Migration Workbench
867
19.4.1 Getting Started
868
19.4.2 Migration Process Steps
869
19.5 Web Services
880
19.5.1 Creating a Web Service
884
19.5.2 Consuming Web Services
888
19.6 OData Services
895
19.6.1 Data Model Definition
897
19.6.2 Service Maintenance
901
19.6.3 Service Implementation
903
19.6.4 READ
905
19.7 XSL Transformations
908
19.7.1 Serialization
909
19.7.2 Deserialization
910
19.8 XML and JSON Data Representation
911
19.9 WebSockets (ABAP Channels and Messages)
913
19.9.1 Creating an ABAP Messaging Channel
914
19.9.2 Creating a Producer Program
916
19.9.3 Creating a Consumer Program
917
19.10 Summary
920
20 Modifications and Enhancements
921
20.1 Customization Overview
921
20.2 Modification Overview
923
20.3 Using Modification Assistant
924
20.3.1 Modifications to Programs
925
20.3.2 Modifications to Class Builder
927
20.3.3 Modifications to Screen Painter
928
20.3.4 Modifications to Menu Painter
929
20.3.5 Modifications to ABAP Data Dictionary
929
20.3.6 Modifications to Function Modules
930
20.3.7 Resetting to Original
931
20.4 Using Modification Browser
932
20.5 Enhancements Overview
933
20.6 User Exits
935
20.7 Customer Exits
936
20.7.1 Create a Customer Exit
939
20.7.2 Function Module Exits
942
20.7.3 Screen Exits
942
20.7.4 Menu Exits
944
20.8 BAdIs
946
20.8.1 Overview
946
20.8.2 Defining a BAdI
948
20.8.3 Implementing a BAdI
955
20.8.4 Implementing a Fallback Class
958
20.8.5 Calling a BAdI
959
20.9 Enhancement Points
960
20.9.1 Explicit Enhancements
961
20.9.2 Implicit Enhancements
963
20.10 Business Transaction Events
966
20.10.1 Implementing a BTE
967
20.10.2 Testing a Custom Function Module
971
20.11 Summary
972
21 Test and Analysis Tools
973
21.1 Overview of Tools
974
21.2 ABAP Unit
976
21.2.1 Eliminating Dependencies
977
21.2.2 Implementing Mock Objects
979
21.2.3 Writing and Implementing Unit Tests
980
21.3 Code Inspector
987
21.4 Selectivity Analysis
990
21.5 Process Analysis
992
21.6 Memory Inspector
995
21.6.1 Creating Memory Snapshots
995
21.6.2 Comparing Memory Snapshots
996
21.7 Table Call Statistics
997
21.8 Performance Trace
1000
21.8.1 Activating and Filtering a Performance Trace
1001
21.8.2 SQL Trace
1004
21.8.3 RFC Trace
1006
21.8.4 Enqueue Trace
1007
21.8.5 Buffer Trace
1008
21.9 ABAP Trace/Runtime Analysis
1009
21.9.1 Running ABAP Trace
1009
21.9.2 Analyzing the Results
1011
21.10 Single-Transaction Analysis
1014
21.11 Dump Analysis
1017
21.12 Summary
1019
The Author
1021
Index
1023