Sei sulla pagina 1di 12

SAP' ABAP

Handbook

Kogent Learning Solutions, Inc.

JONES AND BARTLETT PUBLISHERS


Sudbury, Massachusetts
BOSTON TORONTO LONDON SINUAPORI:
Table of Contents

Introduction xxi

About This Book xxi

How to Use This Book xxii

Conventions xxii
Other Resources xxiv

Chapter 1 A Gateway to SAP Systems 1

Explaining the Concept of an ERP System 2

History of SAP Systems 4


Need for ABAP 6

Exploring the Architecture of SAP R/3 8

The Logical View 9

The Software-Oriented View 10


The User-Oriented View 13

Explaining the Architecture of the


Application Server 14

Dispatching Dialog Steps 22

Describing the User Context and Roll Area in the SAP System 24
The Client-Dependency Feature 26

Summary 26

Chapter 2 The Logon Process of the SAP System 27

Starting the SAP System 28

Maintaining the SAP Logon Screen 31

Adding a New Entry 31

Modifying the Entry 35

Deleting the Entry 36

Creating and Using SAP Shortcuts 37

Creating SAP Shortcuts 37

Configuring the SAP Logon 47

ix
x Table of Contents

Changing the Password 50

Logging Off of the SAP System 52

Summary 53

Chapter 3 SAP
Easy Access 55

Explaining the SAP Easy Access Screen 56

Exploring the GUI of the SAP System 60


The Screen Header 60
The Screen Body 67

Customizing the SAP GUI 70

Managing Favorites 72

Adding an Item 75

Inserting Folders 76

Moving Favorites and Folders 78

Renaming Favorites and Folders 80

Deleting Favorites and Folders 82

Adding a Web Address 82

Handling SAP Sessions 84

Creating a New Session 84


Displaying a List of All Sessions 86
Ending a Session 87
Summary 88

Chapter 4 Understanding ABAP Workbench 89

Overview of ABAP Workbench 90


Exploring the ABAP Workbench Tools 91
ABAP 92
Dictionary
ABAP Editor 94
Front-End Editor (New) 95
Front-End Editor (Old) 96
Back-End Editor 98
Class Builder 99
Function Builder 101
Screen Painter 102
Menu Painter 103
Table of Contents xi

Object Navigator 105


Message Maintenance 109
ABAP Text Elements 110
M aintain Transaction 111
Describing Package Builder 112
of
Types Packages 113
Testing Tools in ABAP Workbench 114
ABAP Debugger 114
ABAP Runtime Analysis 115
Performance Analysis 116
Describing Web S ervices 117
Web Application Builder for ITS 118
Web Application Builder for BSP 119
Describing XSLT Editor 120

Summary 121

Chapter 5 ABAP
Dictionary 123

Overview of ABAP Dictionary 124


Exploring Domains 125
Describing Fixed Values for Domains 126
Exploring Conversion Routines for Domains 127
Creating a Domain 128
Modifying the Existing Domain 133
Deleting a Domain 138
Exploring Data Types 138
Data Elements 138
Structures 144
Table Types 144
Exploring Type Groups 145
Exploring Database Tables 146
Types of Tables 148
Types of Table Fields 152
Technical Settings of a Table 154
Creating Tables 158
Relating Tables by Using Foreign Keys 174
xii Table of Contents

Exploring Views 180


Relating Database Tables
Using Relational Operators 181

Creating Different Types of Views 184

Deleting Views 211

Exploring Search Helps 212

Elementary Search Help 212


Collective Search Help 213
Append Search Help 214
Exploring Lock Objects 215
Describing Lock Argu m ents 217
Exploring the Lock Mode and the Lock Table 218
Describing the Lock Mechanism 220
Creating Lock Objects 222
Summary 226

Chapter 6 ABAP Programming in ABAP Editor 227

Structure of an ABAP Program 228

Introductory Program Part 229


Declaration Part for Global Data, Class Definitions,
and Selection Screens 229
Processing Blocks 230
ABAP Editor 231

Types of ABAP Programs 236


ABAP Syntax 238
Inserting Comments into ABAP Programs 239
Exploring Types and Objects 241
Data Types 242
Object Types 245
Objects in ABAP 246
Variables in ABAP 248
The DATA Statement 248
The PARAMETERS Statement 252
Constants in ABAP 256
The TABLES Statement 258
Assignment Statements 259
The MOVE Statement 259
The MOVE -

CORRESPONDING Statement 263


Table of Contents xiii

The WRITE TO Statement 265


The CLEAR Statement 266

Formatting Options 268


The WRITE Statement 268
The FORMAT Statement 271

Exploring System Variables 278

Dynamic Assignment 278

Describing Flow Control Statements 279


The IF. . .
ENDIF Control Statement 280

Looping 289

Terminating Loops 294

Summary 297

Chapter 7 Internal Tables 299

Overview of Internal Tables 300


Data Types of an Internal Table 303
Types of Internal Tables 303
Standard Tables 304
Sorted Tables 304
Hashed Tables 305

Creating Internal Tables 305

Creating Internal Tables as Data Types 306

Creating Internal Tables as Data Objects 313


Performing Operations on an Entire Internal Table 316

Moving and Assigning Internal Tables 316

Initializing Internal Tables 319

Refreshing Internal Tables 320

Releasing the Memory of Internal Tables 320

Comparing Internal Tables 322

Performing the Sort Operation in Internal Tables 325

Determining the Attributes of Internal Tables 333

Operations on Individual Lines 335

Inserting Lines in Internal Tables 337

Inserting Summarized Lines in Internal Tables 346

Appending Lines to Internal Tables 348

Reading the Lines of Internal Tables 356

Modifying the Lines of Internal Tables 364


xiv Table of Contents

Deleting Lines 373

Searching Table Entries 386

Maintaining Internal Tables 390


Control Break Processing 392
The AT FIRST and AT LAST Statements 392

The AT NEW and AT END OF Statements 395


The SUM Statement 401
The ON CHANGE OF Statement 403

Summary 410

Chapter 8 Accessing Data in the SAP System 411

Accessing Database Tables 412

Open SQL 413

Reading Data Using the SELECT Statement 416


The SELECT Clause 417
The INTO Clause 428
The FROM Clause 437
The WHERE Clause 446

The GROUP BY Clause 459


The HAVING Clause 462
The ORDER BY Clause 463

Subqueries 465

Examples of Subqueries 467

Inserting Data into a Database Table 471

Examples of Data Insertion 472

Updating Data in a Database Table 477

Examples of Updating Data in Tables 479

Deleting the Data from a Database Table 483

Examples of Deleting Data 485

Modifying the Lines of Database Tables 488

Using Cursors to Read Data 490

Opening and Closing Cursors 491

Retrieving Data 491

Committing Database Changes 494

Summary 495
Ta8le of Contents xv

Chapter 9 Modularization Techniques 497

Working with Subroutines 498


Working with Formal and Actual Parameters 503
Handling Data in Subroutines 505
Using Local Field Symbols 510
Making Internal and External Calls 513
Passing Parameters Subroutines
to 518
Terminating Subroutines by Using EXIT and
CHECK Statements 524
Function Modules 526
Creating Modules
Function 528
Calling Function Modules from ABAP Programs 540
Source Code Modules 543
Macros 544
Include Programs 545
Summary 548

Chapter 10 ABAP User Dialogs 549

Introducing Dialog Program ming 550


Screen Painter 552
Learning About Attributes 555
Flow Logic 559
Learning About the Layout Editor 561
The Tabstrip Control in Graphical
Layout Editor 568
Creating a Table Control by Using Graphical
Layout Editor 590
Menu Painter 599
Working with Menu Painter 600
Working with Selection Screens 620
Defining a Selection Screen 620
Calling a Selection Screen 638
Processing Selection Screens 643
Summary 643
xvi Table of Contents

Chapter 11 The BDC and LSMW Tools 645

The Data Transfer Techniques 646


The Batch Input Technique 646
The Direct Input Technique 649
The BAPI Technique 649

Data Transfer Methods 649


The Direct Input Method 650
The Call Transaction Method 650
The Batch Input with Session Method 651
Data Transfer by Using the BDCDATA Structure 652
The BDC Tool 653

Creating a BDC
Program by Using the Call
Transaction Method 653

Transferring Data by Using the Batch Input


with Session Method of BDC 675
The LSMW Tool 697

Updating Records by Using the Batch Input


Recording Method 698

Summary 733

Chapter 12 Forms in mySAP ERP: SAPscript and SAP Smart Forms 735

Exploring the SAPscript Tool 736


Components of theSAPscript Tool 738
Structure of an SAPscript Form 739
Managing Tools 743
Accessing the Form Painter Tool 747
Form Subobjects 751
The SAPscript Runtime Environment 762
Print Program 763
SAPscript Function Modules 771
Controlling the SAPscript Forms 787
SAPscript Control Commands 789
SAPscript Symbols 791
The SAP Smart Forms Tool 793
Overview of the SAP Smart Forms Tool 794
SAP Smart Form Components 795
Table of Contents xvii

Explaining the Smart Form Process 798


Advantages of Smart Forms 800

Important Objects for Form Development 800

Creating and Maintaining Smart Forms 801

Style Builder 806

Comparing SAPscript and Smart Forms 808

Migrating SAPscript Forms to Smart Forms 810


Individual Migration 811
Mass Migration 812

Converting a Style 814

Summary 816

Chapter 13 Reports 817

Working with Classical Reports 818

Creating a Classical Report 820


Interactive Reports 827

Creating an Interactive Report 829

Comparing Classical and Interactive Reports 839


ALV
Reports 839

Creating an ALV Report 840

Summary 846

Chapter 14 Business Add-Ins (BADIs) 847

Concept of BADIs 848


Enhancement Framework 849
Overview of Enhancement 851
The Enhancement Builder Tool 854
Enhancement Techniques in Enhancement Framework 854
Structure of a BADI 856
Definition of BADIs 858

Defining a BADI 860

Displaying, Changing, or Deleting a BADI Definition 869

Implementation of BADIs 870


Calling BADIs 875
Differences Between Classic and New BADIs 875

Filter-Dependent BADIs 876


xviii Table of Contents

Function Code Enhancements 878


Screen Enhancements 879
Summary 880

Appendix A Object Orientation in ABAP 881

Overview of ABAP Objects 882

Explaining the Basic Concepts of OOP in ABAP 883


Objects 884
Classes 885
Interfaces 885
Encapsulation 885
Inheritance 886
Polymorphism 887
Defining and Implementing a Class 887
Exploring the Components of a Class 889
Visibility Sections in a Class 892

Handling the Objects 893

Declaring and Implementing Interfaces 895


Declaring and Calling Methods 898
Declaring and Calling Constructors 901

Working with Events in ABAP Objects 902


Triggering an Event 903
Handling an Event 904

Appendix B Introducing Cross-Application Technologies 907

Introducing IDoc 908


Exploring the Uses of IDoc 909
EDI Technique 909
ALE Technique 910
Legacy System Integration 910
Third-Party Product Integration 910
Workflow Integration 911
SAP R/2 System 911
Internet and XML Integration 911
OCR Integration 912
ICR Integration 912
Table of Contents xix

Benefits of the IDoe Interface 912


Describing the IDoc Structure 913
IDoc Runtime Components 917
Control Record
917
Data Records
918
Status Records
918
ALE
919
ALE Architecture 920
RFC
924
RFC Interface 924
Types of RFC
926

Glossary 927

Index
943

Potrebbero piacerti anche