ABAP Overview

Post on 21-Jul-2016

105 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

SAP ABAP training doc

Transcript

SAP R/3 ABAP Workbench Concept and Tool

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.

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

Program Flow in ABAP Program

Client/Server Architecture

Program with data displayed in list form

Program with data displayed on the screen

Client/Server Architecture

User Oriented View

Program Flow : What the User Sees

Interface Between Server Layers

Program Flow in ABAP Program

Client/Server Architecture

Program with data displayed in list form

Program with data displayed on the screen

Program start

System Load Program Context

Runtime System Send Selection Screen

Selection Screen Entries Inserted into Data Objects

Program Request Data Record from Database

Database Returns Data Record to Program

Runtime System Send List

Program Flow in ABAP Program

Client/Server Architecture

Program with data displayed in list form

Program with data displayed on the screen

Program start

Runtime System Send Screen

User Leaves Selection Screen

Program Request Data Record from Database

Database Returns Data Record to Program

Program Call Screen

Runtime System Send Selection Screen

User Executes User Action

Processing of ABAP Processing Block Resumes

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

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program

Adapting an existing program to special requirement

Creating New Program

R/3 Repository

Repository Structure

Packages

SAP Application Hierarchy

Repository Information System

ABAP Workbench Tools

Screen Structure in the Object Navigator

Navigation Functions in the Navigation Area

Navigation in the Tool Area

Synchronizing the Navigation Area and the Tool Area

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

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

Executing a Program Using a Transaction Code

Determining Screen Number and Field Names

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

Static Analysis in the Object Navigator

Example : Displaying Screen 100 in the Screen Painter

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

Starting a Program in Debugging Mode

Switch to Debugging Mode at Runtime

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

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

General ABAP Syntax: Key Words

Keyword Documentation in Editor

Navigation in the Editor: Double-Clicking

Comment

Analyzing the Sample Program Source Code

Data Object and Selection Screen

Requesting a Data Record from the Database

Receiving the Result of a Query

Processing Screen

Creating List

Introduction to ABAP Workbench

Repository and Workbench

Analyzing an existing Program

Adapting an existing program to special requirement

Creating New Program

Example : requirement to change the layout

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

Transporting Repository Objects

Project Representation in the Workbench Organizer

Completing the Development Process

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

Copying Program

Saving Program

New program must be

assigned to Package

Allocation to Change Request

Adjusting Title

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

Checking, Saving, and Activating

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

Creating a Program

Maintain the Program Attribute

Creating a Transaction Code

Including a Transaction Code in SAP Easy Access

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

ABAP Statement and Data Declaration

Types

Data Object

ABAP Statement Attributes

Using Types

Attributes of Global and Local Program Types

Global Types in ABAP Dictionary

Example: Using Semantic Information from the Dictionary

Finding ABAP Dictionary Types in the Repository Information System

Local Data Types in Program

ABAP Statement and Data Declaration

Types

Data Object

ABAP Statement Attributes

Defining Data Object

ABAP Statement and Data Declaration

Types

Data Object Elementary Data Object Structures Internal Table

ABAP Statement Attributes

Sintax Example : Defining Elementary Data Objects

Fixed Data Objects

Copying and Initializing Variables

Performing Calculations

Evaluating Field Contents

ABAP Statement and Data Declaration

Types

Data Object Elementary Data Object Structures Internal Table

ABAP Statement Attributes

Example : Dictionary Structure Type SBC400FOCC

Syntax Example: Local Program Structure Types

Addressing Fields in Structures

Copying Identically Named Fields between Structures

Structures in Debugger

Double-click

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

ABAP Statement and Data Declaration

Types

Data Object Elementary Data Object Structures Internal Table

ABAP Statement Attributes

Internal Tables

Attribute of Internal Tables

The Relation between the Table Kind and the Access Type

Declaring Internal Tables with a Dictionary Type Reference

Sintax Example: Local Table Type in Program

Accessing Single Record

Processing Set of Records

Example: Filling Internal Table line by line

Example: Reading Internal Table Contents using a Loop

Example: Reading Internal Table Contents using the Index

Example: Reading Internal Table using Keys

Operation on the whole Table

Sintax Example: Sorting a Standard Table

Internal Tables in Debugging Mode

Internal Tables with Header

ABAP Statement and Data Declaration

Types

Data Object

ABAP Statement Attributes

ABAP Statement Return Code

Standard Dialogs for Messages

Sintax Example: MESSAGE Statement

The Dialog Behaviour of Message: Message Types

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

Database Dialog I

Information on database table in R/3

Reading database tables

Authorization checks

Reading multiple database tables

Maintenance Tool: ABAP Dictionary

Finding Fields, Key Fields, and Secondary Indexes

Finding Database Tables

Database Dialog I

Information on database table in R/3

Reading database tables

Authorization checks

Reading multiple database tables

Querying the Database

SELECT Overview

Reading a Single Record

Reading Several Records using a SELECT Loop

Reading Several Records using an Array Fetch

The Field List and Appropriate Target Structure: the INTO Clause

Target Structure with Identically-Named Fields for All Columns Specified

Database Dialog I

Information on database table in R/3

Reading database tables

Authorization checks

Reading multiple database tables

Authorization Check in ABAP Program

Authorization Objects

Statement: AUTHORITY-CHECK

Inserting AUTHORITY-CHECK in Program

Inserting AUTHORITY-CHECK in Program

Reading Multiple Database Tables

Dictionary View and ABAP Joint

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

Possible Elements in ABAP Program

Internal Program Modularization

Event Block

Subroutines

Example: ABAP Program with Event Block and a Selection Screen

Sample Program Runtime Behaviour

Event Blocks in Executable Programs

Sintax: Event Blocks

Internal Program Modularization

Event Block

Subroutines

Example: Flow Chart

Concept: Encapsulating Output in a Subroutine

Calling Subroutine

Sintax Example: Calling the Subroutine

Generating a Call Using Drag & Drop

Subroutine in the Debugging Mode

Subroutine that Return Data

Syntax Example: Subroutine with USING and CHANGING Parameter

Copying Large Internal Table

Solution: Reference Parameters

Sintax Example: Subroutine with Interface Reference Parameters

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

List Attributes

Standard List Functions

Column Header in the Default Page Header

Multilingual Capability

List in Executable Program

Detail List

Example: A Simple Detail List

Syntax: A Simple Detail List

Example: Detail List

Placing Global Data in the HIDE Area

Line Selection

Line Selection: Syntax

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

Use of Selection Screen

User Dialog: Selection Screen

Selection screen attributes

Single field (PARAMETERS)

Value set (SELECT-OPTIONS)

Selection screen event

The Selection Screen

Entering Selections

Using the Semantic Information of Dictionary Types

Selection Texts

Variant

User Dialog: Selection Screen

Selection screen attributes

Single field (PARAMETERS)

Value set (SELECT-OPTIONS)

Selection screen event

Effect of the PARAMETERS Statement

Runtime Behaviour and Data Transport for PARAMETERS

Using PARAMETERS when Accessing the Database

User Dialog: Selection Screen

Selection screen attributes

Single field (PARAMETERS)

Value set (SELECT-OPTIONS)

Selection screen event

Effect of SELECT-OPTIONS

Runtime Behaviour and Data Transport for SELECT-OPTIONS

Using SELECT-OPTIONS when Accessing the Database

User Dialog: Selection Screen

Selection screen attributes

Single field (PARAMETERS)

Value set (SELECT-OPTIONS)

Selection screen event

Selection Screen Event

Error Message in AT SELECTION-SCREEN

Syntax Example for AT SELECTION-SCREEN

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

Selection Screen Attributes

Option for Calling Screens

Part of a Screen

Editing Screen

The Editing Window in the Graphical Layout Editor

Example: creating screen

Creating a Screen : Screen Attribute

Input Fields with Reference to Fields of a Dictionary Structure

The Attribute Window

Screen Interfaces

Syntax: Example Program with Data Transport

Example: Defining Pushbutton

Runtime Behaviour when User Choose the Pushbutton

Defining Pushbutton: Assigning Function Code

Making the Command Field Usable

Modules

The User Command: PAI Module

Creating Modules using Forward Navigation

Next Screen (Set Statically) = 0

Next Screen (Set Statically) = Screen Number

Set the Next Screen Dinamically

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

Possible Solution: Clear the Command Field in a PBO Module

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

Status: Functions in Screen

Runtime Behaviour: Setting a Status before Displaying a Screen

Creating GUI Status

Adjusting GUI Status

GUI Status: Key Setting

GUI Status: the Menu Bar

Example: Technical View of Basic Interface Elements

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

Setting Functions to Active or Inactive in the Status

GUI Title

Creating GUI Title

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

Techniques for Encapsulating Business Logic

Reuse Component

Function Group and Function Module

Business Object and BAPI

Function Group

Function Module

Function Group: Data Flow

Finding the Function Module

Function Module Interface

Fuction Module Documentation and Testing

Syntax: Calling the Function Module

Inserting a Function Module Call in a Program

Reuse Component

Function Group and Function Module

Business Object and BAPI

BAPI and Businness Object

Where are BAPIs Used ?

Standarized BAPI

Finding BAPI Function Module

Condition for BAPI Function Module

top related