Google Search - Blog...........

ABAP - OOPS: Instance Constructors Having Import Parameters In Method Programming.

REPORT YSUBOOPS2.

CLASS c1 DEFINITION.
PUBLIC SECTION.
METHODS : CONSTRUCTOR importing today type d.
ENDCLASS.

CLASS C1 IMPLEMENTATION.
METHOD constructor.
Write:/5 'Today is : ' , today dd/mm/yyyy.
ENDMETHOD.
ENDCLASS.
*************** main program **************
START-OF-SELECTION.
DATA: obj1 TYPE REF TO c1.
CREATE OBJECT: obj1 exporting today = sy-datum.


Output:

Today is 08.04.2004

No comments:

Post a Comment