Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 1 Introduction to the ABAP Workbench

Similar presentations


Presentation on theme: "Lecture 1 Introduction to the ABAP Workbench"— Presentation transcript:

1 Lecture 1 Introduction to the ABAP Workbench
MIS ABAP Programming Lecture 1 Introduction to the ABAP Workbench

2 Objectives to introduce the ABAP integrated development environment
the two main ABAP application types reporting dialog programming

3 Order of Presentation Purpose and Function of the ABAP Workbench
Workbench Tools: Object Navigator (Repository Browser) The ABAP Language The Repository Information System Test and Analysis Tools Menu & Screen Painter The Data Modeler ABAP Query The Workbench Organizer The Class Builder

4 ABAP Workbench Purpose & Function
SAP’s Integrated Graphical Programming Development Environment: Used to create/change ABAP application programs Each ABAP application program is either a report or a transaction: Reports are applications that retrieve and display information from database with little or no user interaction Transactions accepts inputs/data from users and then perform one or more relevant actions, usually involving updating databases The ABAP Workbench is the SAP’s integrated development environment for the creation and management of ABAP reports, dialog programs, and associated objects (such as menus and screens). In general ABAP programs are used for creating reports that extract and display data from the database or for creating dialog programs that allow the user to change data in the database in a controlled manner. Another common application for ABAP programs is for data conversion. Typically this is a once only operation when R/3 is installed and existing data must be migrated from the current system to the R/3 tables.

5 ABAP Workbench Purpose & Function
The Workbench can be used to write ABAP code design dialogs/screens with a graphical editor create menus with a menu editor debug an application test an application for efficiency control access to objects under development create new or access predefined database information

6 ABAP Workbench Purpose & Function
Comprises the following tools The Object Navigator (aka Repository Browser) the ABAP Language the Screen and Menu Painters the Repository Information System the Data Modeler various test and analysis tools the ABAP Query the Workbench Organizer

7 ABAP Workbench Architecture
Transport System ABAP Editor Reporting Screen Painter R/3 Repository ABAP Dictionary Function Modules ABAP Organizer Data Modeler The above models the Development Workbench and shows how the tools interact with the R/3 Repository and emphasise the integrated nature of the Workbench tools. Menu Painter ABAP Processor Debugging Trace Test Tuning

8 The Workbench Screen All R/3 screens have a similar ‘look and feel’
screens consist of screen titlebar menu bar standard toolbar application toolbar screen body message line An important aspect of R/3 is that wherever you are in the system all screens have a consistent ‘look and feel’. Screens have a consistent layout and similar modes of operation. The important, common features of the R/3 screens are illustrated in the next slide. Something to keep in mind when you are developing your own ABAP applications is that your customer created screens are to be used in conjunction with the standard R/3 screens. Hence your screens should as far as possible comply with the SAP Style Guidelines for screen & report layout.

9 Menubar Standard toolbar Screen title-bar Application toolbar
The Screen Titlebar displays the name of the screen. It is possible to program the contents of the screen titlebar to provide your own screen titles. The Menubar provides a series of pull down menus. Different screens will have different menubar contents. However, all screens, (even the ones you create), contain the System and Help menus. The Standard Toolbar is again common to all screens. Not all icons are active in all screens. (If they are not active they will appear ‘greyed out’.) Standard toolbar includes from left the Enter icon (green check mark) the command entry box the Save icon the Back icon (also called Green Arrow Back) the Exit icon the Cancel icon the Print icon the Find and Find Next icons 4 navigation icons -Page up & down, top & bottom of page the Help icon Message line Client Server

10 The Object Navigator (The Repository Browser)
central tool for organizing and managing your personal development objects used to navigate through development object lists where development objects are the components used to construct an application automatically calls other workbench tools if you create a new data definition the browser calls the Data Dictionary, and then returns to the browser after the definition is created

11 The Repository Browser has two basic interfaces
The Repository Browser has two basic interfaces. The one illustrated above is called the ‘Initial’ screen. (Note that it is not necessarily the default screen displayed when the Repository Browser tool is selected.) Object selection is made by clicking the radio button next to the object type that you wish to select and then filling in the name of the object in the data entry box beside. In general it is possible to provide a name involving wildcards, (such as ZAB*). The selector (down arrow) at right of the data entry box will provide a pull-down list of objects of the selected type that match the entered string.

12 The ABAP Language Advanced Business Application Programming
developed by SAP for the interactive development of application programs 4th Generation Language (with some OO features) main uses for ABAP programs include creation of new reports development of new user dialog programs (transactions) customisation of R/3 to meet individual client needs

13 Reporting uses ABAP Open SQL to extract data from the R/3 database
Open SQL is a subset of ANSI SQL report consists of a [selection screen] and a list screen selection screen allows the user to enter selection criteria list screen displays the report data Reports extract and display data from the R/3 database. In general Open SQL is used to extract the data. Open SQL is proprietary version of SQL developed by SAP. Note that it is possible to extract data by methods other than using Open SQL (for example by embedding native SQL commands in your ABAP program). In general, a report consists of an optional selection screen which allows the user to tailor/limit the data retrieved, and a lists screen where the selected data is displayed.

14 Report Selection Screen List Screen ABAP Open SQL R/3 Database
This slide shows the general structure of an ABAP report and the interaction between the displayed data and the stored data. The selection screen is used to filter rows to be returned from the data base. (ie, to fill in the where clause in an SQL select statement/s.) Once the user has filled in the selection screen the appropriate rows are retrieved from the database and displayed on the list screen. R/3 Database

15 Selection screen for the report

16

17 This is an example of some ABAP code that produces the report illustrated on the following slide.
In short: the tables statement declares R/3 database tables that are to be made accessible to the report program; the select-options statement creates the selection screen the select statement retrieves data from the database the write statement displays the output

18 Dialog Programming Dialog Programs (Transactions) are used for both reading and changing the database Main Components of a Dialog Program are screen & menus processing logic defined in an ABAP program (module pool) for each screen, interaction and control flow from one module to another is defined in DYNPRO data structures defined in the ABAP dictionary

19 Development Environment
ABAP Dictionary Screen Painter Menu Painter ABAP Runtime Environment ABAP Dictionary is used to define data structures which can be accessed from the ABAP programs as well as when defining screen fields. The Screen and Menu Painters are used to create and design screen templates and screen programs. The processing logic is defined in an ABAP program. The program consists of a number of modules. Control is passed to these modules by the dialog processor according to the screen event handling logic. Dialog Processor ABAP Processor

20 Dialog Programming - Overview
Transaction Code Module Pool 0100 0200 An SAP transaction/dialog program consists of a set of screens. Each screen consists of: 1. The screen layout itself, and 2. The screen flow logic. The high level screen flow logic is stored with the screen and consists of 2 events: PBO (Process Before Output) which is executed before the screen is displayed to the user; and PAI (Process After Input) which is executed after the user has interacted with the screen. Both PBO and PAI logic consist of module calls. The body of each of these modules is stored in an ABAP program called the module pool that is associated with the transaction. 0300 Screen Flow Logic

21 1 2 3 4 DIALOG Communication ABAP PROCESS BEFORE OUTPUT.
MODULE INITIALISE. PROCESS AFTER INPUT. MODULE READ-ITAB. MODULE .... MODULE INITIALISE Clear ITAB. ENDMODULE. MODULE READ-ITAB. Select * From ITAB Where... MODULE...... : 1 2 3 4 1. Process Before Output event is fired. Modules in the PBO event processing are executed with control being passed to the module pool (ABAP program) as appropriate. 2. Once these module/s have been executed control is passed back to the Dialog Processor. 3. After the user has entered data etc the Process After Input event fires and control is again passed to the ABAP processor. 4. Once these module/s have been executed control is passed back to the Dialog Processor.

22 Graphical Screen Painter
Currently Edited Field The Graphical Screen Painter is used to design and create screen layouts. There is a text-based alternative to the graphical editor which is less resource hungry. It is possible to switch between text and graphic edit mode using Settings/Graph Fullscreen or Settings/Fullscreen depending on which version of the editor interface you are currently working in. The Graphical Screen Editor uses a drag and drop method for placing graphical elements on the screen. Graphical elements include text boxes, check boxes, radio buttons, data entry fields, and titled frames (for grouping related fields), table controls and tab strips. Graphical Elements Toolbar

23 Menu Painter provides facilities for defining Pull down menus:
* SAP provides suggested standard menu prompts for each menu * provision is made for the developer to add application specific prompts * the developer also has the ability to define submenus * the SYSTEM and HELP menus are SAP standard and will appear on every screen even though they do not appear on the Menu Painter interface Menu Painter also provides the developer with the ability to attach (8 character) labels to function keys / user defined command buttons. These labels can then be tested for in the ABAP code which works behind the screen. (The controlling program is event driven. One of the events that can be programmed is AT USER-COMMAND which detects when the user has pressed a function key or command button.) When defining command buttons the designer can attach icons and/or text to appear on the button when it is displayed on the screen. After the function key / command button has been defined the definition and action of the function key / command button can be displayed by clicking on the right mouse button. Menu Painter

24 The Repository Information System
The Repository Information System is used to search for objects in the R/3 system and provides list of all objects X with attribute/s Y the Where Used List which gives a list of every place that object X is used throughout the R/3 system information about foreign key relationships between tables display of data (all records in table X with attribute Y)

25

26 Test and Analysis Tools
ABAP Editor syntax checker tests for coding and syntactical correctness provides automatic ‘correct’ facility in case of an error, provides a detailed (although sometimes obscure) reason for the error extended syntax check searches out situations that might possibly result in a runtime error (eg, inconsistent interface parameters) warns about use of literals instead of text elements

27 Test and Analysis Tools
Debugger finds logic errors provides ability to stop the program anywhere during runtime continue statement by statement skip over subroutines check or change the contents of variables and internal tables on the fly

28 This is an example of a debugging session.
The debugger allows the user to type in the names of up to 4 variables. The debugger displays the current contents of these variables and updates the display as the values change during program execution. The debugger provides facilities to execute in single step mode and to display the contents of internal tables.

29 Test and Analysis Tools
Runtime analysis used to determine the performance, (absolute and relative) of the various parts of an ABAP program can provide statistics on the efficiency of code database accesses R/3 system itself

30 This is the initial screen of the runtime analysis tool
This is the initial screen of the runtime analysis tool. It is used to specify particulars of the required analysis.

31 This screen is the result of performing a runtime analysis of a program. The analysis shows:
1. When and by whom the analysis was carried out 2. Relative and absolute time spent executing ABAP code, performing database accesses and R/3 system overheads, 3. Maximum memory requirements of the program, 4. And some statistical information.

32 The Data Modeler graphical tool that utilises E-R modelling
tightly coupled to the data dictionary possible to click on an object in the model (ie, an entity), and retrieve related data from the dictionary, (ie table - structure, contents) create the data model and the dictionary can create the table automatically

33 The Data Modeler tool allows the user to:
1. Visualise a data model (variation of the Entity - Relationship form) 2. Create a data model 3. Create dictionary objects directly from the data model

34 ABAP Query Automated report generator can generate To define a report
user not required to know ABAP language can generate basic lists, statistics, ranked lists To define a report enter individual texts, such as titles select the fields and options which determine the report layout assign a particular sequence by numbering the fields. The system generates each query in the form of an ABAP program.

35 Workbench Organizer records and controls changes to objects
ABAP Programs, Dictionary Objects, Screens, User Interface Definitions, … provides assistance for organizing development projects by allowing you to distribute project work for individual developers or teams among different change requests

36 Workbench Organizer interface to the Transport mechanism
movement of applications from development  test  production environments prevents parallel, uncoordinated changes to the same object, (version control) even when many copies of the object exist in several, connected SAP systems

37 Summary & Conclusion this lecture provided an overview of the tools that comprise the ABAP Development Workbench of these the editor /syntax checker/debugger is the combination that we will use most frequently it is essential that you be able to use the tools to navigate around the workbench find,execute,change development objects

38 Related Reading OnLine Help
R/3 Library ... Basis Components ... ABAP Workbench BC ABAP User’s Guide ABAP Basics Overview of the Components of Application Programs ABAP Workbench Tools

39 Recommended ABAP Texts
ABAP/4: Programming the SAP R/3 System, Bernd Matzke Developing SAP’s R/3 applications with ABAP/4, Rudiger Kretschmer, and Wolfgang Weiss Introduction to ABAP/4 Programming for SAP, Revised and Expanded Edition by Gareth M. De Bruyn, Robert Lyfareff


Download ppt "Lecture 1 Introduction to the ABAP Workbench"

Similar presentations


Ads by Google