Партнерка на США и Канаду по недвижимости, выплаты в крипто

  • 30% recurring commission
  • Выплаты в USDT
  • Вывод каждую неделю
  • Комиссия до 5 лет за каждого referral

Core Financial

ABAP Programming Standards and Guidelines

Author: Bob Johnson

Creation Date: 03/29/2001 12:00 PM

Last Updated: 3/09/2013 11:58:00 AM

Version: 1.0

This document is the final version of the ABAP Programming Standards and Guidelines that will be utilized by application developers. It has been signed off by NASA and will also be delivered as part of the Application Development Team’s final deliverable. Following this document is the superseded version that was developed by the Technical Architecture Team and signed off by the NASA.

Sign Off

Date

Name

Signature

Change Log

Date

Version

Author

Change Description

Reviewed By

Date

Name

Table of Contents

Table of Contents....................................................................................................................... 3

1 Overview............................................................................................................................. 8

2 General Standards............................................................................................................. 8

3 ABAP Program Elements................................................................................................. 9

3.1 Attributes.................................................................................................................... 9

3.1.1 Title..................................................................................................................................................................... 9

НЕ нашли? Не то? Что вы ищете?

3.1.2 Type................................................................................................................................................................... 9

3.1.3 Status................................................................................................................................................................. 9

3.1.4 Application..................................................................................................................................................... 10

3.1.5 Authorization Group..................................................................................................................................... 10

3.1.6 Development Class....................................................................................................................................... 10

3.1.7 Logical Database........................................................................................................................................... 10

3.1.8 Screen.............................................................................................................................................................. 10

3.1.9 Editor Lock..................................................................................................................................................... 10

3.1.10 Fixed Point Arithmetic............................................................................................................................. 10

3.1.11 Start via Variant....................................................................................................................................... 11

3.2 Source Code.............................................................................................................. 11

3.2.1 General Programming Requirements......................................................................................................... 11

3.2.1.1 Authorization Checking..................................................................................................................... 11

3.2.2 Executable Programs: (Template Y_EXECUTABLE_PROGRAM)................................................... 11

3.2.3 INCLUDE Programs:.................................................................................................................................... 13

3.2.4 Module Pool Programs:................................................................................................................................ 14

3.2.5 Function Pool (Group) Programs:............................................................................................................... 15

3.2.6 Function Module Programs:........................................................................................................................ 15

3.2.7 Subroutine Pool Programs:.......................................................................................................................... 16

3.2.8 Class Pool Programs:.................................................................................................................................... 17

3.2.9 Interface Pool Programs:............................................................................................................................. 17

3.3 Documentation.......................................................................................................... 17

3.3.1 Program Documentation:............................................................................................................................ 17

3.3.1.1 Class Pool Documentation................................................................................................................ 18

3.3.1.2 Interface Pool Documentation......................................................................................................... 18

3.3.2 Changes and Enhancements:..................................................................................................................... 19

3.3.3 User Documentation:.................................................................................................................................... 19

3.4 Text Elements........................................................................................................... 19

3.4.1 Titles and Headings....................................................................................................................................... 19

3.4.2 Selection Texts............................................................................................................................................... 20

3.4.3 Text-Symbols................................................................................................................................................. 20

3.5 Variants.................................................................................................................... 20

4 Style Guidelines................................................................................................................ 21

4.1 ABAP Style Guidelines............................................................................................. 21

4.1.1 R/3 Design Elements..................................................................................................................................... 21

4.1.2 Work Area Design Elements........................................................................................................................ 22

4.2 NASA Style Guidelines............................................................................................. 22

4.2.1 Window Titles................................................................................................................................................. 22

4.2.2 Selection Screens........................................................................................................................................... 22

4.2.3 Transaction Screens...................................................................................................................................... 22

4.2.4 Online Help..................................................................................................................................................... 23

4.2.5 Report Titles................................................................................................................................................... 23

4.2.6 Report Headings and List Format.............................................................................................................. 23

4.2.7 Report Footings.............................................................................................................................................. 23

5 ABAP Programming Advanced Techniques.................................................................. 23

5.1 Message Classes........................................................................................................ 23

5.2 Views......................................................................................................................... 23

5.3 Internal Tables:........................................................................................................ 24

5.4 Possible Uses Of Internal Tables.............................................................................. 24

5.4.1 A Large Number Of Database Accesses Are Foreseen........................................................................... 24

5.4.2 Replacing Nested Selects.............................................................................................................................. 24

5.5 Performance Concerns: Internal looping vs. Nested selects................................... 24

5.5.1 The tradeoff................................................................................................................................................... 25

5.5.2 Methods Of Internal Table Population..................................................................................................... 25

5.6 Free System Resources............................................................................................. 26

5.7 Field Groups............................................................................................................. 26

5.7.1 INSERT f1 f2 ... INTO fg............................................................................................................................. 26

5.7.2 Extract <fg>.................................................................................................................................................... 27

5.7.3 Field Group Processing.................................................................................................................................. 27

5.7.4 Sample of Field Group usage in a program:............................................................................................. 27

5.8 General Use Function Modules................................................................................ 28

5.8.1 Date Oriented Function Modules:.............................................................................................................. 28

5.9 Logical Database:..................................................................................................... 29

5.10 Use of Indices:........................................................................................................... 29

6 Customer Enhancements – Enhancement Projects....................................................... 29

7 Changing SAP Code........................................................................................................ 30

8 APPENDIX A: Programming Guidelines...................................................................... 31

8.1 Writing Maintainable Code...................................................................................... 31

8.1.1 Program Structure.......................................................................................................................................... 31

8.1.2 Modularization.............................................................................................................................................. 32

8.1.3 Statement Format......................................................................................................................................... 32

8.1.4 Pre-defined Coding Blocks.......................................................................................................................... 32

8.1.5 Performance Considerations....................................................................................................................... 34

8.1.6 Version Management................................................................................................................................... 34

8.1.7 DEFINING DATA FIELDS AND TABLES.............................................................................................. 34

8.1.8 Field symbols.................................................................................................................................................. 35

8.1.9 Example Program.......................................................................................................................................... 36

8.2 Using Tables and Fields............................................................................................ 37

8.2.1 Check Return Codes..................................................................................................................................... 37

8.2.2 Initializing Fields and Structures................................................................................................................. 37

8.2.3 MOVE-CORRESPONDING........................................................................................................................ 38

8.2.4 SORT............................................................................................................................................................... 38

8.3 Working with Logical Operators and Control Structures...................................... 38

8.4 Performance and Tuning Guidelines........................................................................ 40

8.4.1 Use SORT to organize reports and data.................................................................................................... 40

8.4.2 Defining Custom Tables............................................................................................................................... 41

8.4.3 Use of SELECT with Transparent and Pool tables................................................................................. 41

8.4.4 Use of the SELECT statement with Cluster tables.................................................................................. 42

8.4.5 Matching field attributes in the SELECT WHERE clause..................................................................... 43

8.4.6 Processing Internal Tables and Data Areas.............................................................................................. 44

8.4.7 Processing large tables.................................................................................................................................. 47

8.4.8 General Tips:.................................................................................................................................................. 47

8.5 SECONDARY INDEXES......................................................................................... 48

8.5.1 Always ensure your index is being used:................................................................................................... 48

8.5.2 General Rules for creating and using secondary indexes:...................................................................... 48

8.5.3 When to Create an Index............................................................................................................................. 49

8.5.4 When Not to Create an Index:.................................................................................................................... 50

8.6 Controlling the Development Environment............................................................. 50

8.6.1 Quality Assurance......................................................................................................................................... 50

8.6.2 CROSS-REFERENCING A PROGRAM................................................................................................... 50

8.7 Developer’s Issues for the Transport System.......................................................... 52

8.8 Transport Checklist for Developer.......................................................................... 52

9 Appendix B: Metrics-Driven Code Comparisons............................................................ 55

9.1 SQL Interface........................................................................................................... 55

9.1.1 Select … Where vs. Select + Check............................................................................................................ 55

9.1.2 Select single vs. Select-Endselect................................................................................................................ 55

9.1.3 Select aggregates............................................................................................................................................ 56

9.1.4 Select with view.............................................................................................................................................. 56

9.1.5 Select with buffer support............................................................................................................................ 56

9.1.6 Column Update............................................................................................................................................. 57

9.1.7 Select with index support............................................................................................................................. 57

9.1.8 Select … Into Table t.................................................................................................................................... 57

9.1.9 Select-Endselect vs. Array-Select................................................................................................................ 58

9.1.10 Select with select list................................................................................................................................. 58

9.1.11 Array Insert vs. Single-row Insert........................................................................................................... 58

9.2 String Manipulation.................................................................................................. 58

9.2.1 Special operators in IF (CA, …).................................................................................................................. 58

9.2.2 String concatenation II................................................................................................................................. 59

9.2.3 Deleting leading spaces................................................................................................................................. 59

9.2.4 String concatenation..................................................................................................................................... 60

9.2.5 String split........................................................................................................................................................ 60

9.2.6 String length.................................................................................................................................................... 61

9.3 Internal Tables.......................................................................................................... 61

9.3.1 Building sorted tables.................................................................................................................................... 61

9.3.2 Building tables without duplicates.............................................................................................................. 61

9.3.3 Different forms of key access..................................................................................................................... 62

9.3.4 Key access to multiple lines......................................................................................................................... 62

9.3.5 Copying internal tables................................................................................................................................. 63

9.3.6 Sorting internal tables................................................................................................................................... 63

9.3.7 Nested loops................................................................................................................................................... 63

9.3.8 Deleting a sequence of lines......................................................................................................................... 64

9.3.9 Building condensed tables........................................................................................................................... 64

9.3.10 Linear vs. Binary search.......................................................................................................................... 65

9.3.11 Secondary indices..................................................................................................................................... 65

9.3.12 Using explicit work areas......................................................................................................................... 66

9.3.13 Comparing internal tables....................................................................................................................... 66

9.3.14 Joining internal tables.............................................................................................................................. 67

9.3.15 Deleting duplicates................................................................................................................................... 67

9.3.16 Deleting a set of lines............................................................................................................................... 68

9.4 Typing....................................................................................................................... 68

9.4.1 Typed vs. Untyped parameters................................................................................................................... 68

9.4.2 Typed vs. Untyped field-symbols............................................................................................................... 69

9.5 If, Case, …................................................................................................................ 69

9.5.1 If vs. Case....................................................................................................................................................... 69

Из за большого объема этот материал размещен на нескольких страницах:
1 2 3 4 5 6 7