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 PackagesWhen 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 SyntaxABAP 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
Double-quote characters (") mark the beginning of in-line comments.
All code is ignored after a double-quote character. For this reason,
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 is Zeichenkettenverarbeitung.
|
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
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: TAW10 ABAP Workbench Fundamentals E-Learning TAW12 ABAP Workbench Concepts E-Learning Skillsoft offers two web-based courses: ABAP Programming I (205 minutes) ABAP Programming II (205 minutes)
|
ABAP EditorABAP 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).
|
|
SAPscript and formsA 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.
|
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 HandlingInteractive 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 CodingObject-oriented ABAP coding defines events (with only exporting parameters) and handler this way: |
ABAP Internal TablesABAP 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 . |
ContextsTo 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
|
Data TypesThe largest ABAP datatype holds 65,535 characters.
|
ABAP UIsThe standard Web user interface is WebDynpro. 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. Business Server Pages (BSP) provides a high degree of adjustment for Web interface. Java Development Infrastructure 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_<TABLE> 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. Update Management (transaction SM13) Monitoring Updates Analyzing and correcting update errors |
eCATTeCATT (extended Computer Aided Test Tool - BC-TWB-TST-ECA) was available since release 6.20 and superceded CATT as of Web Application Server Release 6.40. SAP supplies it free as part of the R/3 system to document manual user dialog steps and to record, edit, and execute automated functional test cases without user dialog. eCATT can be used with the Test Workbench. Transactions executed through eCATT require the same authorizations as manual operation by a live person, so eCATT can be used to verify user profiles. In principle, the entire ABAP instruction set is available for use within inline ABAP code (CREATE, CALL, DATA, SUBMIT, etc.). eCATT stores its data in R/3 databases and can be controlled by Test Workbench, the Object Navigator (SE80), or externally through the BC-eCATT interface. Test modules can refer to spreadsheets providing various data that are updated in CATT Maintenance mode. Logs are created while test modules run. However, eCATT is less suited for testing lists and display results, menu paths, online help (F1, F4), free-form editor functions, and transactions that contain the statement LEAVE TO TRANSACTION. | Advanced ABAP Programming for SAP (Premier Press, 1999, 400 pages) by Gareth M. de Bruyn, Robert W. Lyfareff, and Ken Kroes
SAP R/3 Change and Transport Management:The Official SAP Guide (Sybex, 2000) by Sue McFarland and Susanne Roehrs |
ABAP Trace
ABAP trace measures the run times of various ABAP commands:
For statements such as APPEND, the gross time equals the net time If the gross time differs from the net times for such statements, the call contains other calls or modularization units
hit list displays the individual components of each call.
Tables hit list lists database tables accessed by the transaction or program. Group hit list displays ABAP trace results grouped by modularization unit. Call hierarchy displays statements in chronological order of execution. |
|
Efficient ABAP Coding Strategies
|
RFCs
|
RFMs and BAPIs
ABAP Function Modules can only be called from an external client if they are marked as RFC-enabled. BAPIs are RFMs that follow additional rules (as defined in the SAP BAPI Programming Guide) and are defined as object type methods in SAP's Business Object Repository (BOR). RFMs are also used to define ABAP exceptions -- a string such as "NOT_FOUND" with an associated language-dependent message text. Transaction codes BAPI and SE37 provide metadata for the several thousand SAP R/3 BAPIs and other RFMs (RFC-enabled Function Modules) in its Interface Repository. Some of them are in "unreleased" (unsupported) state. SAP only guarantees released BAPIs to be upward-compatible When SAP wants to change a BAPI in a way that would be incompatible with the existing version, they create a new BAPI and mark the old name obsolete. Find suitable BAPIs using the BAPI Explorer (transaction BAPI), then review the metadata of the RFM in the Function Builder (transaction code SE37). RFMs have three types of parameters: However, a easier request/response programming model is used when BAPIs are made object-oriented as methods within proxy classes representing business object types in the BOR. |
IDocsIDoc (intermediate document) provide a standard data container structure for SAP to exchange data between processes, such as asynchronous EDI (electronic data interchange) between application programs written for SAP or between an SAP application and an external program. IDocs is the vehicle for data transfer in SAP's Application Link Enabling (ALE) layer. Different types of IDoc are used for purchase orders or invoices. In other words, an IDoc encapsulates data so that it can be exchanged between different systems without conversion from one format to another. Each IDoc generated exists as a self-contained text file that can then be transmitted to a receiver (requesting workstation) without connecting to the central database. There are several types of IDoc records: a single Control Record, one or many Data Records, and one or many Status record. Segments and attributes of segments (maximum number, hierarchical sequence, segment status, etc.) are used for interpretating the SDATA field in the data record. Each IDoc consists of several segments and a unique number assigned each iDoc for tracking and future reference. Each segment contain several fields. IDoc data is then converted by SAP's EDI subsystem to a universal EDI standard such as UN/EDIFACT (Electronic Data Interchange for Administration, Commerce, and Trade) or ANSI/X12. Business Application Programming Interface (BAPI) is used for synchronous communication method sRFC because data usually is returned to the sending system. BAPI methods are stored as RFC-capable function modules in the ABAP Workbench Function Builder accessing the SAP Business Object Repository (BOR).
|
ABAP Exam - Programming Curriculum for Technical Consultant CertificationHere are my comments on the topic area class SAP offers to prepare people for the their "SAP NetWeaver 2004 - Development Consultant – Application Development Focus ABAP" The curriculum on the right column is my design for students taking a more task-based, exploratory approach to learning, in a context of a team jointly developing complex systems. The result is that learners can become quickly productive in a complex environment. For example, rather than starting with a simple "Hello World", learners work with real code because one of the skills required of professionals is the ability to ignore the clutter and work under ambiguity.
|
|
|
Related Topics:
LoadRunner
SNMP
Rational Robot
Free Training!
Tech Support
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page
Thank you! |