Search

Loading

Monday, December 17, 2012

create simple ABAP class into abap program


The simple ABAP program writes to screen from simple ABAP class method:


program ztest_class.

*--------------------------------------------------------------------
*  www.developerpages.gr
*--------------------------------------------------------------------

class myfirstclass DEFINITION FINAL.
  PUBLIC SECTION.
    methods hello_world.
ENDCLASS.

CLASS myfirstclass implementation.
  METHOD hello_world.
    write :/ 'Hello world from simple ABAP class !'.
  ENDMETHOD.

ENDCLASS.

data : my_hello TYPE REF TO myfirstclass.


START-OF-SELECTION.

* create object
CREATE OBJECT my_hello.

* Call method hello_world
CALL METHOD my_hello->hello_world.

1 comment: