01 - abap workbench environment & tools
DESCRIPTION
ABAP Workbench Environment & ToolsTRANSCRIPT
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
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
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
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
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
ABAP Workbench Environment
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
Workbench Menus Layout
• Overview menu• Development• Test menu• Utilities menu
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
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.
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
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
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
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
Creating Programs – Step 2 of 5Program Attributes
Give the title, program type,status, application (SD, MM etc) then press Save button.
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.
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.
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.
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
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
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
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
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
ABAP Dictionary Transactions
• SE80 - Repository Browser• SE15 - Repository Information System• SE16 - Data Browser• SE17 - General Table Display• SM30 - Maintain Table Views• SM31 - Table Maintenance
ABAP Dictionary Objects
• Data base table• Data Element• Domain• Structure• View• Search Help• Lock Object
DDIC, Initial ScreenDDIC, Initial Screen
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
Characteristics of Domains
Table A
Data elements
Domain
Fields (or Columns)
Allowed Values
Domain Domain
Value tableJanuary
February...December
Creating a Domain
Enter a description (short text)
Enter data type and length
Creating a domain (contd.)
Enter fixed value and description.
Value table may be entered
Two-Level Domain Concept
S_CITY
S_TO_CITYS_FROM_CIT
DepartureCity
DestinationCity
Domain
Dataelement
City
Data Elements
Table A Table B
Data element 1
A data element gives the description of the field of the Table.
Pre-Defined Data Elements
Data Element Documentation
Definition
Use
What to do
Creating a Data Element
Enter a description (short text)
Enter domain name
Creating a Data Element
Maintain field labels and column headers.
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.
Objects of the ABAP Dictionary
Table A Table B Table C
Data element Data element
Domain
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
Tables
Table SCARR
Carrier ID
AADLLHUA...
Carrier Name
American AirlinesDeltaLufthansaUnited Airlines...
TABLE‘Airline Carriers’
Rows (tuples)
Primary key (Field) values
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
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
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
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
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
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)
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
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
Maintaining Table Entries
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
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
Using a Table in Program Code
Tables: YEMPLOY.SELECT *FROM YEMPLOY.
WRITE: / YEMPLOY-IDYEMPLOY-NAMEYEMPLOY-SALARY
ENDSELECT.
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.
Creating Foreign Keys
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
Maintenance Dialog
Maintenance Dialog (contd.)
Types of Tables in SAP
Transparent
Cluster
Pool
Internal
ABAPDictionary
ABAPProgram
Structures
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
Creating a View
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
Search Help
Lock object
• A lock object acts as a traffic light for a table.It is used to prevent concurrent use of database table
Data Browser: An Introduction
Enter Table NameTable Edit Goto Settings System Help
Table name
User parameters
ABAP Workbench
Tools
Overview
Data Browser ( SE16 )
TABNA
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
Data Browser: Selecting Data
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
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
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
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
Screen Painter
Creating a Screen – Step 1 of 8
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
Creating a Screen – Step 3 of 8
After entering the details, Press the “Layout” button
After entering the details, Press the “Layout” button
Creating a Screen – Step 4 of 8
Choose “Text Field” as shown
Choose “Text Field” as shown
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
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
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.
Creating a Screen – Step 8 of 8
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
In this section, we will…
• Explain the uses of a Menu Painter
• Describe the process of defining and Testing a GUI Status
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
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.
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
Creating a GUI Status – Step 3 of 6
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.
Creating a GUI Status – Step 5 of 6
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
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
In this section, we will…
• Introduce other tools that are available in the ABAP Workbench
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.
Transport Organizer
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