*&---------------------------------------------------------------------*
*& Report YSAP_ME_IN_METHODS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ysap_me_in_methods.
TABLES: pa0002.
*----------------------------------------------------------------------*
* CLASS class1 DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS class1 DEFINITION.
PUBLIC SECTION.
DATA: pernr TYPE pa0002-pernr VALUE '00000001'.
METHODS: method1.
ENDCLASS. "class1 DEFINITION
*----------------------------------------------------------------------*
* CLASS class1 IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS class1 IMPLEMENTATION.
METHOD method1.
DATA: pernr TYPE pa0002-pernr VALUE '00000002'.
WRITE: / 'the value from definition part', me->pernr COLOR 5,
/ 'the value from implementation part' , pernr COLOR 6.
ENDMETHOD. "method1
ENDCLASS. "class1 IMPLEMENTATION
START-OF-SELECTION.
DATA: pernr TYPE pa0002-pernr.
DATA: object1 TYPE REF TO class1.
CREATE OBJECT object1.
CALL METHOD object1->method1.
Output
*& Report YSAP_ME_IN_METHODS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ysap_me_in_methods.
TABLES: pa0002.
*----------------------------------------------------------------------*
* CLASS class1 DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS class1 DEFINITION.
PUBLIC SECTION.
DATA: pernr TYPE pa0002-pernr VALUE '00000001'.
METHODS: method1.
ENDCLASS. "class1 DEFINITION
*----------------------------------------------------------------------*
* CLASS class1 IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS class1 IMPLEMENTATION.
METHOD method1.
DATA: pernr TYPE pa0002-pernr VALUE '00000002'.
WRITE: / 'the value from definition part', me->pernr COLOR 5,
/ 'the value from implementation part' , pernr COLOR 6.
ENDMETHOD. "method1
ENDCLASS. "class1 IMPLEMENTATION
START-OF-SELECTION.
DATA: pernr TYPE pa0002-pernr.
DATA: object1 TYPE REF TO class1.
CREATE OBJECT object1.
CALL METHOD object1->method1.
Output
No comments:
Post a Comment