Online Tutorials & Training Materials | STechies.com
Register Login

ABAP Programming Guidelines

|| || 0 Download

ABAP Programming Guidelines
Stechies

Here is a complete free pdf guide on Official ABAP Programming Guidelines which explains ABAP Programming Guidelines, ABAP-Specific Basic Rules, Structure and Style of an ABAP program, Secure and Robust ABAP, Generic Programming etc.

Contents

Foreword ....................................................................................................
Acknowledgments ......................................................................................
13
15
1 Introduction ............................................................................... 17
1.1 What Are Programming Guidelines? ............................................
1.2 Why Programming Guidelines? ....................................................
1.3 Which Guidelines Are Involved Here? ..........................................
1.4 Target Audience ...........................................................................
1.5 How to Use This Book .................................................................
17
18
18
19
20
2 General Basic Rules ................................................................... 23
2.1 Separation of Concerns ................................................................
2.2 KISS Principle ..............................................................................
2.3 Correctness and Quality ...............................................................
23
32
34
3 ABAP-Specific Basic Rules ......................................................... 41
3.1 ABAP Objects as a Programming Model ......................................
3.2 Program Type and Program Attributes .........................................
3.2.1 Program Type ..................................................................
3.2.2 Program Attributes ..........................................................
3.2.3 Original Language ...........................................................
3.3 Modern ABAP .............................................................................
3.4 Checks for Correctness .................................................................
3.4.1 Syntax Check ..................................................................
3.4.2 Extended Program Check ................................................
3.4.3 Code Inspector ...............................................................
3.4.4 ABAP Test Cockpit ..........................................................
41
50
51
55
60
62
65
65
69
72
76
4 Structure and Style .................................................................... 79
4.1 Source Code Formatting ..............................................................
4.1.1 Case Sensitivity ...............................................................
4.1.2 Statements per Program Line ..........................................
4.1.3 Using the Pretty Printer ...................................................
4.1.4 Line Width ......................................................................
4.2 Naming .......................................................................................
4.2.1 Selecting the Language ...................................................
4.2.2 Descriptive Names ..........................................................
4.2.3 Names of Repository Objects ..........................................
4.2.4 Program-Internal Names .................................................
4.3 Comments ...................................................................................
4.3.1 Selecting the Language ...................................................
4.3.2 Content ..........................................................................
4.3.3 Arrangement in the Source Code .....................................
4.4 Program and Procedure Structure ................................................
4.4.1 Global Declarations of a Program ....................................
4.4.2 Local Declarations ...........................................................
4.5 Source Code Organization ...........................................................
4.5.1 Source Code Modularization ...........................................
4.5.2 Multiple Use of Include Programs ...................................
4.6 Alternative Notations ..................................................................
4.6.1 Alternative Language Constructs in Statements ...............
4.6.2 Chained Statements ........................................................
4.6.3 Method Calls ..................................................................
4.6.4 Assignments and Calculations .........................................
4.6.5 Calculation Expressions ...................................................
4.7 Complexity ..................................................................................
4.7.1 Expressions .....................................................................
4.7.2 Nesting Depth ................................................................
4.7.3 Procedure Volume ..........................................................
4.7.4 Class Size ........................................................................
4.7.5 Dead Code ......................................................................
80
80
83
86
89
91
92
94
101
106
115
115
117
120
123
124
127
130
130
132
135
135
137
141
143
145
146
147
149
150
151
153
5 Architecture ............................................................................... 155
5.1 Object-Oriented Programming .....................................................
5.1.1 Encapsulation .................................................................
5.1.2 Modularization ...............................................................
5.1.3 Static Classes and Singletons ...........................................
5.1.4 Inheritance .....................................................................
5.1.5 Class References and Interface References .......................
5.1.6 Local Types for Global Classes .........................................
5.1.7 Instance Constructor .......................................................
5.2 Error Handling .............................................................................
5.2.1 Reaction to Error Situations .............................................
5.2.2 Classical and Class-Based Exceptions ...............................
5.2.3 Exception Categories .......................................................
5.2.4 Exception Texts ...............................................................
5.2.5 Using Exception Classes ..................................................
5.2.6 Handling and Propagating Exceptions .............................
5.2.7 Cleanup After Exceptions ................................................
5.2.8 Catchable Runtime Errors ................................................
5.2.9 Assertions .......................................................................
5.2.10 Messages ........................................................................
5.3 User Interfaces .............................................................................
5.3.1 Selecting the User Interface Technology ..........................
5.3.2 Encapsulating Classical User Interfaces ............................
5.3.3 Lists ................................................................................
5.3.4 Accessibility ....................................................................
5.4 Data Storage ................................................................................
5.4.1 Persistent Data Storage ...................................................
5.4.2 Database Accesses ..........................................................
5.4.3 Client Handling ...............................................................
5.4.4 Using the Shared Memory ...............................................

155
156
157
161
166
167
169
171
172
172
174
178
180
183
185
186
188
190
191
195
195
199
204
207
208
208
210
211
213

6 Secure and Robust ABAP ........................................................... 217
6.1 Data Types and Data Objects .......................................................
6.1.1 Bound and Standalone Data Types ..................................
6.1.2 Declaration of Data Types and Constants .........................
6.1.3 Declaration of Variables ..................................................
6.1.4 Including Structures ........................................................
6.1.5 Using Types .....................................................................
6.1.6 Referring to Data Types or Data Objects ..........................
6.1.7 Table Work Areas ............................................................
6.1.8 Literals ............................................................................
6.1.9 Strings ............................................................................
6.1.10 Start Values .....................................................................
6.1.11 Data Objects for Truth Values ..........................................
6.2 Assignments, Calculations, and Other Accesses to Data ...............
6.2.1 Assignments Between Different Types .............................
6.2.2 Avoiding Invalid Values ...................................................
6.2.3 Using Conversion Rules ...................................................
6.2.4 Specification of Numbers ................................................
6.2.5 Selecting the Numeric Type .............................................
6.2.6 Rounding Errors ..............................................................
6.2.7 Division by Zero ..............................................................
6.2.8 Casting ............................................................................
6.2.9 Runtime Errors When Accessing Data Objects .................
6.2.10 Anonymous Containers ...................................................
6.2.11 Passing Global Data by Reference ....................................
6.3 System Fields ...............................................................................
6.3.1 Access .............................................................................
6.3.2 Obsolete and Internal System Fields ................................
6.3.3 Evaluation .......................................................................
6.3.4 Return Value ...................................................................
6.3.5 Using System Fields as Actual Parameters ........................
6.3.6 Using System Fields on the User Interface .......................
6.3.7 Using System Fields in Operand Positions .......................
6.4 Internal Tables .............................................................................
6.4.1 Selecting the Table Category ...........................................
6.4.2 Secondary Keys ...............................................................
6.4.3 Initial Memory Allocation ...............................................
6.4.4 Sorted Filling ...................................................................
6.4.5 Aggregated Filling ...........................................................
6.4.6 Output Behavior .............................................................
6.4.7 Loop Processing ..............................................................
6.5 Modularization Units ...................................................................
6.5.1 Function Modules and Subroutines .................................
6.5.2 Type of the Formal Parameters of Procedures ..................
6.5.3 Transfer Type of Formal Parameters .................................
6.5.4 Passing Output Parameters by Reference .........................
6.5.5 Typing of Formal Parameters ...........................................
6.5.6 Internal and External Procedure Calls ..............................
6.5.7 Exiting Procedures ..........................................................
6.5.8 Dialog Modules and Event Blocks ...................................
6.5.9 Macros ............................................................................
6.6 Dynamic Programming Techniques ..............................................
6.6.1 Using Dynamic Programming Techniques ........................
6.6.2 Runtime Errors During Dynamic Processing .....................
6.6.3 Using Dynamic Data Objects ...........................................
6.6.4 Memory Consumption of Dynamic Memory Objects .......
6.6.5 Administration Costs of Dynamic Memory Objects ..........
6.6.6 Accessing Data Objects Dynamically ...............................
6.6.7 Generic Programming .....................................................
6.7 Internationalization .....................................................................
6.7.1 Storing System Texts .......................................................
6.7.2 Translation-Friendly Message Texts ..................................
6.7.3 Text Environment ............................................................
6.7.4 Character Set of Source Code ..........................................
6.7.5 Splitting Texts .................................................................
6.7.6 Codepages for Files .........................................................
217
218
220
224
226
228
230
232
233
236
238
239
241
241
243
245
247
249
253
255
255
257
259
260
262
262
264
265
267
268
270
272
273
274
276
280
281
283
284
286
287
288
289
292
294
296
298
302
304
306
309
309
311
313
315
318
321
324
329
329
331
333
335
336
337
Appendices ............................................................................ 339
A Obsolete Language Constructs ..............................................................
A.1 Procedures ..................................................................................
A.2 Declarations ................................................................................
A.3 Object Generation .......................................................................
A.4 Calls and Exits ..............................................................................
A.5 Program Flow Control ..................................................................
A.6 Assignments ................................................................................
A.7 Calculation Statements ................................................................
A.8 Processing Character and Byte Strings ..........................................
A.9 Internal Tables .............................................................................
A.10 Dynpro Flow Logic ......................................................................
A.11 Classical List Processing ...............................................................
A.12 Data Storage ................................................................................
A.13 Contexts ......................................................................................
A.14 External Interfaces .......................................................................
B Automatic Check of Naming Conventions .............................................
B.1 Naming Conventions in the Code Inspector .................................
B.2 Type-Specific Prefix Components .................................................
B.3 Prefixes for Procedure-Local Declarations ....................................
B.4 Structured Programming ..............................................................
B.5 Object-Oriented Programming .....................................................
B.6 Assessment of the Naming Conventions ......................................
C Table of Rules .......................................................................................
D Recommended Reading ........................................................................
E The Authors ..........................................................................................

341
342
343
347
347
349
350
352
353
355
357
358
360
362
363
365
365
366
367
369
370
371
373
377
379

Index...................................................................................................... 381


 Download attached file.

You must be Logged in to download this file

Related Articles

0.0126 seconds.