0% found this document useful (0 votes)
8 views

Object Oriented Programming & System - ABAP

Uploaded by

aartikvsd1079
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Object Oriented Programming & System - ABAP

Uploaded by

aartikvsd1079
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Object Oriented Programming &

System - ABAP
Subtitle
CLASS :
• Cl a s s i s a c ol l e c t i on of c om pone nts /Obj e c ts ( Att ri bute s + m e thods + e v e nts +
i nterfa c e s + a l i a se s + m a c ros ) .

• W he ne v e r we c re a te a ny Cl a ss -> i t ’ s doe sn’ t a l l oc a t e a ny m em ory , A c l a s s c a n onl y


prov i de the te m pl a t e of c om pone nts.

• Local class: i t i s c re a t ed i n ( se 3 8 ) -> Loc a l t o the re port .

• Global class: i t i s c re a t ed i n ( c l a ss bui l de r - > se 2 4 ) -> G l oba l to a l l Obj e c t .

• Instance Attribute: A ny thi ng whi c h i s de c l a re usi ng D ATA ke y word i s c a l l e d


I nsta nc e Att ri bute .

• Static Attribute : A ny t hi ng whi c h i s de c l a re usi ng C L A SS- D ATA ke y word i s c a l l e d


Sta ti c At tri bute .
CLASS :
• Constant : A ny t hi ng whi c h i s de c l a re usi ng C o nst an t ke y word i s c a l l e d Cons ta nt
Attri but e .

• PUBLIC: Publ i c components can be access anywhere (it can be access within the
class or outside of the class ).

• Private: Publ i c c o m p o n e n t s c a n b e a c c e s s a n y w h e re ( i t c a n b e a c c e s s w i t h i n t h e c l a s s o r
outside of the class ).

• Protected: Publ i c c o m p o n e n t s c a n b e a c c e s s a n y w h e re ( i t c a n b e a c c e s s w i t h i n t h e c l a s s
or outside of the class ).
Example …
• CLASS TEST DEFINITION.

PUBLIC SECTION .
DATA : X TYPE I. " INSTANCE ATTRIBUTE..

CLASS-DATA Y TYPE I. "STATIC ATTRIBUTE ..

CONSTANTS Z TYPE I value 10 . "CONSTANT VARIABLE ..


ENDCLASS.
example
Title Slide 5

EXAMPLE
INSTANTIATION OF CLASS
• DATA OBJ1 TYPE REF TO TEST." refe
rence-alias for class ..
1. D e cl ar e r e fe r e n ce .
• CREATE OBJECT OBJ1. " object-
• Da t a Obj 1 t y pe re f to e m p. allocate memory for instance Attribut
e ..
2. C r e at e o bj e ct base d o n
OBJ1->X = 1000.
r e fe r e n ce
OBJ1->Y = 2000.
OBJ1>Z = 333000." SYNTAX ERROR BECAUS
• Cre a te Obj e c t Obj 1 .
E OF CONSTANT VALUE ...

• WRITE :/ OBJ1->X,
OBJ1->Y,
OBJ1->Z.
Diff erences:

STATIC CONSTANT
• St a ti c c a n be m odi fi e d. • Cons ta nt c a n not m odi fi e d.

• I t c a n be c ha nge d • We c a n not c ha nge.


Important Question
1. Wh y me t h o d i s fast e r t h an fu nc t i o n mo du l e (pe r fo r man ce wi se ) ?

 A s we know, Func t i on M odul e store i n Func ti on G roup. W he ne v e r we c a l l a ny func t i on


modul e ( R EUSE_ A LV _ G R I D_ DI SPL AY) the re st of t he func ti on m odul e s i n tha t func t i on
group  ge t l oa de d i nt o the m e m ory ( F. M ’ s + da t a de c l a ra ti on) .

 W he ne v e r we c a l l ( CA L L M ETH OD)  onl y t ha t m e t hod l oa de d i n m e m ory . So tha t


perf orm a nc e wi se CA L L M ETH OD i s f a ste r t ha n F UN CTI ON M ODUL E.

You might also like