Upload
suresh-duvvuri
View
8
Download
1
Embed Size (px)
DESCRIPTION
abap
Citation preview
SAP R/3 System Overview
&
ABAP/4 Programming
Beyond the Obvious
*
SAP R/3 System
Overview of R/3 SystemLogical View of R/3 System
ABAP/4 - SAP R/3 PROGRAMMING LANGUAGE
Advanced Business Application Programming
ABAP/4
Fourth generation languageEvent drivenAll SAP R/3 applications and parts of Basis aredeveloped in ABAP
Verbose languageTopics of Discussion
ABAP Development WorkbenchData DictionaryReportsBDCSAP ScriptModule PoolABAP 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 - Transaction code -S001
Tools -> ABAP Workbench
Repository Browser - Transaction code - SE80
Data Dictionary - SE11
Function Builder - SE37
Screen Painter - SE51
Creating a Program
Click the button ABAP Editor in the Workbench
Creating a program
The program attributes screen looks like this
... Debugging
Runtime Analysis
Tells us how long do specific operations take during the runGives the trace list of subroutines that have beenprocessed
SQL trace helps to trace database calls to find outthe tables used by the application
Development class
A set of logically related development environment objects. A development class together with its objects istransportable.
Each development class is under the administrationof one user.
Creating development class
Data Dictionary
Data Dictionary
ABAP Development workbench toolStores system wide data definitionCompletely integrated with ABAP WorkbenchData Dictionary objects
Data Elements DomainsTablesStructuresViewsREPORTS
*
ABAP/4 Reporting
Objectives
Understand data declarations, commands, systemfields used in reports
Understand the selection screens Understand the program level events, conditions &loops
Understand the data retrieval from the tables andInternal tables
Understand the modularization techniques,field symbols and logical databases
Types of programs
Type 1
run on its own Can be started it in the R/3 system without atransaction code
Can be executed in backgroundType M ( Module pool)
Program cannot run on its own and can be called viaa transaction code
Type I ( Include )
*
Program Selections
SELECT-OPTIONS StatementSELECT-OPTIONS FOR
NO EXTENSION
OBLIGATORY
LOWER CASE
SELECT-OPTIONS allows specification of multiple values and ranges. This can only be declared for fields within tables defined in the TABLES statement.
Example
SELECT-OPTIONS: S_KUNNR FOR KNA1-KUNNR.
Program Selections
PARAMETERS StatementPARAMETERS TYPE
LIKE
OBLIGATORY
AS CHECKBOX
DEFAULT
This statement allows entry of a single value on the selection screen.
Example :
PARAMETER : P_KUNNR LIKE KNA1-KUNNR.
Blocking Selection Screen
A sample screen SELECTION-SCREEN BEGIN OF BLOCK RAD1WITH FRAME TITLE TEXT-002.
PARAMETERS R1 RADIOBUTTON GROUP GR1.
PARAMETERS R2 RADIOBUTTON GROUP GR1.
PARAMETERS R3 RADIOBUTTON GROUP GR1.
SELECTION-SCREEN END OF BLOCK RAD1.
DATA Definitions
TYPES StatementTYPES TYPE or LIKE
DECIMALS
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 :
TYPES : CC LIKE BKPF-BUKRS
DATA : NEW_CC TYPE CC.
Data Definitions
Internal TablesDATA : BEGIN OF OCCURS x,
(variable definitions)
END OF .
Internal Tables are defined as an extension of a structure, with the addition of an OCCURS clause.
Example
DATA : BEGIN OF T_WRK,
T_KUNNR LIKE KNA1-KUNNR,
SW TYPE C,
END OF T_WRK.
Program Level Events
INITIALIZATION.AT SELECTION-SCREENAT SELECTION-SCREEN OUTPUTSTART-OF-SELECTIONEND-OF-SELECTIONTOP-OF-PAGEEND-OF-PAGEAT LINE-SELECTIONAT USER-COMMANDModularization techniques
Defining MacrosInclude programSubroutinesFunction ModuleBDC
BDC - Batch Data Communication
To transfer data from non-SAP systems ( ie. already available in electronic form ) Suitable for entering large amounts of data as itexecutes the transactions automatically
Similar to entering the data in the transactions manuallyBDC Methods
Classical MethodCall TransactionCall DialogPreparing a BDC Table
The BDC table should have five fields viz.,1) Program name
2) Screen number
3) Screen begin
4) Field name
5) Field value
Preparing a BDC Table
For eg.
Prog Screen Scrn Field Field
name No begin name value
SAPMMO3M 0060 X
RM03M- MATNR mat.no
RM03M-MBRSH indu. sec
.
.
SAPMM03M 0080 X
RM03M-WERKS target pla
.
.
SAP Script
SAP Script
Objectives
Understand Forms, various components of formssuch as windows, pages, character format,
paragraph format etc.
Understand the control commands, symbols andfunction modules in SAP Script.
Forms
Controls the page layout and text formattingA form of the graphical Form Painter consists of
Header data Page layoutParagraph formatCharacter formatDocumentationSAP Script - Control commands
PERFORM CommandTo Call an ABAP subroutine (form) from any program
Syntax
/: PERFORM IN PROGRAM
/: USING &VAR1&
/: CHANGING &VAR2&
/: ENDPERFORM
Function Modules in SAP Script
Form functionsOPEN_FORM Opens the form output.WRITE_FORM Calls a form element CLOSE_FORM Ends the form output.START_FORM Starts a new form.DatabaseREAD_TEXT Reads a text module and passesit to the specified work areas.
Module Pool
Creating Screens
Click screen painter button in Workbench
Structure of program
Flow logic
The flow logic of a screen drives the processing
sequence for that particular screen. Flow logic
describes how the program reacts to the user actions.
The events used for this purpose are,
Process before output (PBO)Process after input (PAI)Process on value request (POV)Process on help request (POH)