Abap PDF
Abap PDF
Day2 - Pre-requisites, SAP Project, SAP Architecture, Logon procedure, Logoff procedure,
of testing activities
*******************************************************************************
- it fulfills company specific , country specific, regional specific legal and statutory requirements
- SAP All-in-one :
- powered by NetWeaver
- Powered by NetWeaver
- consist of Core Applications , Industry specific applications, Enhancement Packages , and Support
Packages
*************************************************************************************
- Presentation Server :
- is also called as SAP GUI.exe (or) SAP Front End (or) SAP Logon
View
Program
Function Module
Screen
Menus
Global Classes
Forms
- Classification
- status : Active
- Runtime Environment :
Application Server :
- Dispatcher accepts request from presentation servers and maintain all request under
dispatcher queue
All work processes are using common memory area called Shared
memory
work process checks with user context , if the user authorized to perform current
operation , then Roll area allocates memory to work process (Roll-in) , after operation
memory gets rolled out
- Task handler : accepts the request from dispatcher and assigns task to respective areas
Open SQL :
Native SQL :
EXEC <SQL>.
------------------.
------------------.
ENDEXEC.
it is closely integrated with many development tools like ABAP Dictionary, ABAP Editor, Screen
Painter, Menu Painter, Class Builder, Function Builder...etc.,
D - Dialog WP
V - Update WP
E - Enqueue WP
S - Spool WP
B - Background WP
- Login Procedure :
- Start Server
- Logon using Presentation Server ( provide valid client number, username, password )
- open 6 sessions
-Logoff Procedure :
- Stop Server
Ex :
DEV
QAS
PRD
ZME
Client :
100, 200, 300 - Non-IDES clients - used for real time development purpose
menu bar
title bar
status bar
System menu and Help menu are default menus for every screen
F1 - System help
F2 - detail display
F4 - search help
F5 - create mode
F6 - change mode
F7 - display mode
F9 - technical information
F12 - cancel
Ctrl + F3 : activate
Ctrl + F8 : execute
is a combo box(user choose a tcode from list, and enter new tcode)
can be alphanumeric
ABAP Tcodes :
BASIS Tcodes :
Functional Tcodes :
SD tcodes :
MM tcodes :
*******************************************************************************
product -> SAP R/3 -> SAP R/3 -> SAP ERP (product name)
versions->3.0 to 4.6c -> 4.7EE -> ECC 5.0 -> ECC 6.0
(EhP1.........7)
6.20 7.00
6.30 7.01......7.40
*************************************************************************************
*****
Lock Management :
- Lock object is required to restrict simultaneous access of table record by several users at a time.
pass values
test program
pass values
test program
lock server (or) Enqueue sever holds all logical lock entries
the user who sets the lock, he can perform all operations
***********************************************************************
- Application data and Customizing data is client specific (or) client dependent
- SAP -> Repository -> Applications -> Components -> Package -> Repository Object
Ex :
- search for custom tables : z* press F4 - system displays all the table names begins with z
it provides search criteria based on object name (or) short description (or)
package (or) application component
tcode : SE81
Tag Browser,
MIME Repository,
Transport Organizer
***************************************************************
- Package can be created directly using SE21 tcode (or) SE80 tcode also
- click on create
- package type(development)
- continue
- save
- continue
it consist of object name, short description, owner, source client, target client, project, date,
status.
<INSTANCE>k<9xxxxx>.
EX :
ZMEK900021
ZME - instance
k - is constant
TR : transport request
*************************************************************************************
*****************
ABAP Programming :
ABAP Features :
- using 40% of Assembly language and 60% C,C++ initially ABAP was developed
WRITE
write
Write
- is typed language
- ABAP Editor is a development tool , which is closely integrated with ABAP Workbench
- click on create
- test / F8
every program must belongs to any one of the below program type
Type 1 program is self executable, other programs are not self executable
XSLT : program is used to convert ABAP program to XML and vice versa
- WRITE AT /<col_pos>. this statement displays the output at specified column position
- Every operator and operand must contain before and after space
c = a + b.
- Increment notation
i = i + 1.
add 1 to i.
- Decrement notation
i = i - 1.
subtract 1 from i.
- Single line comment : place * symbol at first column position, then entire line treated as
comment line
- Operators List :
+ addition operator
- subtraction operator
* multiplication operator
= EQ
<> >< NE
> GT
>= GE
< LT
<= LE
LIKE
IS INITIAL
*- Separators : are used to separate two things, do not require space before and after
- hyphen
~ tilde
/ slash
DATA : keyword is used to declare data objects ( variable, structure, internal table )
TYPES : keyword is used to declare local data types ( elementary, complex data types )
Declarations
Operations
Output
- can be classified as
are valid for all programs, all function modules, all global
classes ..and so on.
Char <- c
Numc <- n
Dats <- d
Tims <- t
Int4 <- i
Fltp <- f
Dec <- p
- fixed length
c character
n numeric character
d date
t time
i integer
f float
p packed decimal
- variable length
- structure types
- table types
- data references
- object reference
- classes
- interfaces
can be classified as
- Character Literals :
- Ex : 'Ravi'
'WB24 1234'
'SAP R/3'
- Numeric Literals :
- sequence of numbers
- Ex : 123
-456
'789'
Ex :
DATA n1 TYPE i.
Ex :
: is chain operator
it concatenates many statements with comma and finally ends with period
- using = operator
<field> = '<value>'.
n1 = n2 = n3 = 10.
- Parameters statement generates selection screen, to accept single value from user,
syntax :
IS NOT INITIAL
LIKE is used to create new data object , with ref to existing data object
As a result, technical properties(data type, length) of existing data object, copied to current data
object
syntax
Ex :
Ex :
- Note : if the variable is declared by making use of predefined type, length specification is allowed
if the variable is declared by making use of local data type, then length specification is not allowed
Note :
Unicode point of view, one character occupies either 2 bytes (or) 4 bytes
it occupies 8 bytes
Numeric Character : is special data type, which is used to display zip code (or) postal codes
X - Hexadecimal : (0123456789abcdef)
String Operations :
CO - contains only
CA - contains any
CS - contain string
CP - contain pattern
syntax : IF <condition>.
---<st block>---.
ELSE.
---<st block>---.
ENDIF.
syntax : IF <condition1>.
---<st block1>--.
ELSEIF <condition2>.
---<st block2>--.
ELSEIF <condition3>.
---<st block3>--.
ELSE.
---<statement>--.
ENDIF.
syntax :
CASE <field>.
WHEN 'val1'.
----<statment1>---.
WHEN 'val2'.
----<statement2>---.
WHEN 'val3'.
----<statement3>---.
---------------------------.
---------------------------.
WHEN others.
---<statement>---.
ENDCASE.
- Do Loop :
syntax :
DO <n> TIMES.
-----<statement block>---.
ENDDO.
sy-index default value is zero, when it comes first iteration sy-index value increments 1, in further
subsequent iterations sy-index value automatically incremented
- Terminating Loops :
- While LOOP :
syntax :
WHILE <condition>.
-----<statement block>---.
ENDWHILE.
- SA38 - tcode is used by end users (or) functional consultants, only to view output of any ABAP
program
- SE38 - tcode to create / change / display program, which is used by ABAP consultant
- ABAP Editor :
- Version Management :
while activation of the object , system generates one active version at development database
we can generate several versions for each modification and keep it into native version database
- Attributes screen -> Fixed point Arithmetic : is activated by system default for all programs.
*************************************************************************************
- variables can be declared using predefined type (or) local type
structure component
table field)
- syntax :
SELECT statement read the data from database table and fills in target variable
SELECT single statement is used to read single field value from database table
- after execution of ABAP statement , system automatically fills the sy-subrc value
SELECT SINGLE statement also used to read several field values from database table record
target fields must be specified with in bracket as field list , separated by comma
*************************************************************************************
************
Syntax :
----------------------------------,
----------------------------------,
END OF <structure>.
DATA keyword creates data object with the name <structure> in memory
structure fields can be created with data type ( predefined type / local type / global types )
<structure>-<field>.
- using = operator
MOVE keyword is used to move source structure field value to target structure
IS NOT INITIAL
- clear statement is used to reset structure field values back to initial values
if target fields order and select statement fields order differs from database table fields
order, then we have to SELECT ...into corresponding fields addition
Corresponding fields : only read and move the values for identical field names
which is not recommended by SAP (system needs to compare for every field name, leads to load on
the system)
---------------------------------------------,
end of <structure>.
- structure type is used while creation complex data objects ( structure and internal tables )
scope is local
- global structure type : is defined in ABAP Dictionary, valid for all programs
scope is global
-------------------------------------------,
END OF <st_type>.
*- Internal Tables :
- SAP doesn't recommend direct interaction on database tables for number of times.
that is why SAP recommends that create internal table on database table
-1 select statement is used to fill internal table with database table data
-2 append statement is used to fill internal table with our own record at the bottom
-3 insert statement is used to fill internal table with our own record at specified index
position
-4 read
-5 loop...endloop
- other operations
-6 sort
-7 modify
-8 collect
-9 delete
- deleting data
-10 clear
-11 refersh
-12 free
- are used to perform SQL operations(SELECT / INSERT / UPDATE / DELETE) on database tables
- internal table data can be downloaded into files / uploaded from files
- by default it is created with 8kb memory, if 8kb is filled then system allocates 12kb
memory, and so on... up to 2GB
- is old syntax
- it consist of 2 components
- header line : is implicit work area, which holds only one record at a time
can hold many records at a time as line by line (or) row by row
- Limitations :
if internal table name is itab, header can be address using name itab, but in order to
address body we have to use body operator itab[ ]
- header and body structure is same and memory address also same
- is new syntax
- it consist of 2 components
- explicit work area : is created explicitly, which holds only one record at a time
can hold many records at a time as line by line (or) row by row
Advantages :
- work area can be created based on requirement ( not mandatory in all cases )
internal table and work area can be addressed directly by its name
- work area and internal table structure is same and memory is different
- Index
- Standard Index
- Sorted Index
- Hashed
in genral Internal table rows are created by making use structure type
- Key Type : specifies whether internal table uses key (or) non-key of database tables
if the Internal table uses key field of Database table , then it is called as Unique
key, As a result internal table is populated delayed and can't contain duplicate records
if the Internal table uses non-key field of Database table, then it is called as Non-
unique key, As a result internal table is populated quickly, and can contain duplicate records
- no limitations
- are rarely used and recommended If the internal table to be created in a sorted order by
default
- it does not contain index , only hashed key ( is a combination of several lines )
- are rarely used and recommended to store large amount of data in internal table
end of ty_kna1.
- components of structure type, becomes columns of internal table and work area
- with out table of keyword it creates work area with one row
- Note : declare internal table fields as per database table fields order(sequence)
specify select statement fields order as per database table fields sequence ,
*- SELECT statement is used to fetch (or) retrieve (or) read data from database table and populate
into internal table
loop statement always start reading from internal table first record to till
last record
-----<display wa content>----.
finally it terminates
this syntax only reads index matching records from internal table
this syntax only reads condition matching records from internal table
Whenever WITH key is used , it is recommended to use Binary Search addition for quick search.
READ TABLE <itab> INTO <wa> WITH TABLE KEY <k1> = 'val'... <kn> = 'val'.
this syntax only useful to read only key fields matching record
*- Append : statement is used to add additional records at the bottom of internal table
first new entry must be filled in work area, then perform append operation
syntax :
*- Insert : statement is used to insert new record at specified index position of internal table
new entry must be filled into work area first, later use insert statement
syntax :
syntax :
SORT <itab>.
this statement modifies all condition matching records with new values
Syntax :
this statement compares work area record with existing internal table records, if it
finds any duplicate records ( character data type must match), then it performs sum of data i,f,p
values
syntax :
syntax :
CLEAR <wa>.
CLEAR <itab>.
syntax :
REFRESH <itab>.
*- FREE : statement is used to remove internal table entries and allocated memory also
syntax :
FREE <itab>.
Note : REFRESH and FREE statements can only used on internal tables
*- IS INTIAL (or) IS NOT initial is used as logical query to check internal table status (whether
it contain entries or not )
syntax :
OCCURS <memory>
KIND <type>.
*- appending many records from source internal table to target internal table
*- inserting several records from source internal table into target internal table
INSERT LINES OF <itab1> FROM <indx > TO <indx INTO <itab2> INDEX <indx>.
*- sy-dbcnt is a system field, which provides number of records effected after open SQL
operation(INSERT / UPDATE / DELETE / SELECT)
local internal table types are declared with TYPES keyword with in the
program, scope is local, valid for same program
global internal table types are created in ABAP Dictionary , scope is global
, valid for all programs
internal tables types are used while creating complex data object internal
table in the program
TYPES:<t> TYPE <table type> TABLE OF <line type> WITH <key type> <f> INITIAL
SIZE<m>.
Ex :
Types t_kna1 type Standard table of kna1 with non-unique key land1 initial size 0.
Types t_kna1 type Sorted table of kna1 with non-unique key land1 initial size 0.
Types t_kna1 type Sorted table of kna1 with unique key kunnr initial size 0.
Types t_kna1 type Hashed table of kna1 with unique key kunnr initial size 0.
END OF itab.
0 allocates memory
*************************************************************************************
*************************
Modularization Techniques :
- Modularity is a programming technique, where large size program is divided into small modules (or)
blocks and dealing with individual modules
- Advantages :
- macros
- includes
- subroutines
- function modules
- Includes :
Parameter passing between include program and executable program is not possible
it is mainly useful for program type 'M' and program type 'F'.
- Include classification
Procedures :
is a set of statements which begins with FORM keyword and ends with
ENDFORM keyword
FORM <subroutine>.
----<statements>---.
ENDFORM.
PERFORM <subroutine>.
After subroutine definition, another subroutine definitions are allowed, but general
statements are not accessible
As a standard approach, all Perform statements exist at the top of the program,
and subroutine definitions exist at the end of the program
Every subroutine must have unique name and it performs unique operation
- Terminate subroutine
#include <stdio.h>
main()
int a, b, c;
a=10;
b=20;
c=add(a,b);
printf("%d",c);
add(x,y)
int z;
z=x+y;
return(z);
- Pass by reference
- Pass by value
The parameters which are defined along with PERFORM statement is called as Actual Parameters
The parameters which are defined along with Subroutine is called as Formal Parameters
As a Rule, Number and data type of actual and formal parameters should be same
*- Pass by Reference : while subroutine call perform statement sends (export) address of
actual parameters to subroutine.
formal parameter doesn't have separate memory, but in turn they point
to the address of actual parameters
*- Pass by Value : while subroutine call perform statement sends(export) value of actual
parameters to subroutine.
FORM statement
declared formal parameters with out VALUE keyword are pass by ref(receive
address of actual parameters)
formal parameters USING with VALUE keyword are pass by value (receive value
of actual parameters)
formal parameters CHANGING with VALUE keyword are pass by value and
result
*- Local variables can be defined with in subroutine using DATA (or) STATICS keyword
if the local variable is defined with DATA keyword, then its scope is local, valid with in the program.
if the local variable is defined with STATICS keyword, then it scope is extended to next subroutine
call also.
- External Subroutines : are created under program type 'S' - subroutine pool
PERFORM <ex_sub>(program).
*************************************************************************************
***
Function Modules :
is a Repository Object
continue
In order to perform operations function module must be declared with formal parameters
As a Rule, Formal and Actual parameters number and datatype should be same.
scenario1 :
- pass by ref :
- implement logic in source code with the help of import and export parameters
scenario2 :
- pass by value :
- declare import parameters with default values, check pass value checkbox
Import tab :
import formal parameters import (accept) the values send by calling programs
if optional check box is checked, then it act optional import parameter, when function module is
called it is displayed as commented
if pass value check box is activated, then it is pass by value otherwise it is pass by ref
if default values are provided for import parameters, then it is act like optional
Export Tab : is used to declare formal export parameters with in the function module
Note : SAP recommends that use Import and Export tabs as Pass by value
Scenairo3 :
- declare import parameters with default values, check pass by value check box
changing tab is used to return the changed value back to calling program
Scenario4 :
begins with t_
- activate , test
- while processing function module, if system come across typical statements, it triggers runtime
error
- we can plan in advance and implement exceptions ,in order to avoid runtime error
RAISE <exception>.
- while calling function module in executable program, system automatically fills and assigns sy-
subrc value to exceptions
Notes :
- Attributes tab :
calling syntax :
calling syntax :
- calling syntax :
- short description
- function group
- package
- application component
*************************************************************************************
***********
BAPI explorer provides list of Business objects in Hierarchical view and Alphabetical
view
Hierarchical view displays all business objects and Application component wise
mm-pur
->interfaces
-> attributes
-> events
-> All SAP defined BAPI function module names begins with BAPI_
-> User defined BAPI function module names should begins with Ybapi (or) zbapi
-> import and export parameters are created by making use of bapi structures
Path from Easy Access : SAP menu -> Tools -> Business Framework -> BAPI Explorer
to develop business object ,we use business object builder (tcode : swo1)
Path for Business object builder : SAP menu -> Tools -> ABAP Workbench -> Development ->
********************************
RFC is a interface , which provides communication between SAP systems (or) non-sap
systems
webRFC
- ALE is a SAP proprietary technology used to distribute master data (or) transaction data
in distributed system
first system ,which sends data is called outbound system (outbound process)
second system, which receives data is called inbound system ( inbound process)
- ALE uses RFC configuration, while establish connection between external servers
- IDoc is intermediate document, is carrier which carries data from one system to another system
*************************************************************************************
**************
6 types of message :
message class concern messages are valid to use in entire SAP system
In order to use global message class in ABAP program, we have to specify message class name along
with report statement.
MESSAGE <msgtyp><msgno>.
Ex :
MESSAGE I000.
it appears with some text and informs to user and allow the user to
proceed to next screen
Status (or) Success message : appears in status bar of same screen (or) next screen
Abort (or) Abend message : appears in special screen with model dialog box
MESSAGE <msgtyp><msgno>(messageclass).
Ex :
message i000(zmsg_cls).
Ex :
are reusable
While program execution, program concern message statement sends values to message class
message statement
*************************************************************************
Write Formats :
************************************************************************************
- Dialog Screens
- Selection Screens
- List Screen
- Dialog screens are special screens , which are used to perform business transactions
- Selection screens and List screens are used in Reporting (type 1 programs)
write statements and write formats are used to display output as per client requirement
- Selection Screen :
- PARAMETERS :
syntax :
selection text is used to provide alternative long text for parameter field
- Parameters with DEFAULT addition is used to provide default values to selection screen field,
- Parameters with OBLIGATORY addition is used to make selection screen field as required entry
(mandatory field). User must supply the value, otherwise system doesn't allow to proceed to
next screen
- By default input field property is converting lower case value into upper case
- VISIBLE LENGTH addition is used to display input field with specified length, but it accept
value as defined length
- SPACE
at least two radio buttons required under one radio button group
radio button group name can be alphanumeric, but can be up to 4 characters length
click on save
- short description
- save
notice that system generated get variant option, which is useful to choose any
variant from the available variants list
*- Syntax of parameters :
this syntax is used to create parameter field, by making use of database table field
*- Syntax of Selection-Screen :
------------parameters
------------select-options
SELECTION-SCREEN skip.
SELECTION-SCREEN uline.
---parameters
---parameters
System displays standard 1000 selection screen first ,next system display custom selection screen
100.
user actions on selection screen can be handled under AT SELECTION SCREEN event
UCOMM component holds the function code value dynamically based on user interaction on
selection screen push button
Syntax :
select-options field name should begins with so_, it must be up to 8 characters long,
system can't recognize the database field automatically (because of FOR addition)
so TABLES keyword is used to create one work area the name of database table
this internal table always created as old syntax (with header line)
BT - between ( default )
NB - not between
EQ - equals to
NE - not equals to
GT - greater than
LT - less than
using this icon user can set / reset include single value or include range of values ,
- Advantage of this selection table is : user can dynamically specify the values to fetch data
NO-EXTENSION is used to suppress the multiple selections icon, ( user can't choose
multiple selections )
NO INTERVALS is used to suppress the upper limit field, ( user can't enter upper limit value )
- SCREEN is a built-in internal table which provides several screen field attributes
LOOP AT SCREEN
if screen-name = '<fieldname>'.
screen-<attribute> = 1 or 0.
modify screen.
endif.
ENDLOOP.
by referring modification group, we can apply common attribute to all fields at a time
*************************************************************
sy-subrc and sy-dbcnt system fields are recommended to use for each open SQL
statement
first fill work area , and use below statement to create single record
fill multiple records into internal table, then use below statement to create many
records
Syntax :
Syntax :
- SELECT : statement is used to read / fetch / retrieve data from database table
WHERE <condition1>
GROUP BY <column>
HAVING <condition2>
ORDER BY <column>.
this loop repeats for number of times depends on number of database table entries
it is not recommended to hit the database table for number of times, it is having
negative impact
*- declare variable as target area, populate it using SELECT single <field> statement
*- UP TO <n> ROWS addition is used to read records from database table based on index
*- GROUP BY :
if several records have similar data, then we can apply group by on column .
HAVING :
followed by condition
*- DISTINCT :
*- CLIENT SPECIFIED :
*- Aggregate functions : are used to perform Arithmetic operations along with Select Statement
KNA1 <-> KNB1 <-> KNC1 ( common field is KUNNR - customer no)
*- Inner Join : reads the data from both tables using join condition
*- For all entries : is used while populating current internal table, while comparing existing
internal table
***********************************************
Inter program Communication : this topic deals with program to program communication
syntax :
SUBMIT <program>.
- syntax :
this syntax calls the another executable program and while returning it display currnt program output
- syntax :
this syntax calls other program concern selection screen first, then display output
- syntax :
this syntax calls the specified tcode , and while returning it executes current program remaining
statement
- syntax :
- syntax :
this syntax leaves the current program and calls the specified tcode, while returning control transfer
to SAP Easy Access
SET parameter statement sets the value from program to SAP memory
GET parameter statement reads the value from SAP memory to other program
syntax :
Fieldname Parameter ID
KUNNR KUN
MATNR MAT
LIFNR LIF
VBELN AUN
BUKRS BUK
whenever user logs in, system reads values from user profile and display
system menu -> user profile -> own data -> parameters tab ->
*- Parameters and SELECT-OPTIONS can also be defined with parameter id, using MEMORY ID addition
system reads the value from user profile and display as default value
****ABAP Memory : is a common memory between all internal sessions of an external session
Export statement exports the value from internal session to ABAP memory
Import statement imports the value from ABAP memory to other internal
session
advantage of boxed addition is when data object is created, initially it won't allocate memory.
substructure components are created in PXA - with initial values, as non modifiable part
when substructure components are assigned with value (used), then it revoke the reference from
PXA to modifiable memory
*************ABAP Reporting :
- All SAP defined built-in reports are available under information system
- Interactive Reports
- ALV Reports
- ABAP Query (or) SAP Query : are generated by Functional consultant, without programming
knowledge
- events are not triggered as the sequence it was written in the program
AT SELECTION-SCREEN ON seltab.
***********************
START-OF-SELECTION.
END-OF-SELECTION.
TOP-OF-PAGE.
END-OF-PAGE.
*************************************************************************************
****************
Steps :
- click on create
- continue
- check, test
**************************************************************************
Note : Custom List heading and column headings can be provided using text elements
*************************************************************************************
***********************
- Indexes
- Buffering
- do not use select ...endselect loop, use Array Fetch (into table)
- instead of sorting at itab level, use Order by addition with select statement
- instead of perform arithmetic operations at itab level, use select aggregate functions
- instead of deleting duplicate records at itab level, use select distinct addition
- do not use nested select statements , use for all entries (or) parallel cursor
- Performance Tools :
- ABAP Debugger
ABAP Editor -> environment menu -> examples -> performance examples
- it checks performance checks, security checks, extended program check, user interfaces
- path from ABAP Editor : Program menu -> check -> code inspector
- path from SAP Easy Access : SAP menu -> tools -> ABAP Workbench -> test -> code
inspector
*****************************************************************
Authorization :
- in general select statement doesn't perform authorization check by default, we have to explicity
implement authorization check
02 - change,
03 - display
- Step3 : tcode : SE93 : while creating tcode for executable program, ie.,Report Transaction,
call pattern, choose authorization radio button, specify authorization object, continue
check sy-subrc.
*---------
- command /h
- Classic Debugger :
F8 - run - it stops debugger and executes rest of the program at a time, procced to next
screen
- execute
Break-points :
- is a signal in the program source code, where system stops processing and starts debugger
BREAK-POINT.
BREAK-POINT <n>.
BREAK <username>.
hard coded
- Watch Points :
unlike Break points, watch points are used to watch the program changes
watch point can be defined by specifying field name, whenever field value changes, system prompt
with message "watch point reached'
watch point can also be created by specifing condition (values), if system meets the condition then
prompts with message "watch point reached'
ABAP Dictionary :
- tcode : SE11
- is a central repository, which consist of database tables, views, data types, type groups, domains,
search help , lock objects
- dictionary definitions have global scope, ( valid for all programs / function modules / global
classes )
- is also called as virtual database ( which consist of meta data - definitions of underlying
database objects )
- while activation of database tables, and database views are created in the underlying database
*- DATABASE TABLE :
- is a two dimentional matrix, which consist of records as rows and fields as columns
- SD Tables :
- MM Tables :
- System Tables :
T100 - messages
- Flight tables :
SCARR - Airlines
- utilities menu -> table contents -> display(to view the data of table)
- execute
- Delivery Class - specifies the data to be transferred between clients while client copy (or)
upgrade
A - Application Table
C - Customizing Table -
specifies the table space occupied by current table in the physical database
0 0-250
1 250-2000
- can't be enhanced
- Dictionary Data types : also called as Integrated Types (30 data types)
CLNT - client
INT4 - integer
DEC - decimals
CURR - currency
QUAN - quantity
LANG - language
CHAR - character
DATS - date
TIMS - time
- BASIS Classification :
- consist of MANDT as first field and key field (CLNT as data type)
Ex : KNA1, MARA
Ex : T002, TADIR
Master Data
Transaction Data
Ex :
Ex :
Delivery Tables(LIKP,LIPS)
Billing Tables(VBRK,VBRP)
Purchase Tables(EKKO,EKPO)
Ex :
Ex :
T000 - clients
T001w - plants
Transparent Tables :
- Ex : KNA1, MARA
Cluster Tables :
- Ex : BSEG, BSES
Pooled Tables :
- Ex : TRMAC, TTDTG
if logging is activated , system records all the changes done by all users and finally
generates a log file as table history (tcode SCU3)
click on create
save, back
specify data type, length, decimal places, using data element / predefined type
Utilities menu -> table contents -> create entries (to new entry)
Utilities menu -> table contents -> display ( to view existing entries)
Note : When we create new table by copying existing table, source table structure only copied to
target table, content will not be copied
Note : Technical settings of built-in table can be modifiable, without SAP permission and with out
access key
- must be adjacent
- if a table consist of more than 1 key field, it is called as composite primary key
- functional fields
- Activation :
- Data Element :
- is a Repository object
- can be created using data type as (predefined type / domain / reference type)
- once the data element can be created and activated , it can be used while creating table field
(or)structure component
- click on create
- maintain short, medium, long, heading field labels (field label tab)
- notice medium field label( utilities menu -> settings -> user parameters -> keyword ->choose
field label)
- Domain :
- it also describes the value ranges like ( single values / intervals / value table )
- once domain created and activated, then it can be used while creating data element
- click on create
- Usage of domain
- while creating data element , specify domain name under datatype tab
it provides list of used objects , where ever the current object is used.
- Domain - Definition tab : consist of Format section - specifies the internal data storage format
Sign option valid for INT4 , Dec, FLTP, CURR,QUAN data types
Conversion routine converts user display format to internal format and vice versa
value range tab is used to define either single value (or) interval values (or) value
table
As a result, where ever this domain is used, this fixed values appears in F4 list
if user chooses a value from the list, then entry is valid, otherwise system
rejects entry
Intervals(or) ranges : we can also define interval values with lower and upper limit
*************************************************************************************
***********************
each structure component can be created with data element (or) another structure
(or) another table type
- click on create
- press enter
- Flat structure : each components created with data element (no ref types)
- Deep structure : one of the structure component is ref to another internal table type
Note : RANGES keyword can be used to create internal table with Sign, Option, Low, High
Table type :
table type can be created using line type ( can be data element / structure )
Deep Structure :
finally activate
continue
.include structure :
- it is reusable
.append structure :
- it is table enhancement
- it is not reusable
are special includes which are defined by SAP and implemented by customer
at customer site
where ever SAP developer is expecting additional fields from customer, there
they defined the CI_INCLUDE
- are reusable
each type group concern type name (or) constant name should begins with type
group_
In order to use global type group in program, we have to add type pools statement
in the declaration
TYPE-POOLS <typegroup>.
*-----------------------------
Requirement : If at all we want to read two database tables data, the base tables must have
relationship in the underlying database
F4 help is useful to end user while creating new entry with the help of other table
values
Field validation : if the user choose a value from the F4 list , then only record is
valid, otherwise record is invalid
act like base table (or) reference table for f.key tables
check table key field values automatically appears as F4 help in F.key field
notice F4 help
Additional Theory :
F.key field can be a key field (or) non key field in F.key table
1:1
1:N
1: C
1:CN
- Where-used list
- database views
Hint : Check table key field name and Foreign key table f.key field name both can be same (or)
different, but both must have common technical properties
after defining value table at domain level, where ever this domain is used system
proposes this value table name as check table
it is mainly useful while defining F.key , for automatic proposal of value table
name as check table
- Whenever currency values are entered, it must followed by currency key( data type CURR
must followed by CUKY ).We have to provide ref table and ref field name for CURR
field
- generating F4 help
- Whenever quantity values are entered, it must followed by unit of measurement( data type
QUAN must followed by UNIT data type)
we have to provide ref table and ref field for QUAN field
Note : Fixed values only possible for data types : CHAR, NUMC,DEC,INT1,INT2,INT4.
***********************************
Conversion process :
- after activation of the table at ABAP Dictionary, same table gets created in the physical underlying
database
for few changes system accepts(field length increase) and activate successfully
but for few changes(field length decrease) at later level, system prompts for convert table
***********************************
Indexes :
- whenever table is activated ,system automatically creates primary index on key fields
- path to view indexes : utilities menu -> database object -> database utility -> indexes tab
- system creates physical table and its index in the underlying database while activation
- but if the query is on non key field comparison, then result is delayed,
- if we are accessing non key field values very frequently , then we can create secondary index on non
key field
- path : open the table in display mode -> click on indexes tab -> click on create index
- finally activate
******************************************************************************
Buffering :
- database interface initially looks at buffer , if buffer contain data then reads from buffer
- most of the tables default setting is buffering not allowed ( by pass buffer )
- Frequently accessed, and rarely updated / written / modified tables are recommended for
buffering
- Buffering types :
Fully buffered : if the table is less ( <30kb), then it is recommended for full buffering.
Generic Area buffered : if it is activated only generic key matching records are loaded into
buffer. generic key can be defined by specifying key fields of the table
client specific and language specific tables are by default generic buffered
- select distinct
is also called imaginary table (or) temporary table (or) virtual table
- Database Views
- Projection Views
- Maintenance View
- Help View
- Database View : is a collection of data from more than one related tables
it reads the data from both tables based on defined join condition
click on create
click on relationship
Note : if database view is created on single database table ,then maintenance is possible
DB views are used in programs ,(alternative for inner join select statement)
- DB table / DB View :
- is dictionary object
- Internal table :
- program object
*******************************************************
Maintenance View : unlike other views, it is used to maintain (read / change / insert / delete)
data on database tables
- click on create
- click on relationship
- click on view fields tab (notice that left side table fields already loaded)
- one step ( system uses only overview for read, change, insert, delete operations)
- two step ( system uses overview screen for read, change, delete operation)
if standard recording routine is selected, then system maintains all the changes under
one transport request number
back
Note : whenever custom table is created, immediate perform table maintenance generator
tcode : SM34(system menu -> services -> table maintenance -> view cluster
maintenance)
Help View : is also used to read data from database tables and display
Note : only Database view created in the underlying database as independent object
*************************************************************************************
*******************
- Entry help
- F4 help
- Hit List
- Input help
- when end user press F4 function key , system display list of values for input field
- user can choose a value from the list (or) based on the information user can enter
new value also
- Explicitly (based on requirement) search help can be defined in ABAP Dictionary initial
screen
- Search help is replace for match code object( valid for 4.6c version )
- click on create
- click on copy
- activate table
Testing :
Notes :
- search help parameter name and table field name should be same
- export is activated, to export the values from hit list to screen fields
- SPos specifies the current field search position in the implicit system generated select statement
- using parameter id
- Search help exit is used to change F4 help behavior( it is implemented by function module)
- Hot key is represented by single character, it is useful to select current elementary search help in
collective search help
- dialog box with value restriction : system first displays restricted dialog box , so that user can
implement further condition
*************************************************************************************
***********
click on create
specify search help parameter list from both elementary search helps
*************************************************************************************
****************
- Dialog screens are special screens , which are used to perform business transaction
- input filed
- check box
- radio button
- push button
- table control
- tabstrip control
- Easy navigation
- user friendly
- Every dialog screen behind a special Editor , Flow Logic Editor is available
Flow logic Editor code is executed by Screen Process (or) Screen Interpreter
- is a collection of modules
- PBO
- PAI
- POV
- POH
- in dialog phase : user interact with screens ( handled by dialog work process )
- in update phase : updating screens info to database table ( handled by update work
process)
- Synchronous update : if user creates new record, then system updates all screens
information to database tables finally after explicit save on final screen.
- Asynchronous update : if user opened existing record for changing , then enqueue WP
performs lock first, all the changes done by the user updates immediately
into temporary tables (vb*)
activate program
- tcode - se51 - specify program name and screen number , click on create
click on create
Notes : when user enters tcode in command field, system checks that exist or not
if tcode exist, it calls the dialog program concern dialog screen and display
when user enter values and click on pushbutton-> it triggers PAI event->
module call happens -> values are passed from screen to program ->
at program level operation happens -> operation result passed back to screen
Values are passed from screen to program (or) program to screen if their names are
same.
SY-UCOMM is a system field which holds function code value after user interaction on
push button
- test tcode
- Model dialog box : are small dialog screens which are displayed at specified co-ordinates
syntax
In order to navigation we have to specify the next screen number as other than
current screen number
- Cursor position : specifies default cursor position, while loading the screen
text(display text)
input field can be made as drop down list and drop down list with key also
provide text
drag and drop 2 radio buttons, select both -> right click -> define group
Tab strip control : is a complex GUI element, which displays tab wise different information
Sub screen Area : is a special GUI element , which is used to call sub screens
Table control : is a complex tool, which is used to display output in tabular format
- one default GUI element exist at the last of elements list for every dialog screen
- it is named as OK
- process
- module
- field
- on
- chain
- endchain
- loop
- endloop
- call
by default screens are called as per static screen sequence defined using next screen option
this syntax is used to freely navigate between all normal dialog screens
leave screen.
design time(static) attributes can be overwritten dynamically using SCREEN internal table
user defined module pool program name may begins with Y (or) Z
- activate
place the cursor on program -> right click -> create screen
- specify text
*************************************************************************************
*******
Menu Painter : is a development tool, which is closely integrated with ABAP Workbench
tcode : SE41
- selection screen
- list screen
- dialog screen
- program type 1
- program type M
- program type F
- Set pf-status is a collection of menu bar, standard tool bar, application tool bar
- Menu bar : consist of maximum 8 main menus ( 2 default system and help menus )
*- demo :
- continue
- specify menu as operations -> double click on it -> specify function code and its corresponding
display text
- double click on it
F1 - system help
F3 - back
F4 - search help
F11 - save
F12 - cancel
- Function Type :
S system function
T call a function
E Exit command
H internal use
************************************************************
- required entry
- In addition to that , we can also implement extra field validation using Field (or) Module statement
- syntax :
ex :
- syntax :
ex :
- syntax :
ex :
- conditional module call implemented using ON INPUT, ON-REQUEST , and unconditional module call
implemented using AT EXIT-COMMAND.
- syntax :
this module is called only when user enters a value other than initial value
- syntax :
create <mod> and implement code for back, exit, cancel buttons
back
test
- it is complex GUI element, which is used to display different information in different tabs
- in PBO while loading the screen we have to keep one tab to be open by default
- tab strip control is a collection of tab title + tab page( sub screen area) + sub screen
- Tab title is nothing but push button, we have to provide name, text, function code
- Sub screen area is another GUI element, it calls the sub screen and displays
- One sub screen can be called by many sub screen arears (reusability)
- Steps :
it consist of component as Active tab , which specifies the current active tab
- design layout
- drag and drop one sub screen area into tab strip control
- provide the same sub screen area name as reference to other tabs
- activate , back
- specify the logic to call respective sub screen based on user selection
- activate, back
- independent call sub screen statements required to call individual sub screen
- Application Scrolling :
Classical List -> Interactive List -> Procedural ALV -> OOALV
- Procedural ALV : can be generated using Type group(SLIS) and function modules(
Reuse_alv)
- Advantages of ALV :
- it provides lot of features to end users, without changing program code and without
having programming knowledge , user can carry out several operations
- ALV output displays special generic functions tool bar, which consist of options like
- notepad
- word
- excel
- HTML
Theory : OOALV report final output will be displayed using dialog screen
Screen painter have one GUI element as custom control is used to display
output
- custom container
- docking container
- split container
In order to work with this class, we have to supply container name ( as per
constructor signature )
In order to work with this class, we have to supply parent container instance(as
per constructor signature)
- specify call screen statement, create 100 dialog screen with forward
navigation
- create instance for grid class, pass above created container instance as
parent
- back
*****************************************
Demo2 : ALV Fieldcat grid report : this report displays only particular required columns
output in final output
- manually
- in case of manually , we have to fill work area first , then append work
area to internal table next
declare internal table and work area using above line type
- activate , back
- test program
this function module imports global structure defined in ABAP Dictionary with 2
table fields and merges (prepare) returns the changed field catalog
this report displays basic required information on basic list, after user
interaction(double click) it displays its corresponding details in secondary list.
OOABAP :
- is also called as ABAP Objects / ABAPOO
- implementing C++ and Java features in ABAP is called as
ABAP objects
- is extension to classic ABAP
- it supports both syntaxes
- Classic ABAP
- declarations using TYPE (or) LIKE additions
- supports internal table old & new syntaxes
- procedures : subroutine, function module
- classic exception handling using sy-subrc
- Reports : procedural ALV report
- procedural enhancement technique : Customer exit and User
exit
- data flow diagrams (SAD)
- ABAP objects
- declarations using TYPE REF TO addition
- supports internal table new syntax only
- procedure : method
----<declare methods>----
----<declare events>----
ENDCLASS.
- tcode : SE38
- create executable program
- declare ref variable with ref to global class
- create instance
- call methods
******************************************************
Working with methods :
<fp> = <ap>
receiving
<fp> = <ap>.
********************CLASS Components
obj->n1.
syntax to access static attribute :
Ex :
c1=>num1.
obj->num1. "accessing static attribute thru instance also
possible
Exploring Attributes :
- Attributes can be declared with predefined type (or) local types
(or) global types
- Attributes can be declared as - Instance attribute / Static
Attribute / Constants
- Attributes can be made as Read only also
- Read-only addition only allowed for public attributes only
- Attributes can be defined under public, protected, private
sections
- Attributes can be declared with TYPE addition
with LIKE addition (ref to existing
attribute)
with TYPE REF TO addition (ref to
other class / interface)
- Attributes can be printed thru write statement
- Attributes can be printed thru any one of the method also
- Attributes can be assigned to method signatures
************
Exploring Methods :
- Instance method
- Static method
- Functional Method
- Instance constructor
- Static constructor
- self defined method (ME)
- event handler method
- Factory method
Static components :
- exist per class (only at class level)
- can be accessed by both instance and class
- accessed using double arrow =>
Instance Constructor :
- always named as CONSTRUCTOR
- must be placed in public area
- only one instance constructor allowed per
class
- have signature with import parameters and
exceptions
- the first method called among methods
- declared by METHODS keyword
Static Constructor :
- always named as CLASS_CONSTRUCTOR
- must be placed in public area
- only one static constructor allowed per
class
- doesn't have signature
- is called before instance constructor
Advantage of constructor :
- allocating initial resources to class
- changing static attributes values
- initialize attributes that are not assigned by value addition
- can inform other objects about the object creation
ME :
- is a predefined self reference method
- is always named as ME only
- with out declaring this method, we can use it for accessing
attributes and calling methods
- but it can only used with in the method implementation,
- it can't be called outside directly
**************
Theory :
- trigger class concern any one of the method is responsible to
trigger event of same class
- when trigger class instance thru event is triggered , based on
registry control transfer to handle class / handler
classes
- trigger class can be one and handler class can be one or many
- registry is must to transfer the control to handler classes
- both trigger class instance and handler class instance both are
connected at runtime
- create instances
- specify set handler statement ( registry )
- call trigger class method
***************************************************************************
Object Oriented Features :
- Encapsulation : classic abap supports encapsulation concept
thru function group
function group global data is protected, it can
only be accessed by any one of the function module.
Multiple instantiation is not possible thru function
group
******************************************
Class builder :
- tcode : SE24
- is development tool , which is integrated with ABAP workbench
- Global interface :
- doesn't have visibility sections
- can have another global interfaces also
- but it can't use super class
- it can't have friends
- it doesn't have final checkbox
- it act like abstract class (direct instantiation is not possible)
- methods can't be implemented
- events can't be triggered
- doesn't test environment
- doesn't have constructor and static constructor
- Global Class :
- class can have immediate one super class, but it may have
many interfaces
- it can grant friendship to other class / interface
- it can be final (or) not final
- it can implement super class methods (or) interface methods
- it can trigger class events (or) interface events
- it have test environment
- it contain visibility sections
- it have constructor and static constructor
- class can be created as
- usual class
- exception class
- persistent class
- test class
*********************************************
Object oriented design patterns :
- Abstract class :
while defining local class we can ABSTRACT addition, then it is
abstract class
- it can't be instantiated (while inheriting into subclass, we can
redefine and work with abstract class
components)
- we can make method also as ABSTRACT
- while inheriting into sub class abstract method can be
redefined
- Final class :
- if a class have FINAL keyword addition, it can't be inherited to
sub classes
- Factory Method :
- are special static methods declared under public section
- are useful to create instance in enhancement exit technique,
it creates instance for badi interface.
Friends Concept :
*- Shared Objects :
- are useful to share common information available in shared
objects memory
- shared memory is a common memory , used by all work
process at application server
- shared memory consist of shared objects memory
- shared objects memory is a collection of shared areas
- shared area consist of area instances
************Dynamic Programming :
- Field Symbols :
- is a place holder for data objects
- basically it doesn't occupy memory, but based on assignment ,
it points value of data object
- implements de reference pointer concept of C language
- are mainly used in dynamic programming
- syntax to declare field symbol :
FIELD-SYMBOLS : <FS>.
- FS is name of field symbols
- Data references :
declarations with ref to DATA
ex :
DATA <gr_gen> TYPE REF TO DATA.
- In classical ABAP
to describe field properties , we use DESCRIBE FIELD
statement
to describe itab properties, we use DESCRIBE TABLE
statement
to describe list properties, we use DESCRBE LIST
statement
Enhancements :
- Changes to standard SAP :
- Customization
- Personalization
- Enhancement
- Modification
- Custom Development
- Personalization :
- perform changes to SAP screens :
- creating favorites
- creating desktop shortcuts
- creating role based menus
- performing changes to screen fields :
- Enhancement :
- without changing standard SAP , customer can add additional
functionality
- Enhancements are upward compatible
- Enhancements are special provisions provided by SAP and
implemented by customer
- Enhancements hang like hook to standard SAP
- Types of Enhancements :
- Customer Exit (implemented thru function modules)
- User Exit ( implemented thru subroutines)
- BTEs ( implemented thru function modules)
- BAdI (implemented thru methods)
- Program Exit :
- is also called as Program Enhancement (or) Function exit (or)
Function module exit
- without changing built-in program, customer can add their code is
called as program exit
- it is implemented by includes and function module
- every program exit behind one function module is available
- all exit function modules are part of exit function group
- Implementing enhancement :
- execute tcode : CMOD
- specify project name begins with Y or Z
- click on create
- provide short description
- save as local object
- click on enhancement assignments
- specify enhancement, save
- click on components
- test enhancement
****************
Menu Exit : is also called menu enhancement
adding custom menu item to SAP permission provided
Status
where ever SAP developer wish to provide permission,
they defined menu with function code + symbol
Demo :
Business Requirement : adding custom menu item to ABAP editor
program screen concern environment menu
click on create
specify short description
click on enhancement assignment
specify enhancement as SEUED001
save
click on components
switch to change mode
double click on function code +PGE
specify corresponding text as ABAP Dictionary
click on copy, continue with request
******************************************************************
Screen Exit : is also called screen enhancement
with out changing standard SAP screen, customer can
add additional fields to SAP screen
Where ever SAP developer wish to give the permission ,
they defined empty sub screen area, they maintained call sub screen
statements both in PBO and PAI
- tcode : SE11 - open AUFK table and add 2 custom fields thru
append structure
- tcode : CMOD - create project, assign enhancement, click on
components
double click on 100 screen
specify screen type as sub screen and short
description
click on layout
click on dict/program fields button, add fields from
AUFK table
click on flow logic
save, continue with request
activate, back
- test enhancement
********************************************************************************
******************************
BAdI : Business Add-Ins
- is a object oriented enhancement technique
- implemented by global classes and methods
- BAdIs are widely used in SAP
- mainly in Enhancement
- reporting
- forms
- Difference between Customer Exit and BAdI
Customer Exit
- supports program, menu, screen, text enhancements
- are not reusable
- related transaction codes : SMOD & CMOD
- two layer architecture(SAP <- Customer)
- are not part of enhancement framework and switch frame work
- user can't create customer exit
BAdI
- supports program, menu, screen enhancements (but text
enhancement not possible)
- are reusable
- related transaction codes : SE18 & SE19
- multi layer architecture(SAP <- customer / industry solutions /
business partner )
- are part of enhancement framework and switch frame work
- user can create customer badi
- BAdIs are used without changing standard SAP , customer can add
additional business functionality to SAP
- BAdIs can be classified as
- Classic BAdI
- is old BAdI, valid till 4.7 version
- can be searched using string "cl_exithandler=>get_instance"
- is not a part of Enhancement framework
- system generates adopter class
- Kernel-based BAdI
- is new BAdI, valid from ECC 5.0 onwards
- can be searched using string "call badi"
- is a part of Enhancement framework
- system doesn't generates adopter class
- BAdI Builder :
is used to define and implement BAdI
is a utility tool which is integrated with ABAP Workbench
- test enhancement
- it performs 2 operations
- it calls and controls all active implementations
- it perform filter
- all classic badis are now migrated to enhancement spot
- Type :
if with in SAP checkbox is activated, then this badi is used for
internal use
if multiple use checkbox is activated, then this badi can have
multiple implementations
otherwise single implementation is possible
menu enhancement related badis are not reusable
*--------------------------------------------------------------------------*
- Demo :
Menu Enhancement thru Classic BAdI :
- Business requirement :
adding custom menu items to FBL3N tcode
FBL3N - G/L line item display
- tcode concern ALV output screen concern Extras menu
have some menu exit
- search criteria :
tcode behind program : RFITEMGL
package : FREP
BAdI name : FI_ITEMS_MENUE01
Method name : List_item01 to 04
- Implementation :
execute tcode : SE19
specify classic BAdI name
click on create implementation
specify badi implementation name begins with Y or Z
continue
specify short description
- Test implementation
step3 : Activate the processing of your own data with the method
CHECK_ADD_ON_ACTIVE of the Business Add-In
CUSTOMER_ADD_DATA.
************************************************
Exploring New BAdI :
New BAdIs are defined for Enhancement Spot
Enhancement Spot name and BAdI name may be same (or) different
doesn't generate Adopter class
this is badi is generated in Kernel ( application layer )
fall back class : is nothing but default implementation
New BAdIs are implemented thru Enhancement Implementation
*- Enhancement Framework :
- introduced from ECC 5.0 onwards
- it comes along with built-in enhancement spot , enhancement
points, enhancement options,new badis
- Enhancement Spot :
- is used to define explicit enhancement points
- is used to define explicit enhancement sections
- is used to define new badis
- not possible
implicit enhancement spot
implicit enhancement sections
steps :
- open built-in program in display mode
- click on spiral button
- edit menu -> enhancement operations -> show implicit
enhancement points
- as a result , system enables special double quoted line
- place the cursor on double quoted line -> right click -> create
enhancement implement
- create new implementation, save as local object
- specify your code between enhancement....endenhancement
- finally activate
- Ex : date_to_day
- User Exit :
- are part of modification, because it is implemented with the help of
Access Key
- are special provisions provided by SAP and implemented by user
(Enhancement)
- are implemented thru subroutines (procedural enhancement)
- are under special includes FZZ
- mainly used in SAP SD module
- user exit consist of empty subroutine
- perform statement written by SAP developer only
-----------------------------------------------------
WebDynpro : web based screen programming
dynpro : screen
pre-requisite knowledge :
- Classic ABAP
- Module pool program
- OOABAP
- Introduction
- Controllers
- UI Elements
- data binding
- Context Mapping
- OTR & Messages
- Context Programming
- F4 help
- ALV Report
- Portal Integration
- Adobe Forms integration
- MVC paradigm
View - user interaction area
Controller - accepts user input / accepts result database
Model - business logic ( in turn connected with underlying
database)
*---------------------------------------------------------*
What is Web Dynpro?
- Web Dynpro is a programming model provided by SAP.
- Web Dynpro is implemented in Java and ABAP.
- It is suited to generate standardized user interfaces (UIs)
using a declarative approach, resulting in a minimum time
effort to realize Web applications.
- Web Dynpro is the technology SAP uses for developing all
future applications
********************************************************************
Context stores the data at runtime.
Context life time is , as long as component is running - context
holds the data.
Singleton : if the property is set as true , only one child instance can
be generated at runtime
it is Boolean property effects the relationship between a
dependent and its parent node
singleton = false ( non singleton )
singleton = true ( singleton )
Supply Function :
- it is a mechanism for repopulating child nodes.
- it is useful particularly when using singleton nodes
******************************
View controller consist of Layout tab
using Layout tab we can design layout as per requirement
All the possible UI elements are listed in the Layout
using drag and drop we can design layout
Layout : All container elements and its children are arranged in layout
in different ways
*****************************************
Each Dynpro Controller is a separate ABAP Class
wddopostprocessing()
-> validates cross components
-> last controller method processed before the UI is
sent to the client
User defined all methods are public and used by other controller of the
same component
Standard Attributes :
wd_this : self reference to controller interface ( like ME )
used to access standard WD functions like validation
- place the cursor on webdynpro component -> right click -> create
view
- specify view name (as view1)
- continue
- click on layout tab of view1
- drag and drop caption ( specify name and element as caption )
- continue
- speicfy text as ( welcome to webdynpro ) in the attributes window
- activate view1
- embed view1 into window1
- finally activate webdynpro component
- place the cursor on webdynpro component
- right click
- create webdynpro application ( as zwda_component1 )
- save application
- place the cursor on webdynpro application ->right click
- test
- view the result in browser
*------------------------------------------------------------------------------*
Demo2 : Navigating between Views
- Create web dynpro component ( window name : main ), Activate
Web Dynpro component
- create result_view :
specify inbound plug as : in_default
outbound plug as : out_back
go to layout tab
insert text_view( specify text- Second View)
insert button (specify name and onaction event,
choose outbound plug as out_back)
- context tab : drag and drop from right side to left side
- create view2
create label ( Entered name was)
context tab : drag and drop context from component controller
layout tab : bind name to input field
- finally activate view1 & view2
- embed view1 & view2 to window main
- create navigation link
- create WD Application & test
*-----------------------------------------------------------------------*
Demo4 : using Context Mapping & data binding:
( one view user enters values, second view displays user entered
values )
Go to Layout
create element group , specify caption
right click on group -> create container form -> click on context ->
select fields to display -> continue
Activate View1
activate view2
*-------------------------------------------------------------------*
Demo4 : Accept name from one view and display in other view
create WD component
*---------------------------------------------------------------------*
Demo5 : Displaying database table data on final output
using internal table
* data declaration *
data : node_sflight type ref to if_wd_context_node,
itab type table of sflight.