Monday, 25 July 2016

Local Class : Creation of Constructor



  • Go to Transaction code SE38.
  • Enter the Program name which start's with Y or Z< program name > and click on create.
  • Enter the Title.
  • Select the Attribute Type as Executable Program.
  • Click on Save.



  •  Save it in either Local Package or Package.
  • Class Definition.
  • Class Implementation.
  • Main Program.


Source Code


Class C1 Definition.

      Public Section.

      methods : CONSTRUCTOR.
      Class-methods : Class_CONSTRUCTOR.

     Protected Section.


     Private Section.

EndClass.


Class C1 Implementation.

Method CONSTRUCTOR.


write : /  'Am Instance Constructor'.


EndClass.


Method Class_CONSTRUCTOR.

write : /  'Am Static Constructor'.

EndMethod.

EndClass,


DATA : obj Type ref to C1.


start-of-selection.

CREATE OBJECT OBJ.



  • Save -> Check -> Activate.
  • Execute.




No comments:

Post a Comment