What Is ABAP?
The R/3 kernel (system runtime environment) itself is written in standard C or C++.
But application programs running inside R/3 are written using SAP's proprietary programming language ABAP (pronouced as ahhh-bap).
Note: the "/4" in "ABAP/4" has been dropped over the confusion that the "4" referred to "R/4", which doesn't exist.
Netweaver AS (Application Server) combines which SAP calls two "personalities" because WebDynpro (pronouced "web din pro") for ABAP and WebDynpro for Java use the same meta model. WebDynpro components, views, models, and controllers have the same semantics in both ABAP and Java.
The main difference is the design-time environment, the development infrastructure, and the run-time environment.
|
Architecture
Components are reusable (nestable) units of the application project. Components appear as nodes within the object list on the left side of the Workbench window.
The components (sub-objects) of an ABAP program are:
Dialog programs and their components are created and edited from menu Workbench > Edit object (Shift+F5)Program.
Generally, there are two types of ABAP programs:
|
|
Transports and Packages
When an ABAP module is first created, it is stored as an inactive local object in a $TMP temporary transport.
With ABAP, deployment of components are organized as Transport definitions.
Objects need to be activated for editing.
|
Screens
To invoke the Screen Painter tool, use tcode SE51 or from the Object Navigator tool.
Screen attributes include its number (default to 0100 for the first screen), short description, subsequent screen number, and type of screen:
Goto Layout (placement) of screen elements (text label, input/output edit fields, text boxes, push buttons, radio buttons, etc.).
Goto Secondary window to set Attributes for each field screen element in the Element List (Dict. data type (such as numbers only), format, length, etc..
Flow logic is determined by ABAP program source code events and keywords:
|
ABAP Language Source Code Syntax
ABAP is a declarative language with a syntax similar to the COBOL language, but enhanced for use to specify both classic procedural and object-oriented processing.
ABAP doesn�t care where a statement begins on a line. > Each statement (phrase) begins with a command keyword (verb) and
ends with a period character (instead of the semicolon used in C and Java). An ABAP statement can span several lines (without continuation characters as needed in VB programs). Spaces separate words. Asterisks (*) in front of a line are recognized as comments and not processed.
Double-quote characters (") mark the beginning of in-line comments. All code is ignored after a double-quote character. For this reason,
single-quote (') characters encase a text string, which can contain spaces. The ABAP editor converts (marks) all text to UPPER CASE unless it's within single quotes.
Statements with have an identical first part can be concatenated if there is a colon (:) after that first part and individual statements are separated with commas and a period (.) is placed after the last part.
Object-oriented ABAP coding follow these conventions.
hide h1. stores in a hide area the value of variable h1 from the current line of the current internal table.
|
The SAP R/3 Style Guide maintained by the SAP Design Guild provides standards for accessible user interaction design of functions, UI elements (Screens, application and task menus, Fields, Checkboxes, Radio Buttons, Drop-Down List Boxes, Lists, Tables, Trees), hot keys, and presentation of dialogues and texts.
String processing in German isZeichenkettenverarbeitung.
|
Command summary
Programming Logic contrasts ABAP with other programing languages' conditional (IF/ELSE/LOOP) statements.
ULINE requests a line break in the output.
|
Workbench
WebDynpro application components are created and modified within the WebDynpro Explorer within the ABAP Workbench access from Tools > ABAP Workbench > Overview > (within the Application Hierarchy) SE80 > - Object Navigator
The Workbench stores its assets (such as MIME definitions and ABAP development objects (packages, programs, functions) in a persistent Repository.
ABAP Workbench organization of tools:
User Interface:
SE51 Screen Painter SE41 Menu Painter (to define GUI status of Menu bar, app. toolbar, function keys) SE37 Function Builder SE24 Class Builder SE37 Function Builder SE33 Context Builder
|
SAP offers these courses:
Skillsoft offers two web-based courses:
ABAP Programming I (205 minutes)
ABAP Programming II (205 minutes)
|
ABAP Editor
ABAP Workbench is the IDE SAP supplies to edit, compile, and run ABAP programs.
An ABAP program defines and maniulates data using statements of specific syntax.
XML-based info objects can only be edited in the Knowledge Workbench.
|
ABAP Data Dictionary (DDIC)
The ABAP Dictionary contains:
Each field in the DD is based on a built-in DD data type or a Data Element (which in turn is based on a Domain).
The Data Element contains the more semantical information (text and documentation).
The Domain defines the basic technical attributes: |
SAPscript and forms
A SAPscript form is a template that supplies the layout (for example, page size) and content (for example, sales data for an invoice) for business forms.
SAPscript print program is needed to print, distribute, or display business forms.
A form is made up of pages, which contains several windows (header, address, main, etc.). Text elements are formatted with paragraph formats (which define font and tab positions) and character formats (such as bold).
Create a view for the component. This calls the Layout tab and creates the root element in the UI Element Hierarchy. See the view in the browser by embedding it actively in a WebDynpro window.
Activate "Accessibility Checks Active" by clicking on the checkbox.
|
-
|
ABAP Functionality
The functionality of an ABAP program include:
|
Classic Sections and Events
Classic ABAP programs are made up of self-contained sections (containing block of code) which cannot be nested. Events in ABAP report programs are executed in a predefined sequence.
Bolded events are only for ABAP report programs.
Even though code sections can be specified in any order, it's better to keep this sequence.
Code for an event ends when the next event name is specified. The STOP command causes (at runtime) a jump to the next section. |
Classic Data Declaration
data final type c value 'literal'. parameters x(15) type c. select-options Number for x.
Data are stored in data objects: modifiable field strings, variables and internal tables or non-modifiable literals and constants.
|
Classic List Handling
Interactive report programs provide menus for user interaction. When the user clicks on a row within a basic list created using a select statement within the start-of-selection section, code under section at line-selection. is invoked to create a secondary list.
When the user selects a row and clicks a defined PF key (i.e., Shift+F12), code under section at pf24. is invoked. Because most PC keyboards have 12 F keys:
14 = Shift F2 15 = Shift F3 16 = Shift F4 17 = Shift F5 18 = Shift F6 19 = Shift F7 20 = Shift F8 21 = Shift F9 22 = Shift F10 23 = Shift F11 24 = Shift F12
When the user selects a row and clicks the Enter key, code under section at user-command. is invoked.
if sy-ucomm=20 .
get cursor Field f Value v. retrieves the field name and value of where the user has placed his cursor.
|
Object-Oriented Coding
Object-oriented ABAP coding defines events (with only exporting parameters) and handler this way:
|
ABAP Internal Tables
ABAP report programs obtains results from database queries from temporary internal tables on WebAS server memory.
For example, to define two internal tables with a capacity of 53 records:
data : begin of tableA occurs 100 with header line. field 1 (c) (like databasefield1 ). field 2 (c) (like databasefield2 ). end of tableA. data : begin of tableB like tableA occurs 100.
To modify data from the internal table:
modify tableA index i.
To read data from internal table:
loop at tableA from 50 to 100. modify tableA . " code to display data on the screen. endloop . |
Contexts
To avoid unnecessary system load from repeating calculations, define contexts in the Context Builder within ABAP Workbench.
Application programs work with instances of a context. SUPPLY input values for key fields and DEMAND derived data.
Each context has a cross-transaction buffer on the application server. When you query an instance for values, the context program searches first of all for a data record containing the corresponding key fields in the appropriate buffer. If one exists, the data is copied to the instance. If one does not exist, the context program derives the data from the key field values supplied and writes the resulting data record to the buffer.
Class inheritance (Vererbung) is achieved using
CLASS |
Data Types
The largest ABAP datatype holds 65,535 characters.
|
ABAP UIs
The SAP R/3 Style Guide maintained by the SAP Design Guild provides standards for accessible user interaction design of functions, UI elements (Screens, application and task menus, Fields, Checkboxes, Radio Buttons, Drop-Down List Boxes, Lists, Tables, Trees), hot keys, and presentation of dialogues and texts.
SAP's Documentation for SAP Getting Started with Netweaver 2004s, 2004, and 6.30.
|
ABAP WebDynpro Development Processes
|
ABAP Persistence
Access to the R/3 System database is made using OPEN SQL statements in the PUT_
subroutines. Data is passed to the executable program using interface work areas defined using the TABLES statement. Once the data has been read in the logical database program, the executable program (report) can process the data in the GET event blocks. This technique separates data reading and data processing.
ABAP programmers do not need to open and close database connections since every ABAP program automatically receives an open connection to the central database in the system.
ABAP Objects contain Open SQL, SAP's platform-independent SQL dialect as a direct component of the language.
Accesses to data in the database are synchronized by the runtime system's lock mechanism which prevents two parallel transactions from being able to change the same data in the database.
The logic in SAP's Update System avoids database rollback.
To avoid keeping the database waiting, SAP maintains its own LUW (logical units of work) that spans several screens and several database LUW.
|
No comments:
Post a Comment