Steps:
- Go to Transaction code SE24.
- Pop-up will appear.
- Enter the short description and click on the SAVE button.
- Save it in either Package or Local Package name.
- Initial Class Interface screen looks like.
- Enter the method name.
- Click on Level.
- M1 method is known as instance public method.
- M2 method is known as static public method.
- M3 method is known as instance protected method.
- M4 method is known as static protected method.
- M5 method is known as instance private method.
- M6 method is known as static private method.
- Double click on M1 method.
- Implement the method M1.
- Click on Save and click on the back button.
- Double click on M3 method.
- Implement the method M3.
- Click on Save and Click on back button.
- Double click on M4 method.
To known Visibility of the methods
- Go to transaction code : SE38.
- Enter the program name which start's with Y or Z<program name > and click on create button.
- Enter the title.
- Select the attribute type as : Executable program.
- Click on Save button.
- Save it in either Local Package or Package.
- Declare the object.
- Create the object.
- We can call Global method , click on pattern.
DATA : OBJ TYPE REF TO ZCL_CLASS_METHOD.
START-OF-SELECTION.
CREATE OBJECT OBJ.
CALL METHOD OBJ->M1
.
CALL METHOD ZCL_CLASS_METHOD=>M2.
- Click on Execute ( F8).
No comments:
Post a Comment