You are on page 1of 48

Beyond the Obvious Beyond the Obvious

SAP R/3 System Overview


&
ABAP/4 Programming
SAP R/3 System
Overview of R/3 System
ogical View of R/3 System
ABAP/4 - SAP R/3 PROGRAMMING
ANGUAGE
Advanced Business
Application Programming
ABAP/4
Fourth generation language
Event driven
All SAP R/3 applications and parts of Basis are
developed in ABAP
Verbose language
%opics of Discussion
ABAP DeveIopment Workbench
Data Dictionary
Reports
BDC
SAP Script
ModuIe PooI
ABAP Development Workbench
ABAP Development Workbench
ABAP Development Workbench is a graphical
programming environment which enables us to create
new ABAP applications and change existing SAP
applications.
ABAP Workbench - %ransaction code -S001
%ools -> ABAP Workbench
Repository Browser - %ransaction code - SE80
Data Dictionary - SE11
unction Builder - SE37
Screen Painter - SE51
reating a Program
lick the button ABAP Editor in the Workbench
reating a program
%he program attributes screen looks like this
Debugging
Runtime Analysis
%ells us how long do specific operations take during
the run
Gives the trace list of subroutines that have been
processed
SQL trace helps to trace database calls to find out
the tables used by the application
Development class
A set of logically related development environment
objects.
A development class together with its objects is
transportable.
Each development class is under the administration
of one user.
reating development class
Data Dictionary
Data Dictionary
ABAP Development workbench tool
Stores system wide data definition
ompletely integrated with ABAP Workbench
Data Dictionary objects
Data Elements
Domains
%ables
Structures
Views
REPORTS
ABAP/4 Reporting
bjectives
Understand data declarations, commands, system
fields used in reports
Understand the selection screens
Understand the program level events, conditions &
loops
Understand the data retrieval from the tables and
nternal tables
Understand the modularization techniques,
field symbols and logical databases
%ypes of programs
%ype 1
run on its own
an be started it in the R/3 system without a
transaction code
an be executed in background
%ype M ( Module pool)
Program cannot run on its own and can be called via
a transaction code
%ype I ( nclude )
Program Selections
SELECT-PTIS Statement
SELE%-OP%ONS <Name> FOR <%able field>
NO EX%ENSON
OBLGA%ORY
LOWER ASE
SELE%-OP%ONS allows specification of multiple
values and ranges. %his can only be declared for
fields within tables defined in the %ABLES statement.
Example
SELE% SELE%- -OP%ONS: S_KUNNR FOR KNA1 OP%ONS: S_KUNNR FOR KNA1- -
KUNNR KUNNR.
Program Selections
PARAMETERS Statement
PARAME%ERS <Name> %YPE
LKE
OBLGA%ORY
AS EKBOX
DEFAUL%
%his statement allows entry of a single value on the
selection screen.
Example :
PARAME%ER PARAME%ER : P_KUNNR LKE KNA1 P_KUNNR LKE KNA1- -KUNNR KUNNR.
BIocking SeIection Screen
A sample screen
SELE%ON-SREEN BEGN OF BLOK RAD1
W% FRAME %%LE %EX%-002.
PARAME%ERS R1 RADOBU%%ON GROUP GR1.
PARAME%ERS R2 RADOBU%%ON GROUP GR1.
PARAME%ERS R3 RADOBU%%ON GROUP GR1.
SELE%ON-SREEN END OF BLOK RAD1.
DA%A Definitions
TYPES Statement
%YPES <name> %YPE or LKE
DEMALS
SAP allows the creation of new user defined data types.
And this does not create a variable, just a new type
that can be used in creating a variable.
Example :
%YPES : LKE BKPF %YPES : LKE BKPF- -BUKRS BUKRS
DA%A : NEW_ %YPE . DA%A : NEW_ %YPE .
Data Definitions
nternal %ables
DA%A : BEGN OF <name> OURS x,
(variable definitions)
END OF <name>.
Internal Tables are defined as an extension of a
structure, with the addition of an OURS clause.
Example
DA%A : BEGN OF %_WRK, DA%A : BEGN OF %_WRK,
%_KUNNR LKE KNA1 %_KUNNR LKE KNA1- -KUNNR, KUNNR,
SW %YPE , SW %YPE ,
END OF %_WRK. END OF %_WRK.
Program evel Events
N%ALZA%ON.
A% SELE%ON-SREEN
A% SELE%ON-SREEN OU%PU%
S%AR%-OF-SELE%ON
END-OF-SELE%ON
%OP-OF-PAGE
END-OF-PAGE
A% LNE-SELE%ON
A% USER-OMMAND
F Statement
ASE Statement
Modularization techniques
Defining Macros
nclude program
Subroutines
Function Module
BDC
BD - Batch Data ommunication
W To transIer data Irom non-SAP systems ( ie.
already available in electronic Iorm )
W Suitable Ior entering large amounts oI data as it
executes the transactions automatically
W Similar to entering the data in the transactions
manually
BD Methods
W Classical Method
W Call Transaction
W Call Dialog
Preparing a BD %able
W The BDC table should have Iive Iields viz.,
1) Program name
2) Screen number
3) Screen begin
4) Field name
5) Field value
Preparing a BD %able
For eg.
Prog Screen Scrn FieId FieId
name o begin name vaIue
SAPMMO3M 0060 X
RM03M- MA%NR mat.no
RM03M-MBRS indu. sec
.
.
SAPMM03M 0080 X
RM03M-WERKS target pla
.
.
SAP Script
SAP Script
-0.9;08
W &nderstand Forms, various components oI Iorms
such as windows, pages, character Iormat,
paragraph Iormat etc.
W &nderstand the control commands, symbols and
Iunction modules in SAP Script.
Forms
W Controls the page layout and text Iormatting
A Iorm oI the graphical Form Painter consists oI
W eader data
W Page layout
W Paragraph Iormat
W Character Iormat
W Documentation
SAP Script - ontrol commands
PERFRM ommand
%o all an ABAP subroutine (form) from any program
Syntax
/: PERFORM <form> N PROGRAM <prog>
/: USNG &VAR1&

/: ANGNG &VAR2&

/: ENDPERFORM
Function Modules in SAP Script
W 4721:3.9438
W OPENFORM Opens the Iorm output.
W RITEFORM Calls a Iorm element
W CLOSEFORM Ends the Iorm output.
W STARTFORM Starts a new Iorm.
W ,9,-,80
W READTEXT Reads a text module and
passes
it to the speciIied work areas.
Module Pool
reating Screens
lick screen painter button in Workbench
Structure of program
Flow logic
The Ilow logic oI a screen drives the processing
sequence Ior that particular screen. Flow logic
describes how the program reacts to the user actions.
The events used Ior this purpose are,
W Process beIore output (PBO)
W Process aIter input (PAI)
W Process on value request (POV)
W Process on help request (PO)

You might also like