06 abap objects - global classes & interfaces

11
© IBM Corporation 2013 IBM Global Business Services ABAP Objects – Advanced-Global Classes & Interfaces

Upload: bakkalibilal

Post on 24-Dec-2015

58 views

Category:

Documents


9 download

DESCRIPTION

06 ABAP Objects - Global Classes & Interfaces

TRANSCRIPT

Page 1: 06 ABAP Objects - Global Classes & Interfaces

© IBM Corporation 2013

IBM Global Business Services

ABAP Objects – Advanced-Global Classes & Interfaces

Page 2: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 20132 Jan-2007ABAP Objects - Advanced

ABAP Objects Advanced : Global classes and interfaces

Concept

Demonstrating How to create Global class.

Page 3: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 20133 Jan-2007ABAP Objects - Advanced

Global classes and interfaces : Concept

Global classes and interfaces are created and stored in class pool and interface pool like function pool (function group).

Global classes and interfaces are managed centrally and available to every program.

Custom Global classes and interfaces must begin with Y* or Z*.

Global and local classes and interfaces have the same components, and there is no difference in how they are used within programs.

Page 4: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 20134 Jan-2007ABAP Objects - Advanced

Global classes and interfaces : Concept (Contd.)

Global classes and interfaces are maintained via transaction SE24 or through transaction SE80.

Use Class Browser to view global classes and interfaces in the repository.

Page 5: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 20135 Jan-2007ABAP Objects - Advanced

Global classes and interfaces : Concept (Contd.)

Set Class Browser filters to select by object type, by relation ship etc.

Results are displayed in a hierarchy tree.

Page 6: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 20136 Jan-2007ABAP Objects - Advanced

Global classes and interfaces : Creating Global class

1. Go to transaction SE80 and choose Class/Interface and enter the name of your custom class or interface (name must start with Z* or Y*) and press enter.

2. In the Popup window choose yes.

3. Choose the Object type. Here Class is selected as object type.

1

2

3

Page 7: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 20137 Jan-2007ABAP Objects - Advanced

Global classes and interfaces : Creating Global class (Contd.)

4. In the next popup enter description and press SAVE button. Also check Usual ABAP class radio button is set

and Final check box is checked.

5. In the next popup enter package name and press save button. In our example $TMP is selected as a package.

4

5

Page 8: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 20138 Jan-2007ABAP Objects - Advanced

Global classes and interfaces : Creating Global class (Contd.)

6. Now double click on the class, it will then display the class builder, define attributes and methods for the class.

7. Double click on the method name to implement the method. It will invoke the code editor where you have to enter code for the method.

6

7

Page 9: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 20139 Jan-2007ABAP Objects - Advanced

Global classes and interfaces : Creating Global class (Contd.)

8. Activate the class.

9. Test the class.

10. Class components can include local

classes, methods, internal types, macros which are not visible out side the class pool.

8

99

10

Types

Local class

Macros

Page 10: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 201310 Jan-2007ABAP Objects - Advanced

Demonstration

Creating a Global Class using transaction SE24

Page 11: 06 ABAP Objects - Global Classes & Interfaces

IBM Global Business Services

© IBM Corporation 201311 Jan-2007ABAP Objects - Advanced

Practice

Creating a Global Class using transaction SE24