Table Of ContentHorst Keller
The Official ABAP“ Reference
Galileo Press
Bonn •
Table of Contents
Preface ... 19
1 ... Introduction ... 23
1.1 ... Releases Used ... 23
1.2 ... New Features in Releases 7.02 and 7.2 ... 25
1.2.1 ... New Features in ABAP ... 25
1.2.2 ... New Features in Tools ... 28
1.3 ... Syntax Conventions in The Official ABAP Reference ... 30
PART 1 ... ABAP Overview ... 33
2 ... ABAP Programming Language ... 35
2.1 ... SAP NetWeaver ... 35
2.2 ... Scope and Usage Areas ... 36
2.3 ... Programming Models ... 37
2.4 ... Unicode ... 37
PART 2 ... ABAP Syntax ... 39
3... Statements ... 41
3.1 ... ABAP Words ... 42
3.2 ... Operands ... 42
3.2.1 ... Names for Single Operands ... 43
3.2.2 ... Specifying Single Operands ... 49
3.2.3 ... Operand Position and Type ... 50
3.2.4 ... Data Objects in Operand Positions ... 52
3.2.5 ... Functions and Expressions in Operand Positions ... 55
3.3 ... Operators and Expressions ... 59
3.3.1 ... Operators ... 59
3.3.2 ... Expressions ... 60
4 ... Names ... 61
4.1 ... Naming Conventions ... 61
4.2 ... Name Spaces ... 62
5 ... Chained Statements ... 63
6 ... Comments ... 65
7 ... Program Directives ... 67
7.1 ... Pragmas ... 67
7.1.1 ... Pragma Parameters ... 68
7.1.2 ... Positioning Pragmas ... 68
7.2 ... Pseudo Comments ... 69
PART 3 ... Program Structure ... 71
8 ... Program Structure ... 73
9 ... Programs ... 75
9.1 ... Standalone Programs ... 75
9.1.1 ... Program Types ... 75
9.1.2 ... Introductory Program Statement ... 76
9.2 ... Executable Programs ... 77
9.2.1 ... Additions for the Basic List of the Program ... 78
9.2.2 ... Addition for the Message Class ... 80
9.2.3 ... Addition for Subroutine Pools ... 80
9.3 ... Module Pools and Subroutine Pools ... 80
9.4 ... Function Groups ... 82
9.5 ... Class Pools ... 84
9.6 ... Interface Pools ... 85
9.7 ... Type Groups ... 86
10 ... Modularization ... 89
10.1 ... Procedures ... 89
10.1.1 ... Parameter Interface of Procedures ... 90
10.1.2 ... Method Implementation ... 92
10.1.3 ... Function Modules ... 93
10.2 ... Dialog Modules ... 99
10.3 ... Event Blocks ... 100
10.3.1 ... Program Constructor ... 101
10.3.2 ... Reporting Events ... 102
10.3.3 ... Selection Screen Events and List Events ... 106
10.4 ... Source Code Modules ... 107
10.4.1 ... Include Programs ... 107
10.4.2 ... Macros ... 109
11 ... Built-in Elements ... 113
11.1 ... Built-in Data Types ... 113
11.1.1 ... Built-in ABAP Types ... 113
11.1.2 ... Generic ABAP Types ... 118
11.1.3 ... Built-in Types in the ABAP Dictionary ... 120
11.2 ... Built-in Data Objects ... 131
11.2.1 ... ABAP System Fields ... 131
11.2.2 ... space, me, and screen ... 138
11.3 ... Built-in Functions ... 140
11.3.1 ... Syntax of Built-in Functions ... 140
11.3.2 ... Overview of Built-in Functions ... 141
PART 4 ... Declarative Statements ... 145
12 ... Types and Objects ... 147
12.1 ... Validity and Visibility ... 148
12.2 ... Absolute Type Names ... 149
12.3 ... Shared Objects ... 152
13 ... Data Types and Data Objects ... 153
13.1 ... Declaring Data Types ... 153
13.1.1 ... Defining Types with Predefined ABAP Types ... 154
13.1.2 ... Defining Types by Referring to Existing Types ... 155
13.1.3 ... Defining Reference Types ... 156
13.1.4 ... Defining Structured Types ... 158
13.1.5 ... Defining Table Types ... 164
13.1.6 ... Defining Ranges Table Types ... 174
13.1.7 ... Defining LOB Handle Structures ... 175
13.2 ... Declaring Data Objects ... 179
13.2.1 ... Literals ... 179
13.2.2 ... Declaring Variables ... 182
13.2.3 ... Declaring Constants ... 194
13.2.4 ... Declaring Static Data Objects in Procedures ... 195
13.2.5 ... Declaring Table Work Areas ... 196
13.2.6 ... Declaring Data Objects for HR Infotypes ... 200
14 ... Classes and Interfaces ... 203
14.1 ... Defining Classes ... 203
14.1.1 ... Declaration ... 204
14.1.2 ... Specifying Class Properties ... 205
14.1.3 ... Visibility Sections of Classes ... 213
14.1.4 ... Class Components ... 217
14.1.5 ... Implementation Section ... 218
14.1.6 ... Declaring Classes ... 220
14.1.7 ... Local Friends of Global Classes ... 221
14.2 ... Defining Interfaces ... 221
14.2.1 ... Definition ... 222
14.2.2 ... Interface Components ... 223
14.2.3 ... Declaring Interfaces ... 224
14.3 ... Declaring Components ... 224
14.3.1 ... Attributes and Data Types ... 224
14.3.2 ... Methods ... 226
14.3.3 ... Events ... 249
14.3.4 ... Interface Components ... 252
15 ... Field Symbols ... 259
16 ... Typing ... 261
16.1 ... Syntax of Typing ... 261
16.1.1 ... Generic Typing ... 262
16.1.2 ... Complete Typing ... 264
16.2 ... Checking the Typing ... 265
16.2.1 ... General Rules ... 265
16.2.2 ... Return Values of Functional Methods ... 267
16.2.3 ... Literals as Actual Parameters ... 268
16.2.4 ... Functions and Expressions as Actual Parameters ... 270
PART 5 ... Generating Objects ... 273
17 ... Creating Objects ... 275
17.1 ... Creating Data Objects ... 275
17.1.1 ... Defining the Data Type Implicitly ... 276
17.1.2 ... Defining the Data Type Through Built-in ABAP Types ... 277
17.1.3 ... Defining Data Through an Existing Type ... 278
17.1.4 ... Creating Data with Reference to a Type Object ... 280
17.1.5 ... Creating Reference Variables ... 281
17.1.6 ... Creating Internal Tables ... 282
17.1.7 ... Creating Shared Objects ... 284
17.1.8 ... Treatable Exceptions ... 287
17.2 ... Creating Instances of Classes ... 287
17.2.1 ... Specifying the Class Implicitly ... 288
17.2.2 ... Specifying the Class Explicitly ... 289
17.2.3 ... Creating Shared Objects ... 290
17.2.4 ... Static Parameter Passing ... 291
17.2.5 ... Dynamic Parameter Passing ... 292
17.2.6 ... Treatable Exceptions ... 294
PART 6 ... Executing Program Units ... 295
18 ... Calling Programs ... 297
18.1 ... Calling Executable Programs ... 297
18.1.1 ... Processing an Executable Program ... 297
18.1.2 ... Calling of an Executable Program ... 299
18.2 ... Calling Transactions ... 315
18.2.1 ... Calling a Transaction with Returning to the Calling Program ... 315
18.2.2 ... Calling a Transaction without Returning to the Calling Program ... 321
19 ... Calling Processing Blocks ... 323
19.1 ... Calling Procedures ... 323
19.1.1 ... Internal and External Procedure Call ... 323
19.1.2 ... Calling Methods ... 327
19.1.3 ... Calling Function Modules ... 341
19.1.4 ... Calling Subroutines ... 349
19.2 ... Calling Event Handlers ... 354
19.2.1 ... Triggering Events ... 354
19.2.2 ... Registering Event Handlers ... 355
19.3 ... Calling Event Blocks ... 359
20 ... Exiting Program Units ... 361
20.1 ... Leaving Programs ... 361
20.2 ... Exiting Processing Blocks ... 362
20.2.1 ... Terminating Processing Blocks Normally ... 362
20.2.2 ... Exiting Processing Blocks Unconditionally ... 363
20.2.3 ... Exiting Processing Blocks Conditionally ... 366
20.3 ... Exiting Loops ... 368
20.3.1 ... Exiting Loops Unconditionally ... 368
20.3.2 ... Exiting Loop Passes Unconditionally ... 369
20.3.3 ... Exiting Loop Passes Conditionally ... 370
PART 7 ... Program Flow Control ... 371
21 ... Logical Conditions ... 373
21.1 ... Logical Expressions ... 373
21.1.1 ... Comparisons ... 374
21.1.2 ... Predicates ... 388
21.1.3 ... Evaluating Selection Tables ... 393
21.1.4 ... Boolean Operators and Brackets ... 395
21.2 ... Logical Functions ... 400
21.2.1 ... Boolean Functions ... 400
21.2.2 ... Predicate Functions ... 401
22 ... Control Structures ... 405
22.1 ... Branches ... 405
22.1.1 ... Conditional Branches ... 406
22.1.2 ... Case Distinction ... 407
22.2 ... Loops ... 408
22.2.1 ... Unconditional Loops ... 408
22.2.2 ... Conditional Loops ... 409
22.2.3 ... Interrupting the Program ... 410
22.3 ... Exception Handling ... 411
22.3.1 ... Class-Based Exceptions ... 411
22.3.2 ... Exceptions Before the Introduction of Class-Based Exceptions ... 428
22.3.3 ... Exceptions in ABAP Statements ... 432
22.3.4 ... Runtime Errors ... 433
PART 8 ... Assignments ... 435
23 ... Assignment Rules ... 437
23.1 ... Compatibility of Data Types ... 438
23.1.1 ... Compatibility of Non-Generic Data Types ... 438
23.1.2 ... Compatibility of Generic Data Types ... 439
23.1.3 ... Reference Types ... 439
23.2 ... Conversion Rules for Elementary Data Objects ... 440
23.2.1 ... Source Field Type c ... 441
23.2.2 ... Source Field Type d ... 444
23.2.3 ... Source Field Type decfloat16 or decfloat34 ... 446
23.2.4 ... Source Field Type f ... 448
23.2.5 ... Source Field Type i, b, or s ... 449
23.2.6 ... Source Field Type n ... 452
23.2.7 ... Source Field Type p ... 453
23.2.8 ... Source Field Type string ... 454
23.2.9 ... Source Field Type t ... 455
23.2.10 ... Source Field Type x ... 457
23.2.11 ... Source Field Type xstring ... 458
23.2.12 ... Numeric Values in Character-Type Fields ... 459
23.3 ... Conversion Rules for Structures ... 461
23.3.1 ...Unicode Fragment View ... 462
23.3.2 ... Conversion between Flat Structures ... 463
23.3.3 ... Conversion between Flat Structures and Single Fields ... 466
23.4 ... Conversion Rules for Internal Tables ... 467
23.5 ... Assignment Rules for Reference Variables ... 467
23.5.1 ... Static and Dynamic Type ... 468
23.5.2 ... Assignments between Data Reference Variables ... 469
23.5.3 ... Assignments between Object Reference Variables ... 470
23.6 ... System Class for Character Set Conversion and Number Format Conversion ... 472
24 ... Assigning Values ... 473
24.1 ... General Assignment ... 474
24.2 ... Lossless Assignment ... 476
24.2.1 ... Lossless Assignment of Elementary Data Objects ... 477
24.2.2 ... Lossless Assignment of Structures ... 484
24.2.3 ... Lossless Assignment of Internal Tables ... 484
24.2.4 ... Lossless Assignment of Reference Variables ... 485
24.2.5 ... Treatable Exceptions ... 485
24.3 ... Multiple Assignments ... 486
24.4 ... Assigning Structure Components ... 486
24.5 ... Special Assignment of a Packed Number ... 489
25 ... Setting References ... 491
25.1 ... Assigning Data Objects to Field Symbols ... 491
25.1.1 ... Specifying the Memory Area ... 492
25.1.2 ... Specifying the Data Type ... 503
25.1.3 ... Specifying Area Limits ... 506
25.1.4 ... Treatable Exceptions ... 509
25.2 ... Retrieving Data References ... 510
26 ... Initializations ... 513
26.1 ... Initializing Data Objects ... 513
26.2 ... Releasing Memory ... 514
26.3 ... Initializing Field Symbols ... 515
PART 9 ... Processing Internal Data ... 517
27 ... Numerical Calculations ... 519
27.1 ... Statements for Numerical Calculations ... 519
27.1.1 ... Statement for Calculation Expressions ... 519
27.1.2 ... Addition ... 522
27.1.3 ... Subtraction ... 523
27.1.4 ... Multiplication ... 524
27.1.5 ... Division ... 524
27.2 ... Arithmetic Expressions ... 525
27.2.1 ... Arithmetic Operators ... 527
27.2.2 ... Bracketing ... 528
27.2.3 ... Calculation Type ... 528
27.2.4 ... Treatable Exceptions ... 532
27.3 ... Numerical Functions ... 533
27.3.1 ... General Numerical Functions ... 533
27.3.2 ... Numerical Extreme Value Functions ... 534
27.3.3 ... Floating Point Functions ... 536
27.3.4 ... Rounding Functions ... 538
27.3.5 ... Treatable Exceptions ... 544
27.4 ... System Classes for Mathematical Operations ... 544
27.4.1 ... Operations with Floating Point Numbers ... 544
27.4.2 ... Random Numbers ... 545
28 ... Character String and Byte String Processing ... 547
28.1 ... Properties of Character String and Byte String Processing ... 547
28.1.1 ... Character Strings and Byte Strings ... 547
28.1.2 ... Operands in Character String and Byte String Processing ... 547
28.1.3 ... Trailing Blanks in Character String Processing ... 549
28.2 ... Statements for Character String and Byte String Processing ... 550
28.2.1 ... Concatenate ... 551
28.2.2 ... Find ... 553
28.2.3 ... Replace ... 561
28.2.4 ... Shift ... 567
28.2.5 ... Split ... 571
28.2.6 ... Condense ... 574
28.2.7 ... Conversion into a Sortable Format ... 575
28.2.8 ... Overlay ... 576
28.2.9 ... Translate ... 577
28.2.10 ... Format ... 579
28.2.11 ... Setting Single Bits ... 601
28.2.12 ... Reading Single Bits ... 602
28.3 ... Character String Expressions ... 603
28.3.1 ... Character String Templates ... 604
28.3.2 ... Chaining Operator ... 624
28.3.3 ... Treatable Exceptions ... 625
28.4 ... Character String Functions ... 625
28.4.1 ... Description Functions ... 625
28.4.2 ... Processing Functions ... 630
28.4.3 ... Common Parameters ... 645
28.4.4 ... Treatable Exceptions ... 648
28.5 ... Regular Expressions ... 649
28.5.1 ... Syntax of Regular Expressions ... 649
28.5.2 ... Single Character Patterns ... 653
28.5.3 ... Character String Patterns ... 660
28.5.4 ... Search Patterns ... 664
28.5.5 ... Replacement Patterns ... 669
28.5.6 ... Simplified Regular Expressions ... 671
28.5.7 ... Testing Regular Expressions ... 673
28.5.8 ... Exceptions in Regular Expressions ... 674
28.6 ... Expressions and Functions for Byte String Processing ... 675
28.6.1 ... Bit Expressions ... 675
28.6.2 ... Byte String Functions ... 678
28.7 ... System Classes for Character String and Byte String Processing ... 679
28.7.1 ... String Processing ... 679
28.7.2 ... Compression ... 679
29 ... Internal Tables ... 681
29.1 ... Properties of Internal Tables ... 681
29.1.1 ... Table Type ... 681
29.1.2 ... Table Category ... 683
29.1.3 ... Table Key ... 684
29.1.4 ... Access to Internal Tables ... 693
29.1.5 ... Administration Costs of Internal Tables ... 694
29.2 ... Statements for Internal Tables ... 696
29.2.1 ... Reading Single Lines ... 696
29.2.2 ... Loop Processing ... 712
29.2.3 ... Control Level Processing ... 722
29.2.4 ... Inserting Lines ... 726
29.2.5 ... Inserting Compressed Lines ... 733
29.2.6 ... Appending Lines ... 736
29.2.7 ... Modifying Lines ... 742
29.2.8 ... Deleting Lines ... 749
29.2.9 ... Sorting ... 757
29.2.10 ... Syntax for Component Specifications ... 764
29.2.11 ... Syntax for Key Specifications ... 766
29.2.12 ... Character and Byte String Processing in Internal Tables ... 766
29.3 ... Table Function ... 772
29.4 ... Special Statement for Internal Tables ... 772
30 ... Extracts ... 779
30.1 ... Declaring Field Groups ... 779
Description:3rd Edition. — Galileo Press, 2011. — 1657 p. — ISBN: 978-1-59229-376-6.На англ. языке.Explore comprehensive explanations of all ABAP statements.Expand your knowledge with new information on extended expression handling, pragmas, introduction to internal tables, and database streami