Document not found! Please try again

SAP ABAP handbook

267 downloads 856 Views 336KB Size Report
SAP' ABAP. Handbook. Kogent Learning Solutions, Inc. JONES AND BARTLETT PUBLISHERS. Sudbury, Massachusetts. BOSTON. TORONTO. LONDON.
SAP' ABAP Handbook Kogent Learning Solutions,

JONES AND BARTLETT PUBLISHERS

Sudbury, Massachusetts BOSTON

TORONTO

LONDON

SINUAPORI:

Inc.

Table

of

Contents

Introduction

xxi

About This Book

xxi

How to Use This Book

xxii

Conventions

xxii

Other Resources

Chapter

1

A

Gateway

to SAP

xxiv

1

Systems

Explaining the Concept of an ERP System History

of SAP

Systems

Need for ABAP

6

the Architecture of SAP R/3

Exploring The Logical View

9

10

The User-Oriented View

13

Explaining Application Server Dispatching Dialog Steps Describing the User Context and Roll Area in the SAP System The Client-Dependency Feature Summary The

8

The Software-Oriented View the Architecture of the

Chapter 2

2 4

Logon Process of the

SAP

System

Starting the SAP System Maintaining the SAP Logon Screen Adding a New Entry Modifying the Entry Deleting the Entry Creating and Using SAP Shortcuts Creating SAP Shortcuts

Configuring

the SAP

Logon

14 22 24 26 26 27 28 31 31

35 36 37 37 47

ix

x

Table

Chapter 3

of

Contents

Changing the Password

50

Logging Off of the SAP System Summary

52

SAP

55

Easy Access

Explaining the SAP Easy Access Screen Exploring the GUI of the SAP System

56 60

The Screen Header

60

The Screen

67

Body

the SAP GUI

Customizing Managing Favorites

70

Adding an Item

75

72

Folders

Inserting Moving Favorites and Folders Renaming Favorites and Folders Deleting Favorites and Folders Adding a Web Address Handling SAP Sessions Creating a New Session Displaying a List of All Sessions Ending a Session Summary Chapter 4

53

Understanding

ABAP

Workbench

Overview of ABAP Workbench

Exploring

the ABAP Workbench Tools

76 78 80 82 82 84

84 86 87 88 89 90 91

ABAP

Dictionary

92

ABAP

Editor

94

Front-End Editor (New) Front-End Editor (Old)

95

Back-End Editor

98

Class Builder

99

96

Function Builder

101

Screen Painter

102

Menu Painter

103

Table

Object Navigator Message

Contents

xi

105

Maintenance

109

ABAP Text Elements

110

M aintain Transaction

111

Describing Package

Builder

112

of

Types Packages Testing Tools in ABAP Workbench ABAP Debugger ABAP Runtime Analysis Performance

Describing

Analysis

113 114 114 115

116

Web S ervices

117

Web

ITS

118

Web

BSP

119

Application Builder for Application Builder for Describing XSLT Editor Summary

Chapter 5

of

ABAP

120

121

Dictionary

Overview of ABAP

123

Dictionary

124

Exploring Domains Describing Fixed Values for Domains Exploring Conversion Routines for Domains

125

Creating

a

Domain

Modifying the Existing Domain Deleting

Exploring

a

Domain

Data Types

126 127 128 133 138 138

Data Elements

138

Structures

144

Table Types

144

Exploring Type Groups Exploring Database Tables Types of Tables Types of Table Fields Technical Settings of a Table Creating Tables Relating Tables by Using Foreign Keys

145 146 148 152 154 158 174

xii

Table

of

Contents

Exploring Views

180

Database Tables

Relating Using Relational Operators Creating Different Types of Views

181

Deleting Views

211

Exploring Search Helps Elementary Search Help Collective Search Help Append Search Help Exploring Lock Objects Describing Lock Argu m ents Exploring the Lock Mode and the Lock Table Describing the Lock Mechanism Creating Lock Objects Summary

Chapter 6

ABAP

184

212 212

213 214 215 217 218 220 222 226

Programming

Structure of an ABAP

in ABAP

Editor

227

Program

Introductory Program

228

Part

229

Declaration Part for Global Data, Class and Selection Screens

Definitions, 229

Processing Blocks

230

ABAP Editor

231

Types

of ABAP

ABAP

Syntax

Programs

236 238

Inserting Comments into ABAP Programs Exploring Types and Objects Data Types Object Types Objects in ABAP

239

Variables in ABAP

248

The

Statement

DATA

The

258

Assignment Statements The

MOVE

-

CORRESPONDING

246

256

TABLES Statement

MOVE Statement

245

252

in ABAP

The

242

248

The PARAMETERS Statement

Constants

241

259 259 Statement

263

Table

The

WRITE

The

CLEAR

TO

of

Contents

Statement

265

Statement

266 268

Formatting Options The

WRITE

The

FORMAT

Statement

268

Statement

271

System Variables

Exploring Dynamic Assignment Describing Flow Control The

Chapter 7

IF.

.

.

ENDIF

xiii

278 278

Statements

279

Control Statement

280 289

Looping Terminating Loops Summary

294

Internal Tables

299

Overview of Internal Tables

300

Data Types of an Internal Table

303

Types

297

of Internal Tables

303

Standard Tables

304

Sorted Tables

304

Hashed Tables

305

Internal Tables

Creating Creating Internal Tables as Creating Internal Tables as

305 Data

Types

306

Data

Objects

313

Performing Operations on an Entire Internal Table Moving and Assigning Internal Tables

Initializing Internal Tables Refreshing Internal Tables Releasing the Memory of Internal Tables Comparing

Internal Tables

Performing the

Sort Operation in Internal Tables Determining the Attributes of Internal Tables Operations on Individual Lines Inserting Lines in Internal Tables Inserting Summarized Lines in Internal Tables

Appending Lines to Internal Tables Reading the Lines of Internal Tables Modifying the Lines of Internal Tables

316 316 319 320 320 322 325 333 335 337 346 348 356 364

xiv

Table

of

Contents

Deleting Lines Searching Table

373 386

Entries

Maintaining Internal Tables Processing

390

The

AT

FIRST and AT LAST Statements

392

The

AT

NEW

The

SUM

The

ON

392

Control Break

and AT

END

OF Statements

Statement CHANGE

OF

401 Statement

403 410

Summary

Chapter 8

395

Accessing Data in

the SAP

System

Accessing Database Tables Open SQL Reading Data Using the SELECT The

SELECT

The

INTO

411 412 413

Statement

Clause

416 417

Clause

428

The FROM Clause

437

The WHERE Clause

446

The

GROUP BY

459

The

HAVING

The ORDER

Clause

Clause BY

Clause

462 463

Subqueries Examples of Subqueries Inserting Data into a Database Table

465

Examples of Data Insertion Updating Data in a Database Table Examples of Updating Data in Tables

472

Deleting the Data from a Database Table Examples of Deleting Data Modifying the Lines of Database Tables

483

Using

Cursors

Opening

to

Read Data

and Closing Cursors Data

Retrieving Committing Database Changes Summary

467

471 477 479 485 488 490 491 491 494 495

Ta8le of Contents

Chapter

9

Modularization

Techniques

Working with Subroutines Working with Formal and Actual Parameters Handling Data in Subroutines Using

Local Field

Making

Symbols

Internal and External Calls

Subroutines Passing Terminating Subroutines by Using EXIT and Parameters

CHECK

to

Statements

Modules Creating Calling Function Modules from ABAP Programs Source Code Modules

505 510 513 518

528 540 544 545

Programs

Summary ABAP

503

543

Macros

10

498

526

Function

Chapter

497

524

Function Modules

Include

xv

548

Dialogs

549

Introducing Dialog Program ming

550

Screen Painter

552

User

About Attributes

Learning Flow Logic Learning About the Layout Editor The Tabstrip Control in Graphical Layout Editor

561

by Using Graphical 590

Menu Painter

599

Working with Menu Painter Working with Selection Screens Defining a Selection Screen Calling a Selection Screen Processing Selection Summary

559

568

Table Control

Creating a Layout Editor

555

Screens

600 620 620 638 643 643

xvi

Chapter

Table

11

of

Contents

The BDC and LSMW Tools

645

The Data Transfer

646

The Batch

646

The

649

The

Techniques Input Technique Direct Input Technique BAPI Technique

649

Data Transfer Methods

The Direct

Input

649

Method

650

The Call Transaction Method

650

The Batch

651

Data

Transfer

Input with Session Method

by Using the

BDCDATA Structure

The BDC Tool

Creating

a

653 BDC

Program by Using the Call

Transaction Method

Transferring

Data by Using the Batch

653

Input

with Session Method of BDC

675

The LSMW Tool

697

Updating Records by Using the Batch Input Recording Method

Forms in

ERP:

mySAP

SAPscript and SAP

Exploring the SAPscript Tool Components

of the

Structure of an

SAPscript Tool SAPscript Form

Managing Tools Accessing the Form Form

698 733

Summary Chapter 12

652

Smart Forms

735 736 738 739 743

Painter Tool

Subobjects

747 751

The

SAPscript Runtime Environment Print Program SAPscript Function Modules Controlling the SAPscript Forms SAPscript Control Commands SAPscript Symbols The SAP Smart Forms Tool

762 763 771 787 789

791 793

Overview of the SAP Smart Forms Tool

794

SAP Smart Form

795

Components

Table

Explaining the Smart

of Contents

Form Process

798

Advantages of Smart Forms Important Objects for Form Development Creating and Maintaining Smart Forms

800

Style Builder

806

and Smart Forms

Comparing SAPscript Migrating SAPscript Forms Individual Migration Mass Migration Converting a Style Summary Chapter

13

801 808

to Smart Forms

810 811 812 814 816 817

Working with Classical Reports Creating a Classical Report

818

Interactive

827

820

Reports an

Comparing ALV Reports Creating

an

Interactive

829

Report

Classical and Interactive

Reports

839 839

ALV

840

Report

846

Summary 14

800

Reports

Creating

Chapter

xvii

Business Add-Ins

847

(BADIs)

of BADIs

848

Enhancement Framework

849

Concept

851

Overview of Enhancement

854

The Enhancement Builder Tool Enhancement

Techniques

in

Enhancement Framework

854

Structure of a BADI

856

Definition of BADIs

858

Defining Displaying, Changing, Implementation of BADIs Calling BADIs a

860

BADI

or

Deleting a

BADI Definition

869

870 875

Differences Between Classic and New BADIs

875

Filter-Dependent

876

BADIs

xviii

Table

Appendix A

of

Contents

Function Code Enhancements

878

Screen Enhancements

879

Summary

880

Object

Orientation in ABAP

Overview of ABAP

Objects

the Basic

Explaining Objects

Concepts

881 882

of OOP in ABAP

883 884

Classes

885

Interfaces

885

Encapsulation

885

Inheritance

886

Polymorphism

887

Defining and Implementing a Class Exploring the Components of a Class Visibility Sections in a Class Handling the Objects Declaring and Implementing Interfaces Declaring and Calling Methods Declaring and Calling Constructors Working with Events in ABAP Objects Triggering Handling an

an

Event

Event

Appendix B Introducing Cross-Application Technologies Introducing IDoc Exploring the Uses of IDoc EDI Technique ALE

Technique

887 889 892 893

895 898 901

902 903 904 907 908 909 909 910

Legacy System Integration

910

Third-Party Product Integration

910

Workflow Integration

911

SAP R/2

911

System

Internet and XML

Integration

911

OCR

912

ICR

912

Integration Integration

Table

Benefits of the IDoe Interface Describing the IDoc Structure IDoc Runtime

Components

xix

912 913 917

917

Data Records

918

Status Records

918 919

ALE Architecture RFC

Types

920

924

RFC Interface

Index

Contents

Control Record

ALE

Glossary

of

of RFC

924

926 927 943