F ME Keyword in OOABAP | CodeTheta

ME Keyword in OOABAP

June 26, 2024

It refers to the current object in execution. It is just an alias name for the current object.

Demo Program
CLASS cl_main DEFINITION.
  PUBLIC SECTION.
    DATA: num  TYPE i.
    METHODS: setdata,
             display.
ENDCLASS.

CLASS cl_main IMPLEMENTATION.

  METHOD setdata.
    me->num = 20.
  ENDMETHOD.

  METHOD display.
    WRITE:/ num.
  ENDMETHOD.

ENDCLASS.

DATA: ob TYPE REF TO cl_main.

START-OF-SELECTION.
  CREATE OBJECT ob.
  CALL METHOD ob->setdata.
  CALL METHOD ob->display.

IDE Used To Test This Code : SAP ABAP Editor.

Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.

Post a Comment