Agenda
Da y 1 Introduction to ABAP Workbe nch
Clie nt Se r ve r Ar chite ctur e ABAP Re pos itor y and ABAP Wor k Be nch Tr ans actions Intor duction to ABAP Pr ogr am m ing Language
Da y 4
ALE & Idocs Sm ar tfor m s
Da y 5
ABAP De bugge r Pe r for m ance E xte nde d Syntax Che ck
Presentation server
Application server
Database layer
ABAP Workbench
Contains tools for editing and creating objects in the repository. The most important tools are ABAP Editor for editing source code ABAP dictionary for editing database.. Screen Painter for configuring screens. Menu Painter for designing user interfaces Function Builder for maintaining function modules Class builder for maintaining classes and interfaces
4
Move
to
lv_result.
5
Description Loop counter Current transaction Local date of system Local time in system Name of the current program
Sy-langu
Sy-mandt Sy-uname
Logon language
Logon client Logon Name of user
Structures
Structures allows to combine values that logically belong to one data object. Structure variables are defined in the program with DATA statement.
Structure types can refer to globally defined structures in ABAP dictionary or local for the particular program.
With TYPES statement you can define local structures TYPES: BEGIN OF structure name. END OF structure name.
vbeln
gs_vbeln
selkz
intkz
Name of structure
Name of component
Structures
Components of structure are addressed using the structure name component name. MOVE-CORRESPONDING copies the contents of the source structure to target structure one component at a time.
Last name
Address
Phone
DOJ
Middle name
Last name
DOJ
SSN
Transparent table
Transparent table Field
Described by
Data Element
Points to
Domain
Database
Definition of a transparent table is similar to a structure except that fields of a transparent table are a list of elementary fields. Transparent tables can also be used like structures in programming for defining structure types. The major difference between structure and transparent table is the corresponding table on the physical database. Also there are technical properties like key fields definition and size which are defined in transparent table.
ABAP Program
ABAP Dictionary
Transparent table VBAP
Database
VBAP
BA BA 17
gs_vbap
Structure ZS_VBAP
gs_vbap
DOs
Use transparent tables as data types only when we use it in direct connection with accessing a database.
DONTs Transparent tables should not be used as data types in all cases. Transparent table should not be used as data types in defining user interfaces. If transparent table is used as data type in user interface or interface it causes dependency on definition of database objects.
Internal tables
Internal table is a data object to keep identically structured data records at runtime. Number of data records depends on system capabilities only. ABAP runtime system manages the size of internal table. Individual data sets are known as table rows or table entries. Used in retaining data from database tables or sequential files for future processing. Also used in formatting data.
15
INSERT
INSERT gs into table gt_itab <Condition>.
16
DELETE
XXXXXXXX
17
Reports
18
Report: Structure
Most reports will generally follow the following pattern: Data Declaration Parameter and/or Select Options Events
Output
19
Report: Events
Reports react to user action, called events. Initialization
At Selection-Screen
Start-of-Selection End-of-Selection Top of Page End of Page
20
At Selection-Screen
Used to validate screen input
Start-of-Selection
Select data from tables and build logic to retrieve and manipulate data
End-of-Selection
To aggregate (Totals, Sum, etc)
Top of Page
Called the first time a write statement is executed in the program. Prints the column headers
End of Page
For displaying footer text like page no, etc.
21
Report: Exercise
Build a report where the user enters the sales order no and the report displays, those sales order no header and line item details
22
23
Screen Exits
order line item. If the sales order line item description is 123, it will change the sales order description to 789.
BADI
It allow for a multi-level system landscape (SAP, countryspecific versions, industry solutions, partner, customer, and so on). You can create definitions and implementations of BADI at any level of the system landscape.
User Exits
Customer exits support twolevel infrastructure (SAP and customer solutions )
Interface
Function Modules
38
You call a function module by its name (which must be unique) in a CALL FUNCTION statement
Function modules must belong to a pool called a function group.
You can Trigger Exception using RAISE statement Call a function module from within any ABAP program Using Call Function
CALL FUNCTION <function module> [EXPORTING f1 = [IMPORTING f1 = [CHANGING f1 = [TABLES f1 = [EXCEPTIONS e1 = [ERROR_MESSAGE [OTHERS = ro]]. a1.... a1.... a1.... a1.... r1.... = fn fn fn fn en = = = = = an] an] an] an] rn rE]
ALE-Idocs
47
Accounting
Controlling Purchasing
Local Purchasing
Sales, shipping and billing Plant Maintenance Inventory Management
ALE
Supports data consistency and data availability in distributed systems. Integrating system through asynchronous messaging using IDOCs or coupling systems narrowly through synchronous BAPI calls. Enables distribution between systems with different versions. Enables SAP R/3 to communicate to other systems. Provides functions for administration, monitoring and development. Library of ALE business processes to cover important business functions.
IDocs
An IDOC is a container for the data of a business object or technical R/3 object. Each IDOC has a message type. This indicates the type of business object or the business function of the data. Message types have processing rules in the receiving system. An IDOC contains segment hierarchy. The IDOC type describes the technical structure of the IDOC. IDOC types have versions.
50
IDocs
An Idoc consists of 3 types of records. Control Record. One Control Record per Idoc. Data Record. Multiple data records per idoc. Data Records contain Data to be transffered Status Record. Status Record will have give the status of the idoc. Idoc status can be checked using TCodes WE02, WE05 and WE09 IDocs can be reprocessed using TCode BD87 To copy Idocs use TCode WE19
51
52
Code 51, 52 53 54 55 56 60 61 62 63 64 65 68 70 73
Event Severity Error Harmless Error Harmless Error Error Warning Harmless Error Harmless Error Harmless Harmless Harmless
SAP Meaning Posting error Posting successful Error during formal application check Formal application check IDOC with error added Syntax error Processing despite syntax error IDOC passed to application Error passing IDOC to application IDOC ready to be passed to application ALE error IDOC is marked for deletion Original of an IDOC which was edited IDOC archived
53
Smartforms
54
Smartforms
SRM
SAP Fin
With WAS ( Web application server ) smart forms can be generated in HTML and be made available to users.
There are a number of predefined forms for all SAP applications.
Calling a smartform
To call the initial screen of a smartform call the transaction /SMARTFORMS. To select the relevant form objects choose the radio button Forms Styles Text Modules To work on the form choose form and then the radio button.
To create , display and change forms there is a graphical tool called the SAP Form Builder.
Never change the standard smart forms as they will be lost during the upgeade. To change a smartform copy the original form to a Z or customer namespace and then modify the form. To make settings specific to SAP Form Builder use the menupath Ultilities>Migration->Import SAPscript form.
57
Navigation Tree
Maintenance Screen
Form Painter
Edit Smartforms
Use SAP Form Builder to edit forms. SAP Form builder is divided into three areas: Navigation Tree: Graphical tree to display hierarchy in SAP smart forms. Individual form elements are displayed as nodes. The field list with variables is displayed below the navigation tree. Maintenance Screen: This is used to edit the attributes of the node selected. We can use the table painter to determine the layout of the table. All error messages are displayed below the maintenance screen. Form Painter: This is used to determine the layout of the page, such as the position and size of the text windows. Smartforms are connected to the transport system so they have to be assigned to packages. We can do this when we save the text module for the first time. Each smartform has a original language. The original language can be changed via the general properties tab.
59
Smartforms Exercise
Edit a customized PO smartform to add a new column at the item level
60
Thank You
61