247
SAP R/3 ABAP Workbench Concept and Tool Overview

ABAP Overview

Embed Size (px)

DESCRIPTION

SAP ABAP training doc

Citation preview

Page 1: ABAP Overview

SAP R/3 ABAP Workbench Concept and Tool

Overview

Page 2: ABAP Overview

Objectives:

Output:

Selection-screen: Logic:1.Retrieve data from Invoice table (VBRK) according to user selection and put into internal table.2.Based on Invoice internal table (point 1), retrieve payer name from Customer master table (KNA1).3.Loop at Invoice internal table (point 1) to print all invoices.4.Print the total amount of invoice by currency.

Page 3: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 4: ABAP Overview

Program Flow in ABAP Program

Client/Server Architecture

Program with data displayed in list form

Program with data displayed on the screen

Page 5: ABAP Overview

Client/Server Architecture

Page 6: ABAP Overview

User Oriented View

Page 7: ABAP Overview

Program Flow : What the User Sees

Page 8: ABAP Overview

Interface Between Server Layers

Page 9: ABAP Overview

Program Flow in ABAP Program

Client/Server Architecture

Program with data displayed in list form

Program with data displayed on the screen

Page 10: ABAP Overview

Program start

Page 11: ABAP Overview

System Load Program Context

Page 12: ABAP Overview

Runtime System Send Selection Screen

Page 13: ABAP Overview

Selection Screen Entries Inserted into Data Objects

Page 14: ABAP Overview

Program Request Data Record from Database

Page 15: ABAP Overview

Database Returns Data Record to Program

Page 16: ABAP Overview

Runtime System Send List

Page 17: ABAP Overview

Program Flow in ABAP Program

Client/Server Architecture

Program with data displayed in list form

Program with data displayed on the screen

Page 18: ABAP Overview

Program start

Page 19: ABAP Overview

Runtime System Send Screen

Page 20: ABAP Overview

User Leaves Selection Screen

Page 21: ABAP Overview

Program Request Data Record from Database

Page 22: ABAP Overview

Database Returns Data Record to Program

Page 23: ABAP Overview

Program Call Screen

Page 24: ABAP Overview

Runtime System Send Selection Screen

Page 25: ABAP Overview

User Executes User Action

Page 26: ABAP Overview

Processing of ABAP Processing Block Resumes

Page 27: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 28: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program

Adapting an existing program to special requirement

Creating New Program

Page 29: ABAP Overview

R/3 Repository

Page 30: ABAP Overview

Repository Structure

Packages

Page 31: ABAP Overview

SAP Application Hierarchy

Page 32: ABAP Overview

Repository Information System

Page 33: ABAP Overview

ABAP Workbench Tools

Page 34: ABAP Overview

Screen Structure in the Object Navigator

Page 35: ABAP Overview

Navigation Functions in the Navigation Area

Page 36: ABAP Overview

Navigation in the Tool Area

Page 37: ABAP Overview

Synchronizing the Navigation Area and the Tool Area

Page 38: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program Executing a Program Static Analysis : Object List Dynamic Analysis : Debugging Mode Analyzing the Source Code

Adapting an existing program to special requirement

Creating New Program

Page 39: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program Executing a Program Static Analysis : Object List Dynamic Analysis : Debugging Mode Analyzing the Source Code

Adapting an existing program to special requirement

Creating New Program

Page 40: ABAP Overview

Executing a Program Using a Transaction Code

Page 41: ABAP Overview

Determining Screen Number and Field Names

Page 42: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program Executing a Program Static Analysis : Object List Dynamic Analysis : Debugging Mode Analyzing the Source Code

Adapting an existing program to special requirement

Creating New Program

Page 43: ABAP Overview

Static Analysis in the Object Navigator

Page 44: ABAP Overview

Example : Displaying Screen 100 in the Screen Painter

Page 45: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program Executing a Program Static Analysis : Object List Dynamic Analysis : Debugging Mode Analyzing the Source Code

Adapting an existing program to special requirement

Creating New Program

Page 46: ABAP Overview

Starting a Program in Debugging Mode

Page 47: ABAP Overview

Switch to Debugging Mode at Runtime

Page 48: ABAP Overview

Investigating the Behaviour of ABAP Programs at Runtime: Breakpoint in the Debugging Mode

Page 49: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program Executing a Program Static Analysis : Object List Dynamic Analysis : Debugging Mode Analyzing the Source Code

Adapting an existing program to special requirement

Creating New Program

Page 50: ABAP Overview

General ABAP Syntax: Key Words

Page 51: ABAP Overview

Keyword Documentation in Editor

Page 52: ABAP Overview

Navigation in the Editor: Double-Clicking

Page 53: ABAP Overview

Comment

Page 54: ABAP Overview

Analyzing the Sample Program Source Code

Page 55: ABAP Overview

Data Object and Selection Screen

Page 56: ABAP Overview

Requesting a Data Record from the Database

Page 57: ABAP Overview

Receiving the Result of a Query

Page 58: ABAP Overview

Processing Screen

Page 59: ABAP Overview

Creating List

Page 60: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program

Adapting an existing program to special requirement

Creating New Program

Page 61: ABAP Overview

Example : requirement to change the layout

Page 62: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program

Adapting an existing program to special requirement Project organization Performing adjustment Activating program objects

Creating New Program

Page 63: ABAP Overview

Transporting Repository Objects

Page 64: ABAP Overview

Project Representation in the Workbench Organizer

Page 65: ABAP Overview

Completing the Development Process

Page 66: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program

Adapting an existing program to special requirement Project organization Performing adjustment Activating program objects

Creating New Program

Page 67: ABAP Overview

Copying Program

Page 68: ABAP Overview

Saving Program

New program must be

assigned to Package

Page 69: ABAP Overview

Allocation to Change Request

Page 70: ABAP Overview

Adjusting Title

Page 71: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program

Adapting an existing program to special requirement Project organization Performing adjustment Activating program objects

Creating New Program

Page 72: ABAP Overview

Checking, Saving, and Activating

Page 73: ABAP Overview

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program

Adapting an existing program to special requirement Project organization Performing adjustment Activating program objects

Creating New Program

Page 74: ABAP Overview

Creating a Program

Page 75: ABAP Overview

Maintain the Program Attribute

Page 76: ABAP Overview

Creating a Transaction Code

Page 77: ABAP Overview

Including a Transaction Code in SAP Easy Access

Page 78: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement 4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 79: ABAP Overview

ABAP Statement and Data Declaration

Types

Data Object

ABAP Statement Attributes

Page 80: ABAP Overview

Using Types

Page 81: ABAP Overview

Attributes of Global and Local Program Types

Page 82: ABAP Overview

Global Types in ABAP Dictionary

Page 83: ABAP Overview

Example: Using Semantic Information from the Dictionary

Page 84: ABAP Overview

Finding ABAP Dictionary Types in the Repository Information System

Page 85: ABAP Overview

Local Data Types in Program

Page 86: ABAP Overview

ABAP Statement and Data Declaration

Types

Data Object

ABAP Statement Attributes

Page 87: ABAP Overview

Defining Data Object

Page 88: ABAP Overview

ABAP Statement and Data Declaration

Types

Data Object Elementary Data Object Structures Internal Table

ABAP Statement Attributes

Page 89: ABAP Overview

Sintax Example : Defining Elementary Data Objects

Page 90: ABAP Overview

Fixed Data Objects

Page 91: ABAP Overview

Copying and Initializing Variables

Page 92: ABAP Overview

Performing Calculations

Page 93: ABAP Overview

Evaluating Field Contents

Page 94: ABAP Overview

ABAP Statement and Data Declaration

Types

Data Object Elementary Data Object Structures Internal Table

ABAP Statement Attributes

Page 95: ABAP Overview

Example : Dictionary Structure Type SBC400FOCC

Page 96: ABAP Overview

Syntax Example: Local Program Structure Types

Page 97: ABAP Overview

Addressing Fields in Structures

Page 98: ABAP Overview

Copying Identically Named Fields between Structures

Page 99: ABAP Overview

Structures in Debugger

Double-click

Page 100: ABAP Overview

Data Objects in a Program’s Object List and in the Where-Used List

Page 101: ABAP Overview

ABAP Statement and Data Declaration

Types

Data Object Elementary Data Object Structures Internal Table

ABAP Statement Attributes

Page 102: ABAP Overview

Internal Tables

Page 103: ABAP Overview

Attribute of Internal Tables

Page 104: ABAP Overview

The Relation between the Table Kind and the Access Type

Page 105: ABAP Overview

Declaring Internal Tables with a Dictionary Type Reference

Page 106: ABAP Overview

Sintax Example: Local Table Type in Program

Page 107: ABAP Overview

Accessing Single Record

Page 108: ABAP Overview

Processing Set of Records

Page 109: ABAP Overview

Example: Filling Internal Table line by line

Page 110: ABAP Overview

Example: Reading Internal Table Contents using a Loop

Page 111: ABAP Overview

Example: Reading Internal Table Contents using the Index

Page 112: ABAP Overview

Example: Reading Internal Table using Keys

Page 113: ABAP Overview

Operation on the whole Table

Page 114: ABAP Overview

Sintax Example: Sorting a Standard Table

Page 115: ABAP Overview

Internal Tables in Debugging Mode

Page 116: ABAP Overview

Internal Tables with Header

Page 117: ABAP Overview

ABAP Statement and Data Declaration

Types

Data Object

ABAP Statement Attributes

Page 118: ABAP Overview

ABAP Statement Return Code

Page 119: ABAP Overview

Standard Dialogs for Messages

Page 120: ABAP Overview

Sintax Example: MESSAGE Statement

Page 121: ABAP Overview

The Dialog Behaviour of Message: Message Types

Page 122: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 123: ABAP Overview

Database Dialog I

Information on database table in R/3

Reading database tables

Authorization checks

Reading multiple database tables

Page 124: ABAP Overview

Maintenance Tool: ABAP Dictionary

Page 125: ABAP Overview

Finding Fields, Key Fields, and Secondary Indexes

Page 126: ABAP Overview

Finding Database Tables

Page 127: ABAP Overview

Database Dialog I

Information on database table in R/3

Reading database tables

Authorization checks

Reading multiple database tables

Page 128: ABAP Overview

Querying the Database

Page 129: ABAP Overview

SELECT Overview

Page 130: ABAP Overview

Reading a Single Record

Page 131: ABAP Overview

Reading Several Records using a SELECT Loop

Page 132: ABAP Overview

Reading Several Records using an Array Fetch

Page 133: ABAP Overview

The Field List and Appropriate Target Structure: the INTO Clause

Page 134: ABAP Overview

Target Structure with Identically-Named Fields for All Columns Specified

Page 135: ABAP Overview

Database Dialog I

Information on database table in R/3

Reading database tables

Authorization checks

Reading multiple database tables

Page 136: ABAP Overview

Authorization Check in ABAP Program

Page 137: ABAP Overview

Authorization Objects

Page 138: ABAP Overview

Statement: AUTHORITY-CHECK

Page 139: ABAP Overview

Inserting AUTHORITY-CHECK in Program

Page 140: ABAP Overview

Inserting AUTHORITY-CHECK in Program

Page 141: ABAP Overview

Reading Multiple Database Tables

Page 142: ABAP Overview

Dictionary View and ABAP Joint

Page 143: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 144: ABAP Overview

Possible Elements in ABAP Program

Page 145: ABAP Overview

Internal Program Modularization

Event Block

Subroutines

Page 146: ABAP Overview

Example: ABAP Program with Event Block and a Selection Screen

Page 147: ABAP Overview

Sample Program Runtime Behaviour

Page 148: ABAP Overview

Event Blocks in Executable Programs

Page 149: ABAP Overview

Sintax: Event Blocks

Page 150: ABAP Overview

Internal Program Modularization

Event Block

Subroutines

Page 151: ABAP Overview

Example: Flow Chart

Page 152: ABAP Overview

Concept: Encapsulating Output in a Subroutine

Page 153: ABAP Overview

Calling Subroutine

Page 154: ABAP Overview

Sintax Example: Calling the Subroutine

Page 155: ABAP Overview

Generating a Call Using Drag & Drop

Page 156: ABAP Overview

Subroutine in the Debugging Mode

Page 157: ABAP Overview

Subroutine that Return Data

Page 158: ABAP Overview

Syntax Example: Subroutine with USING and CHANGING Parameter

Page 159: ABAP Overview

Copying Large Internal Table

Page 160: ABAP Overview

Solution: Reference Parameters

Page 161: ABAP Overview

Sintax Example: Subroutine with Interface Reference Parameters

Page 162: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 163: ABAP Overview

List Attributes

Page 164: ABAP Overview

Standard List Functions

Page 165: ABAP Overview

Column Header in the Default Page Header

Page 166: ABAP Overview

Multilingual Capability

Page 167: ABAP Overview

List in Executable Program

Page 168: ABAP Overview

Detail List

Page 169: ABAP Overview

Example: A Simple Detail List

Page 170: ABAP Overview

Syntax: A Simple Detail List

Page 171: ABAP Overview

Example: Detail List

Page 172: ABAP Overview

Placing Global Data in the HIDE Area

Page 173: ABAP Overview

Line Selection

Page 174: ABAP Overview

Line Selection: Syntax

Page 175: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 176: ABAP Overview

Use of Selection Screen

Page 177: ABAP Overview

User Dialog: Selection Screen

Selection screen attributes

Single field (PARAMETERS)

Value set (SELECT-OPTIONS)

Selection screen event

Page 178: ABAP Overview

The Selection Screen

Page 179: ABAP Overview

Entering Selections

Page 180: ABAP Overview

Using the Semantic Information of Dictionary Types

Page 181: ABAP Overview

Selection Texts

Page 182: ABAP Overview

Variant

Page 183: ABAP Overview

User Dialog: Selection Screen

Selection screen attributes

Single field (PARAMETERS)

Value set (SELECT-OPTIONS)

Selection screen event

Page 184: ABAP Overview

Effect of the PARAMETERS Statement

Page 185: ABAP Overview

Runtime Behaviour and Data Transport for PARAMETERS

Page 186: ABAP Overview

Using PARAMETERS when Accessing the Database

Page 187: ABAP Overview

User Dialog: Selection Screen

Selection screen attributes

Single field (PARAMETERS)

Value set (SELECT-OPTIONS)

Selection screen event

Page 188: ABAP Overview

Effect of SELECT-OPTIONS

Page 189: ABAP Overview

Runtime Behaviour and Data Transport for SELECT-OPTIONS

Page 190: ABAP Overview

Using SELECT-OPTIONS when Accessing the Database

Page 191: ABAP Overview

User Dialog: Selection Screen

Selection screen attributes

Single field (PARAMETERS)

Value set (SELECT-OPTIONS)

Selection screen event

Page 192: ABAP Overview

Selection Screen Event

Page 193: ABAP Overview

Error Message in AT SELECTION-SCREEN

Page 194: ABAP Overview

Syntax Example for AT SELECTION-SCREEN

Page 195: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 196: ABAP Overview

Selection Screen Attributes

Page 197: ABAP Overview

Option for Calling Screens

Page 198: ABAP Overview

Part of a Screen

Page 199: ABAP Overview

Editing Screen

Page 200: ABAP Overview

The Editing Window in the Graphical Layout Editor

Page 201: ABAP Overview

Example: creating screen

Page 202: ABAP Overview

Creating a Screen : Screen Attribute

Page 203: ABAP Overview

Input Fields with Reference to Fields of a Dictionary Structure

Page 204: ABAP Overview

The Attribute Window

Page 205: ABAP Overview

Screen Interfaces

Page 206: ABAP Overview

Syntax: Example Program with Data Transport

Page 207: ABAP Overview

Example: Defining Pushbutton

Page 208: ABAP Overview

Runtime Behaviour when User Choose the Pushbutton

Page 209: ABAP Overview

Defining Pushbutton: Assigning Function Code

Page 210: ABAP Overview

Making the Command Field Usable

Page 211: ABAP Overview

Modules

Page 212: ABAP Overview

The User Command: PAI Module

Page 213: ABAP Overview

Creating Modules using Forward Navigation

Page 214: ABAP Overview

Next Screen (Set Statically) = 0

Page 215: ABAP Overview

Next Screen (Set Statically) = Screen Number

Page 216: ABAP Overview

Set the Next Screen Dinamically

Page 217: ABAP Overview

Exceptional Runtime Behavior when ENTER is not Assigned to a Function Code

Page 218: ABAP Overview

Possible Solution: Clear the Command Field in a PBO Module

Page 219: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 220: ABAP Overview

Status: Functions in Screen

Page 221: ABAP Overview

Runtime Behaviour: Setting a Status before Displaying a Screen

Page 222: ABAP Overview

Creating GUI Status

Page 223: ABAP Overview

Adjusting GUI Status

Page 224: ABAP Overview

GUI Status: Key Setting

Page 225: ABAP Overview

GUI Status: the Menu Bar

Page 226: ABAP Overview

Example: Technical View of Basic Interface Elements

Page 227: ABAP Overview

Each Referenced Function has the Attribute Active or Inactive in the Status

Page 228: ABAP Overview

Setting Functions to Active or Inactive in the Status

Page 229: ABAP Overview

GUI Title

Page 230: ABAP Overview

Creating GUI Title

Page 231: ABAP Overview

Contents

1. Program Flow in ABAP Program2. Introduction to ABAP Workbench3. Data Declaration and ABAP Statement4. Database Dialogs5. Internal Program Modularization6. User Dialogs : List7. User Dialogs : Selection-screen8. User Dialogs : Screen9. Interfaces10. Reuse Components

Page 232: ABAP Overview

Techniques for Encapsulating Business Logic

Page 233: ABAP Overview

Reuse Component

Function Group and Function Module

Business Object and BAPI

Page 234: ABAP Overview

Function Group

Page 235: ABAP Overview

Function Module

Page 236: ABAP Overview

Function Group: Data Flow

Page 237: ABAP Overview

Finding the Function Module

Page 238: ABAP Overview

Function Module Interface

Page 239: ABAP Overview

Fuction Module Documentation and Testing

Page 240: ABAP Overview

Syntax: Calling the Function Module

Page 241: ABAP Overview

Inserting a Function Module Call in a Program

Page 242: ABAP Overview

Reuse Component

Function Group and Function Module

Business Object and BAPI

Page 243: ABAP Overview

BAPI and Businness Object

Page 244: ABAP Overview

Where are BAPIs Used ?

Page 245: ABAP Overview

Standarized BAPI

Page 246: ABAP Overview

Finding BAPI Function Module

Page 247: ABAP Overview

Condition for BAPI Function Module