Sie sind auf Seite 1von 1

METHODS IN ABAP- OO 1. OO CLASS METHOD: a) They can access all the attributes of a class. b) Methods have parameters (Signature).

c) IMPORTING, EXPORTING, CHANGING, RETURNING, EXCEPTIONS, RAISING d) Syntax: IMPORTING var Type type, RETURNING VALUE (var) TYPE type, EXCEPTIONS exception RAISING class exception e) Public Method can be called from anywhere; Private Methods can be called only within the class. f) Instance Methods can use both static and instance attributes and can be called using an instance. They are called using CALL METHOD refvar->instancemethod. You can access instance attributes using <instance>-><instance_attribute>. g) Static Methods also called as class methods can only use static components and can be called using a class. They are called using CALL METHOD classname => classmethod. If you are calling a static method from within the class, you can omit the class name. You can access static attributes using <classname>=><class_attribute> h) => and -> are the component selectors. i) Functional Methods: Methods that have a RETURNING parameter are described as functional methods. These methods cannot have EXPORTING or CHANGING parameters, but has many (or as few) IMPORTING parameters and exceptions as required. You can only do this for a single parameter, which additionally must be passed as a value.

Das könnte Ihnen auch gefallen