Online Tutorials & Training Materials | STechies.com
Register Login

ABAP Objects (Application Development from Scratch)

|| || 0 Download

ABAP Objects (Application Development from Scratch)
Stechies

The paradigm of object orientation means that software is seen as a quantity of discrete objects that have a data structure and data behavior.

This perspective is completely natural at the application design level, because this approach can be used to map the business entities of the conceptual design. 

Object-oriented programming involves creating an equivalent to the business entities in each case, such as invoices or documents.

The following are characteristic features of an object designed and programmed in this way:

  • An object identity can be defined: An object exists but once and must be uniquely identified.
  • An object has properties that are encoded in attributes. These are defined in ABAP by ABAP Dictionary data elements.
  • Objects also have behaviors that are encoded as methods.
  • Objects of the same type (in terms of the same attributes and behavior) are categorized. They are instances (or also copies) of a class. In the sample application presented here, the central objects are instances of a vehicle class.
  • Classes have a hierarchical structure through derivation. Derived classes are more specific than their predecessors. The basis classes are therefore true generalizations.

Contents

Preface ..................................................................................... 15

1 Introduction ........................................................................... 17

1.1 About this Book ............................................................ .....18
1.2 Sample Application and Technical Prerequisites ................... 21

2 Designing Application Systems ............................................... 23

2.1 Requirements ..................................................................... 24
2.1.1 Requirements Analysis as a Process ................................. 24
2.1.2 Functional Requirements .................................................. 25
2.1.3 Non-Functional Requirements ......................................... 25
2.1.4 Limits of Functional and Non-Functional
Requirements .......................................................................... 34
2.1.5 System Specification ...................................................... 37
2.2 General Architectural Considerations .................................. 39
2.2.1 Product Families: Separating Frames and
Content ................................................................................... 39
2.2.2 Metadata ...................................................................... 44
2.2.3 Generative Programming ................................................ 46
2.2.4 Model-Driven Architectures ........................................... 48
2.3 Using the Standard SAP System ........................................ 49

3 Application Object ............................................................... 51

3.1 What Is an Application Object? ......................................... 52
3.2 Modeling the Application Object at the Database Level ..... 56
3.2.1 Structured Entity Relationship Model ............................. 56
3.2.2 Data Modeling at the ABAP Dictionary Level ............... 61
3.3 Implementing Object Persistence ..................................... 75
3.3.1 Necessity of Database Access Layers .......................... 76
3.3.2 Object Services ........................................................... 80
3.3.3 Inheriting Persistent Classes ......................................... 85
3.3.4 Accessing Dependent Tables ....................................... 88
3.3.5 Query Service .............................................................. 92
3.3.6 Developing a Separate Persistence Service ................... 93
3.3.7 BAPI Access Methods ................................................. 94
3.4 Transaction Concept ....................................................... 95
3.4.1 Special Techniques of the Classic Transaction
Concept ................................................................................. 98
3.4.2 Object-Oriented Transaction Concept ........................... 99
3.5 Best Practices ................................................................. 102
3.5.1 Creating Primary Keys ................................................. 102
3.5.2 Modeling the Application Object in
the ABAP Dictionary ............................................................ 104
3.5.3 Service Functions for Persistent Objects ....................... 104
3.5.4 Saving Unstructured and Semi-Structured Data ............. 107
3.5.5 Further Considerations .................................................. 110
3.5.6 Key Transactions .......................................................... 111

4 Classes, Interfaces, and Exceptions ..................................... 113

4.1 Advantages of ABAP Objects ......................................... 114
4.1.1 Defining Constants in Classes and Interfaces ................. 115
4.1.2 Function Groups versus Objects .................................. 115
4.1.3 Events ........................................................................ 116
4.2 Exceptions ..................................................................... 116
4.2.1 Classic and Object-Oriented Exceptions ...................... 117
4.2.2 Assertions ....................................................................120
4.2.3 Exception Handling ..................................................... 121
4.3 Basic Principles of Object-Oriented Design .................... 122
4.3.1 Dependency Inversion .................................................. 123
4.3.2 Open-Closed Principle ................................................ 124
4.3.3 Inheritance and the Substitution Principle ...................... 126
4.3.4 Testability Using Unit Tests ......................................... 127
4.4 Classic Modularization Units .......................................... 130
4.4.1 Function Modules ........................................................ 130
4.4.2 Reports ....................................................................... 130
4.5 Best Practices ................................................................ 132
4.5.1 General Considerations for Object-Oriented
Design .................................................................................. 132
4.5.2 Key Transactions .................................................. .......133

5 Application Architecture ..................................................... 135

5.1 Requirements for Application Architecture ....................... 135
5.2 Software Structuring from a Technical Perspective ............ 137
5.3 How To Structure a Software System .............................. 141
5.3.1 Taking Account of the Business Structure ...................... 141
5.3.2 Identification of Layers ................................................. 144
5.3.3 Dividing Applications into Sub-Applications .................. 145
5.3.4 Creating Basic Components .......................................... 146
5.3.5 Dependency on SAP Standard Components ................. 147
5.3.6 Structure of the Sample Application .............................. 147
5.4 Package Concept ........................................................... 148
5.4.1 Package Interfaces and Checks ................................... 150
5.4.2 Visibility of Package Interfaces .................................... 153
5.4.3 Structure Packages and SAP Software
Components ........................................................................ 154
5.4.4 Excursion: Compatibility Problems .............................. 157
5.4.5 Excursion: Naming Conventions and
Namespaces ...................................................................... 159
5.5 Composition of Packages ............................................. 161
5.5.1 Runtime Configuration of Software
Components ........................................................................ 162
5.5.2 Using Enhancements to Implement Interfaces .............. 167
5.5.3 Event-Based Interfaces ...............................................170
5.6 Best Practices ............................................................... 179
5.6.1 Architecture Documentation ....................................... 179
5.6.2 Characteristics of Package Splitting ............................ 180
5.6.3 Interface Design .........................................................182
5.6.4 Package Check Mode .............................................. 183
5.6.5 Outlook .....................................................................185
5.6.6 Key Transactions ...................................................... 185

6 Application Layer ............................................................ 187

6.1 Application Logic ......................................................... 188
6.1.1 Implementing the Application Object ......................... 190
6.1.2 Separation of Object and Process ............................. 193
6.2 Customizing ................................................................. 196
6.2.1 Basic Principles ......................................................... 197
6.2.2 Technical Customizing .............................................. 198
6.3 Search Services ........................................................... 204
6.4 Workflows .................................................................. 209
6.4.1 Sample Scenario: Resubmission on a Specific
Date ................................................................................. 211
6.4.2 Key Transactions ..................................................... 226

7 GUI Programming .......................................................... 229

7.1 Ergonomic Examples and Dialog Standards .................. 230
7.1.1 SAP R/3 Style Guide ................................................ 231
7.1.2 Ergonomic Examples ................................................ 231
7.1.3 Menu Standards ...................................................... 233
7.1.4 Screen Layout and User Guide ................................ 233
7.2 Table Maintenance Dialog and View Cluster ............... 238
7.2.1 Generating and Enhancing Table Maintenance
Dialogs ............................................................................ 239
7.2.2 View Clusters ......................................................... 250
7.2.3 Tips for Handling Maintenance Views and View
Clusters ........................................................................... 258
7.3 Area Menus .............................................................. 258
7.4 Object-Oriented Screen Programming ....................... 261
7.4.1 Pros and Cons of Subscreens ................................. 261
7.4.2 Subscreens as a Modularization Unit ..................... 262
7.4.3 Encapsulating with Screens .................................... 263
7.4.4 Message Handling with Screens ............................. 263
7.4.5 BUS Screen Framework ........................................ 264
7.4.6 Advantages of Object-Oriented Screens ................ 266
7.4.7 Uses for the BUS Screen Framework .................... 267
7.4.8 Normal Screens and Modal Dialog Boxes .............. 267
7.4.9 Defining Flow Logic ............................................... 269
7.4.10 Creating Instances ................................................ 270
7.4.11 Calling Screens ..................................................... 271
7.4.12 Sequence of Processing Events ............................. 271
7.4.13 Defining Your Own Screen Logic .......................... 273
7.4.14 Setting Titles and GUI Statuses ............................. 273
7.4.15 Handling User Inputs ............................................ 273
7.4.16 Collecting and Issuing Error Messages .................. 277
7.4.17 Embedding the Business Application Log .............. 280
7.4.18 Table Controls and ALV-Grids ............................ 283
7.4.19 Screens with Subscreen Areas .............................. 283
7.4.20 Defining Subscreens ............................................. 285
7.4.21 Data Transfer Between Screen Fields and
Screen Class ................................................................... 286
7.4.22 Tabstrips .............................................................. 287
7.4.23 For Advanced Users: Selection Screens
and Screen Painter ........................................................... 294
7.4.24 Selection Screens in Conjunction with the BUS
Screen Framework .......................................................... 300
7.4.25 Outlook ................................................................ 306
7.5 Web Dynpro .............................................................. 306
7.5.1 Basic Principles ....................................................... 307
7.5.2 Creating a Sample Application ................................ 310
7.5.3 Modification-Free Extensions Using Dynamic
Programming ................................................................... 317
7.6 Best Practices ........................................................... 327
7.6.1 Choosing the Right GUI Technology ....................... 327
7.6.2 Software Factors ................................................... 328
7.6.3 Key Transactions ................................................... 329

8 SAP Business Partner ................................................... 331

8.1 Background Information ............................................. 331
8.1.1 The Creation of SAP Business Partner .................... 332
8.1.2 Conceptual Overview ............................................. 333
8.1.3 First Impression ..................................................... 334
8.2 Business Partner Extension ........................................ 336
8.2.1 Example of an Extension ......................................... 336
8.2.2 Maintaining the Application .................................... 338
8.2.3 Maintaining the Data Set ......................................... 339
8.2.4 Maintaining Tables .................................................. 339
8.2.5 Maintaining Field Groups ........................................ 340
8.2.6 Views (Transaction BUS3) ...................................... 341
8.2.7 Sections (Transaction BUS4) ................................... 343
8.2.8 Screens (Transaction BUS5) .................................... 343
8.2.9 Screen Sequences (Transaction BUS6) .................... 345
8.2.10 BP Views (Transaction BUSD) .............................. 345
8.2.11 Creating Role Categories and Roles ....................... 345
8.2.12 ZVHM_BUPA Function Group ............................. 347
8.2.13 Screen 0100 ......................................................... 348
8.2.14 Events ................................................................... 349
8.2.15 BDT Naming Conventions .................................... 363
8.2.16 Testing the Extension ............................................ 364
8.2.17 Troubleshooting ................................................... 366
8.2.18 Summary .............................................................. 369
8.3 SAP Locator Extension .............................................. 369
8.3.1 Introduction to the SAP Locator ............................. 369
8.3.2 Aim of the Extension ............................................... 370
8.3.3 Transaction LOCA_CUST ..................................... 370
8.3.4 Definition of the Hierarchy ....................................... 374
8.3.5 Creating an Append Search Help ............................. 375
8.3.6 Creating the Elementary Search Help ...................... 376
8.3.7 Assigning the Search Help to the Append
Search Help ................................................................... 376
8.3.8 Creating a Function Group ................................ ......377
8.3.9 Creating a Search Screen ................................... ...377
8.3.10 Form Routine to Initialize the Search .................... 380
8.3.11 Form Routine to Get Search Fields ...................... 380
8.3.12 Form Routine to Set Search Fields ....................... 381
8.3.13 Form Routine To Create the Screen Object .......... 381
8.3.14 Creating a Function Module .................................. 382
8.3.15 Creating a Local Search Class ............................... 384
8.3.16 Providing the Search ID in the Locator
Customizing ...................................................................... 386
8.3.17 Testing the Search .................................................. 387
8.3.18 Summary ................................................................ 388
8.4 Key Transactions ......................................................... 388

9 Application Programming Techniques .............................. 391

9.1 Implementing the Application Log ............................... 392
9.1.1 Log Recipients ......................................................... 393
9.1.2 Log Research as a Business Process ........................ 393
9.1.3 Business Application Log (BAL) .............................. 395
9.1.4 BAL Data Model .................................................... 396
9.1.5 Application Programming Interface (API) ................. 396
9.1.6 Example: Creating and Displaying a Log ................... 397
9.1.7 Example: Saving the Log .......................................... 399
9.1.8 Transaction Concept ................................................ 401
9.1.9 Enriching Logs ......................................................... 403
9.1.10 Saving Complex Data ............................................. 412
9.1.11 Using Additional Callbacks in the Display ................ 415
9.1.12 User-Defined Buttons ............................................. 416
9.1.13 Deleting and Archiving Logs ................................... 417
9.1.14 Summary ............................................................... 417
9.1.15 Additional Information ........................................... 417
9.2 Parallel Processing of Applications .............................. 417
9.2.1 Use case .................................................................. 418
9.2.2 Prerequisites ............................................................ 420
9.2.3 Asynchronous Remote Function Call (aRFC) ........... 424
9.2.4 Parallelization with Background Jobs ........................ 437
9.2.5 Parallelization with the Parallel Processing Tool
BANK_PP_JOBCTRL .......................................... ..........439
9.2.6 Summary ................................................................. 444
9.2.7 Additional Information .............................................. 444
9.3 Key Transactions ........................................................ 445

10 Information Acquisition ........................................... 447

10.1 SAP Service Marketplace ....................................... 447
10.1.1 SAP Help Portal ................................................. 447
10.1.2 SAP Support Portal ............................................ 448
10.1.3 SAP Developer Network .................................... 448
10.2 ABAP Keyword Documentation ............................ 450
10.3 SAP Design Guild ................................................... 451
10.4 Internal Workings of AS ABAP .............................. 451
10.4.1 Debugging .......................................................... 451
10.4.2 Information Sources in the SAP System ............... 453
10.4.3 Runtime Analysis ................................................. 454
10.4.4 Database Trace .................................................... 457
10.4.5 Environment Analysis ......................................... 458
10.5 Knowledge Management ........................................ 459
10.6 Key Transactions ................................................... 461

Appendices..................................................................... 463

A Managing Development Projects ................................. 465
A.1 Roles in Development Projects ................................ 465
A.1.1 The Role of the Chief Software Designer .............. 465
A.1.2 Frameworks and Tools ......................................... 466
A.2 Quality Management ............................................... 467
A.2.1 Risk Management ............................................... 467
A.2.2 Development Guidelines ........................................ 469
A.2.3 Code Inspections and Enhancement of the
Code Inspector ............................................................. 470
A.2.4 Creating a Documentation ................................... 480
A.2.5 Enabling a Check ................................................. 481
A.2.6 Software Test ...................................................... 482
A.2.7 Documentation .................................................... 483
A.2.8 Key Transactions ................................................ 486
B Bibliography ............................................................. 487
C List of Quotations ..................................................... 491
D The Authors ............................................................. 493

Index............................................................................ 495


 Download attached file.

You must be Logged in to download this file

Related Articles

0.0126 seconds.