01 - abap workbench environment & tools

95
ABAP Workbench Environment & Tools

Upload: writeme670

Post on 13-Apr-2016

57 views

Category:

Documents


4 download

DESCRIPTION

ABAP Workbench Environment & Tools

TRANSCRIPT

Page 1: 01 - ABAP Workbench Environment & Tools

ABAP Workbench Environment & Tools

Page 2: 01 - ABAP Workbench Environment & Tools

Course Objectives

In this Course, the participant will learn:• ABAP Workbench Environment and Tools• An Introduction to ABAP Programming• Advanced techniques in ABAP Programming• BDCs and Interfacing in the SAP Environment• Enhancements & Modifications to SAP R/3• Designing and Using SAP Forms (SAP Script)• Dialog Programming

Page 3: 01 - ABAP Workbench Environment & Tools

Course Objectives

In this Course, the participant will learn:• ABAP Workbench Environment and Tools• An Introduction to ABAP Programming• Advanced techniques in ABAP Programming• BDCs and Interfacing in the SAP Environment• Enhancements & Modifications to SAP R/3• Designing and Using SAP Forms (SAP Script)• Dialog Programming

ABAP Workbench Environment and Tools

Page 4: 01 - ABAP Workbench Environment & Tools

Topic Objectives

In this Topic, the participant will learn:• An Introduction to the ABAP Workbench

Environment and Tools• ABAP Editor and its functions• ABAP Dictionary and its uses• Using the Screen Painter• Using the Menu Painter• Other Important Tools in the ABAP Workbench

Page 5: 01 - ABAP Workbench Environment & Tools

Topic Objectives

In this Topic, the participant will learn:• An Introduction to the ABAP Workbench• ABAP Editor and its functions• ABAP Dictionary and its uses• Using the Screen Painter• Using the Menu Painter• Other Important Tools in the ABAP Workbench

An Introduction to the ABAP Workbench

Page 6: 01 - ABAP Workbench Environment & Tools

In this section, we will…

• Learn the basics of the ABAP Workbench

• Introduce the Tools available in the Workbench

• Explain the Standard Menus in the ABAP Workbench

Page 7: 01 - ABAP Workbench Environment & Tools

ABAP Workbench Environment

Page 8: 01 - ABAP Workbench Environment & Tools

What is the Workbench?

• Graphical programming environment– Use it to create ABAP Applications– Enhance and change existing SAP Applications

• Use it to to do the following:– Write ABAP Code– Design dialogs or Screens– Create Menus with the Menu Painter– Maintain Database objects– Debug an Application– Do performance Analyses– Manage Conflicts and Versions

Page 9: 01 - ABAP Workbench Environment & Tools

Workbench Menus Layout

• Overview menu• Development• Test menu• Utilities menu

Page 10: 01 - ABAP Workbench Environment & Tools

Workbench Tools

• Object Browser SE80

• ABAP/4 Editor SE38

• Data Dictionary (DDIC) SE11

• Function Builder SE37

• Screen Painter SE51

• Menu Painter SE41

• Performance Trace ST05

• Runtime Analysis SE30

• ABAP Debugger

• Class builder SE24

Page 11: 01 - ABAP Workbench Environment & Tools

Workbench Tools (contd.)

Navigate to the Workbench Tools from the main menu as follows:SAP menu Tools Development ABAP Dictionary(or)Type in the transaction code in the Command Field.

Navigate to the Workbench Tools from the main menu as follows:SAP menu Tools Development ABAP Dictionary(or)Type in the transaction code in the Command Field.

Page 12: 01 - ABAP Workbench Environment & Tools

Topic Objectives

In this Topic, the participant will learn:• An Introduction to the ABAP Workbench• ABAP Editor and its functions• ABAP Dictionary and its uses• Using the Screen Painter• Using the Menu Painter• Other Important Tools in the ABAP Workbench

ABAP Editor and its functions

Page 13: 01 - ABAP Workbench Environment & Tools

In this section, we will…

• Introduce navigation to the ABAP Editor

• Explain how to create programs in the Editor

• Describe the Attributes of an ABAP Program

• Learn how to Check syntax of programs

• Explain how to Activate ABAP Programs

Page 14: 01 - ABAP Workbench Environment & Tools

Navigation to the ABAP Editor

• Navigate through SAP menu:

SAP menu Tools ABAP Workbench Development

ABAP Editor

• Type Transaction code SE38 in command field

• Double-click on a program name from any other workbench tool

Page 15: 01 - ABAP Workbench Environment & Tools

Creating Programs – Step 1 of 5Initial Screen

Enter Program Name here. Begin with “Z” or “Y”.

Enter Program Name here. Begin with “Z” or “Y”.

Push this ButtonPush this Button

Page 16: 01 - ABAP Workbench Environment & Tools

Creating Programs – Step 2 of 5Program Attributes

Give the title, program type,status, application (SD, MM etc) then press Save button.

Page 17: 01 - ABAP Workbench Environment & Tools

Creating Programs – Step 3 of 5Program Attributes(contd.)

As soon as we press save button it will automatically ask for development class.Give the name of development class and press save button.

Page 18: 01 - ABAP Workbench Environment & Tools

Creating Programs – Step 4 of 5Program Attributes(contd.)

The next dialog asks for the transport request. Give the name of transport request (or create own request with create button) and click on enter button.

Page 19: 01 - ABAP Workbench Environment & Tools

Creating Programs – Step 5 of 5Edit, Check and Activate

Write ABAP Code in the ABAP Editor, Check Syntax, correct errors if there are any and Activate the program. A Program needs to be activated to be Executed.

Page 20: 01 - ABAP Workbench Environment & Tools

Topic Objectives

In this Topic, the participant will learn:• An Introduction to the ABAP Workbench• ABAP Editor and its functions• ABAP Dictionary and its uses• Using the Screen Painter• Using the Menu Painter• Other Important Tools in the ABAP Workbench

ABAP Dictionary and its uses

Page 21: 01 - ABAP Workbench Environment & Tools

In this section, we will…

• Describe the use of the Data Dictionary (DDIC)• Explain the different components of the DDIC• Explain how to navigate to the DDIC or one of its components• Define DDIC Objects such as Tables, Structures and Views• Define Table Types,Data Elements &Domains and their interrelationship

• Define Search Helps• Define Lock objects

Page 22: 01 - ABAP Workbench Environment & Tools

What is the Data Dictionary?The Data Dictionary:• is a system-independent

interface to a database• is a “virtual database”

containing metadata (data about data)

• provides tools for data manipulation and data processing

• is also called DDIC or ABAP Dictionary

Page 23: 01 - ABAP Workbench Environment & Tools

Necessity of Data Dictionary

• The DDIC facilitates the development of platform independent applications

• The DDIC eliminates the need for programmers to be concerned about specific storage locations, drive and directory names, etc.

ABAP Program X

ABAP Program X

ABAP Dictionary ABAP Dictionary

SAP Database(Oracle) Windows

NTSAP Database

(MS SQL Server)Unix

Page 24: 01 - ABAP Workbench Environment & Tools

ABAP Dictionary Functionality

• ABAP Dictionary• Repository Info system

•Documentation

•ABAP Dict objects.

•Where used list

•RelationshipModification

Analysis

Analysis Activation

Administration

Integration

•ABAP Dict objects Time

Stamp Validation

•Entries in DB catalogue

•Records•Storage

Page 25: 01 - ABAP Workbench Environment & Tools

ABAP Dictionary Transactions

• SE80 - Repository Browser• SE15 - Repository Information System• SE16 - Data Browser• SE17 - General Table Display• SM30 - Maintain Table Views• SM31 - Table Maintenance

Page 26: 01 - ABAP Workbench Environment & Tools

ABAP Dictionary Objects

• Data base table• Data Element• Domain• Structure• View• Search Help• Lock Object

DDIC, Initial ScreenDDIC, Initial Screen

Page 27: 01 - ABAP Workbench Environment & Tools

Domains

Table A

Data elements

Domain

A Domain describes the technical structure of a field that is its size and its data types.Domains are attached to Data Elements

Page 28: 01 - ABAP Workbench Environment & Tools

Characteristics of Domains

Table A

Data elements

Domain

Fields (or Columns)

Page 29: 01 - ABAP Workbench Environment & Tools

Allowed Values

Domain Domain

Value tableJanuary

February...December

Page 30: 01 - ABAP Workbench Environment & Tools

Creating a Domain

Enter a description (short text)

Enter data type and length

Page 31: 01 - ABAP Workbench Environment & Tools

Creating a domain (contd.)

Enter fixed value and description.

Value table may be entered

Page 32: 01 - ABAP Workbench Environment & Tools

Two-Level Domain Concept

S_CITY

S_TO_CITYS_FROM_CIT

DepartureCity

DestinationCity

Domain

Dataelement

City

Page 33: 01 - ABAP Workbench Environment & Tools

Data Elements

Table A Table B

Data element 1

A data element gives the description of the field of the Table.

Page 34: 01 - ABAP Workbench Environment & Tools

Pre-Defined Data Elements

Page 35: 01 - ABAP Workbench Environment & Tools

Data Element Documentation

Definition

Use

What to do

Page 36: 01 - ABAP Workbench Environment & Tools

Creating a Data Element

Enter a description (short text)

Enter domain name

Page 37: 01 - ABAP Workbench Environment & Tools

Creating a Data Element

Maintain field labels and column headers.

Page 38: 01 - ABAP Workbench Environment & Tools

Difference between Domain &Data Element

DomainDefines Technical Attributes such as data type,length,allowed values,etc.A domain can be part of several data elementsUsed to define data elements,restrict values (using value range, value table, etc)

Data ElementDefines semantic attributes such as display length ,short text, long text,etc.A Data Element can point to only one domainUsed to define fields of tables and screens.

Page 39: 01 - ABAP Workbench Environment & Tools

Objects of the ABAP Dictionary

Table A Table B Table C

Data element Data element

Domain

Page 40: 01 - ABAP Workbench Environment & Tools

Tables: Basic Concepts

Table KNA1(Customers)

Table:KNA1

MANDT KUNNR NAME 1 ORT 02

• Tables are containers which stores data in the form of record• They are a central component of the SAP R/3 Application• One or more fields form a data record (also known as tupel)• A number of data records of the same type form a table

Page 41: 01 - ABAP Workbench Environment & Tools

Tables

Table SCARR

Carrier ID

AADLLHUA...

Carrier Name

American AirlinesDeltaLufthansaUnited Airlines...

TABLE‘Airline Carriers’

Rows (tuples)

Primary key (Field) values

Page 42: 01 - ABAP Workbench Environment & Tools

Tables: Concept of Foreign Key

Primary Key

PLANETYPE SEATSMAX

747-200 200 20000A310-200 211 24000757-300 301 17000

CARGOMAXCheckTable

Table 1: Airplane Details Table SAPLANE

FLDATECARRID PRICECONNID

AA 1234 03/22/1999 500 747-200 125 UA 5678 01/06/1999 600 A310-200 90

ForeignKeyTable

Table 2: Flight Table SFLIGHT

PLANETYPE SEATSOCC

Primary Key Foreign Key

Page 43: 01 - ABAP Workbench Environment & Tools

Tables: Indexes for Fields

DBDB

S1 S2 ... F1 F2 ... F2 S1 S2

T1_KT1_KT1T1

S1 S2 ... F1 F2 ...T1T1 T1_KT1_K

Identific.UniqueDesc

ABAP Dictionary

IndexIndex

Page 44: 01 - ABAP Workbench Environment & Tools

Creating a Table – Step 1 of 6

Enter the Name of the table (should begin with “Z” or “Y”)

Enter the Name of the table (should begin with “Z” or “Y”)

Press the Create ButtonPress the Create Button

Page 45: 01 - ABAP Workbench Environment & Tools

Creating a Table – Step 2 of 6

Enter a description (short text)

Maintain delivery class

Table maintenance attribute

After making all entries, Press the “Fields” Tab

After making all entries, Press the “Fields” Tab

Page 46: 01 - ABAP Workbench Environment & Tools

Creating a Table – Step 3 of 6

Maintain field attributes

Maintain data elements

After making all entries, Press the “Technical Settings” Button

After making all entries, Press the “Technical Settings” Button

Page 47: 01 - ABAP Workbench Environment & Tools

Creating a Table – Step 4 of 6

After making all entries, Press the Save Button. Once Technical Settings are save, Press the “Back” Button (F3)

After making all entries, Press the Save Button. Once Technical Settings are save, Press the “Back” Button (F3)

Page 48: 01 - ABAP Workbench Environment & Tools

Creating a Table – Step 5 of 6

Save, Check and Activate the Table. After that Press the “Indexes” Button on the Application Toolbar

Save, Check and Activate the Table. After that Press the “Indexes” Button on the Application Toolbar

Page 49: 01 - ABAP Workbench Environment & Tools

Creating a Table – Step 6 of 6Steps to create an index

After entering the Index Fields and other parameters, save and activate the index, Z01

After entering the Index Fields and other parameters, save and activate the index, Z01

Page 50: 01 - ABAP Workbench Environment & Tools

Maintaining Table Entries

Page 51: 01 - ABAP Workbench Environment & Tools

Browsing Table Entries

You can navigate to the Data Browser from the DDIC or by typing the transaction code, SE16

You can navigate to the Data Browser from the DDIC or by typing the transaction code, SE16

Page 52: 01 - ABAP Workbench Environment & Tools

Buffering and its uses

1st access

DBDB

T2T2G1 G2 S3 F1 ...

T3T3G1 G2 S3 ...

T1T1S1 S2 F1 ...

ABAP DictionaryABAP Dictionary

S1 S2 F1 ...T1T1 T3T3G1 G2 S3 ...

T2T2G1 G2 S3 F1 ...

T1T1S1 S2 F1 ...

TABL TABLP

Buffer: 100% and generic Buffer: partial

Yes Import record

No

Yes

NoYes

Generickeycomplete

SELECT SINGLErecord exists

No1st access

Yes

No

G1 G2 S3 F1 ...T2T2

S1 S2 F1 ...T3T3

Change numberof key fields100% generic

partial2

Page 53: 01 - ABAP Workbench Environment & Tools

Using a Table in Program Code

Tables: YEMPLOY.SELECT *FROM YEMPLOY.

WRITE: / YEMPLOY-IDYEMPLOY-NAMEYEMPLOY-SALARY

ENDSELECT.

Page 54: 01 - ABAP Workbench Environment & Tools

Foreign Keys

Uses:• Maintain data integrity• Provide help texts• Create aggregate dictionary objects

Prerequisites:• The foreign key text field and primary key of the check table must share the same domain• A value table must exist for that domain.

Page 55: 01 - ABAP Workbench Environment & Tools

Creating Foreign Keys

Page 56: 01 - ABAP Workbench Environment & Tools

Cardinality

• Cardinality defines the type of relationship between two tables

• The cardinality of a foreign key indicates how many dependent records a record in a check table may have

1:1

1:C

1:N

1:CN

Cardinality Types

Page 57: 01 - ABAP Workbench Environment & Tools

Maintenance Dialog

Page 58: 01 - ABAP Workbench Environment & Tools

Maintenance Dialog (contd.)

Page 59: 01 - ABAP Workbench Environment & Tools

Types of Tables in SAP

Transparent

Cluster

Pool

Internal

ABAPDictionary

ABAPProgram

Page 60: 01 - ABAP Workbench Environment & Tools

Structures

Page 61: 01 - ABAP Workbench Environment & Tools

Views• View is the virtual table, it reflects the mirror image of the table.• Views are used to join more than one tables.

Table View

Page 62: 01 - ABAP Workbench Environment & Tools

Creating a View

Page 63: 01 - ABAP Workbench Environment & Tools

Search Helps

The Search path used thelast time is displayed

User selects row

Values are returned

User chooses F4 on field

The chosen search path is displayed

A B C

A B C

User chooses a

different search path

Hit List is displayed

Page 64: 01 - ABAP Workbench Environment & Tools

Search Help

Page 65: 01 - ABAP Workbench Environment & Tools

Lock object

• A lock object acts as a traffic light for a table.It is used to prevent concurrent use of database table

Page 66: 01 - ABAP Workbench Environment & Tools

Data Browser: An Introduction

Enter Table NameTable Edit Goto Settings System Help

Table name

User parameters

ABAP Workbench

Tools

Overview

Data Browser ( SE16 )

TABNA

Page 67: 01 - ABAP Workbench Environment & Tools

Data Browser: Parameters

Data Browser: Maintain Settings

Width of output list

Maximum no. of hits

Check conversion exits

Display maximum number of hits

80

500

Key word

Fld nameField ID

Page 68: 01 - ABAP Workbench Environment & Tools

Data Browser: Selecting Data

Page 69: 01 - ABAP Workbench Environment & Tools

Data Browser: Settings

Sort Sequence for output list ...

- List table fields

- Maximum 9 sort fields

- Flag fields with 1 to 9

Fields to be selected ...

- Lists table fields

- Flag the fields tobe included in thethe output list

affects theoutput list

Fields to be Fields to be used for data used for data selection ...selection ...

- Lists table fields- Flag the fields to

be used for dataselection

- Maximum 40

affects theselection screen

Personal Settings

- Width of output list- Maximum number ofentries to be selected

- Take into accountconversion exit

- Column headings canbe either:. Field Name, or. Field Text(from Data Element)

Data Browser: Table SPFLI.... .... .... Settings .... .... System Help

List format Sort Sort User parameters Choose FieldsChoose FieldsFields For SelectionFields For Selection

Page 70: 01 - ABAP Workbench Environment & Tools

SAP Data

ConfigurationData

MasterData

TransactionData

SystemData

• Sales Orders• Purchase Orders• Journal Entries• Goods Receipts

• G/L Accounts• Vendors• Materials• Stock Locations

• Metadata• Programs• Documentation• System Settings

• Currency Codes• Order Types• Payment Terms• Field Status Codes

Page 71: 01 - ABAP Workbench Environment & Tools

Topic Objectives

In this Topic, the participant will learn:• An Introduction to the ABAP Workbench• ABAP Editor and its functions• ABAP Dictionary and its uses• Using the Screen Painter• Using the Menu Painter• Other Important Tools in the ABAP Workbench

Using the Screen Painter

Page 72: 01 - ABAP Workbench Environment & Tools

In this section, we will…

• Explain the use of the Screen Painter

• The different Components of a Screen in ABAP

• Understand the relationship between the Module and Screen

• Go through the steps in creation of an ABAP Screen

Page 73: 01 - ABAP Workbench Environment & Tools

Screen Painter

Page 74: 01 - ABAP Workbench Environment & Tools

Creating a Screen – Step 1 of 8

Page 75: 01 - ABAP Workbench Environment & Tools

Creating a Screen – Step 2 of 8

After entering the other details, Press the “Create” button

After entering the other details, Press the “Create” button

Page 76: 01 - ABAP Workbench Environment & Tools

Creating a Screen – Step 3 of 8

After entering the details, Press the “Layout” button

After entering the details, Press the “Layout” button

Page 77: 01 - ABAP Workbench Environment & Tools

Creating a Screen – Step 4 of 8

Choose “Text Field” as shown

Choose “Text Field” as shown

Page 78: 01 - ABAP Workbench Environment & Tools

Creating a Screen – Step 5 of 8

Enter the Text as shown. A name need not be entered for a text field.

Enter the Text as shown. A name need not be entered for a text field.

Press the “Refresh” button to validate the entries. Press the “Transfer” button to transfer the field to the screen layout

Press the “Refresh” button to validate the entries. Press the “Transfer” button to transfer the field to the screen layout

Page 79: 01 - ABAP Workbench Environment & Tools

Creating a Screen – Step 6 of 8

Press the “Yes” Button

Press the “Yes” Button

Repeat the Process for several Input/Output fields and text fields. Press “Transfer” after designing each field

Repeat the Process for several Input/Output fields and text fields. Press “Transfer” after designing each field

Page 80: 01 - ABAP Workbench Environment & Tools

Creating a Screen – Step 7 of 8

The box shown is designed by creating an element of type “Frame”

The box shown is designed by creating an element of type “Frame”

The Complete screen layout for Screen 0001.Save, Check Syntax and Activate the screen by pressing the “Activate” button.

The Complete screen layout for Screen 0001.Save, Check Syntax and Activate the screen by pressing the “Activate” button.

Page 81: 01 - ABAP Workbench Environment & Tools

Creating a Screen – Step 8 of 8

Page 82: 01 - ABAP Workbench Environment & Tools

Topic Objectives

In this Topic, the participant will learn:• An Introduction to the ABAP Workbench• ABAP Editor and its functions• ABAP Dictionary and its uses• Using the Screen Painter• Using the Menu Painter• Other Important Tools in the ABAP Workbench

Using the Menu Painter

Page 83: 01 - ABAP Workbench Environment & Tools

In this section, we will…

• Explain the uses of a Menu Painter

• Describe the process of defining and Testing a GUI Status

Page 84: 01 - ABAP Workbench Environment & Tools

GUI Status and the Menu Painter

Module Pool

Screens

GUI Status

• You define a GUI Status using the Menu Painter (SE41)

• You can define multiple screens and GUI Statuses for a Module Pool

• The Screens and GUI Statuses are called and controlled by “Modules” in the Module Pool

• After receiving input from user, the Screen passes control to the Module pool (Screen’s Flow logic does this) through the GUI Status

• The Screen acts as a container for the GUI Status

• A GUI Status can be associated with several screens and vice versa

Page 85: 01 - ABAP Workbench Environment & Tools

Creating a GUI Status – Step 1 of 6

After entering the names of the Module Pool and GUI Status, Press the “Create” button

After entering the names of the Module Pool and GUI Status, Press the “Create” button

Prerequisite:• Module Pool Program• Screen (for testing)Since we have already created a Module Pool and a Screen in a previous section, we are going to use the same.

Prerequisite:• Module Pool Program• Screen (for testing)Since we have already created a Module Pool and a Screen in a previous section, we are going to use the same.

Page 86: 01 - ABAP Workbench Environment & Tools

Creating a GUI Status – Step 2 of 6

Enter the Short Text, check “Online Status” as type and press Enter

Enter the Short Text, check “Online Status” as type and press Enter

Page 87: 01 - ABAP Workbench Environment & Tools

Creating a GUI Status – Step 3 of 6

Page 88: 01 - ABAP Workbench Environment & Tools

Creating a GUI Status – Step 4 of 6

Enter a unique “Function Code” for each of the slots in the Application Toolbar and the Standard Toolbar to perform specific functions.

Enter a unique “Function Code” for each of the slots in the Application Toolbar and the Standard Toolbar to perform specific functions.

Page 89: 01 - ABAP Workbench Environment & Tools

Creating a GUI Status – Step 5 of 6

Page 90: 01 - ABAP Workbench Environment & Tools

Creating a GUI Status – Step 6 of 6

Note the Application toolbar and the Menu bar are attached now to Screen 0001

Note the Application toolbar and the Menu bar are attached now to Screen 0001

Page 91: 01 - ABAP Workbench Environment & Tools

Topic Objectives

In this Topic, the participant will learn:• An Introduction to the ABAP Workbench• ABAP Editor and its functions• ABAP Dictionary and its uses• Using the Screen Painter• Using the Menu Painter• Other Important Tools in the ABAP WorkbenchOther Important Tools in the ABAP Workbench

Page 92: 01 - ABAP Workbench Environment & Tools

In this section, we will…

• Introduce other tools that are available in the ABAP Workbench

Page 93: 01 - ABAP Workbench Environment & Tools

Object Navigator

• All Workbench objects are stored in ABAP “Repository”• Unified environment to access ABAP Repository Objects • Can navigate to the Workbench tool of the Object• Can Maintain ABAP repository objects such as Message Classes, Development Classes, Programs, Transactions, etc.

Page 94: 01 - ABAP Workbench Environment & Tools

Transport Organizer

Page 95: 01 - ABAP Workbench Environment & Tools

Other Tools in the Workbench

• Function Builder– Used to maintain and test function modules– Covered in “Advanced ABAP Programming”

• Performance Trace– Used to Monitor performance

• Runtime Analysis– Used to Analyze runtimes of routines in programs

• ABAP Debugger– Allows stepping through ABAP programs

• Class Builder– Used to build ABAP Classes