Me dá el error
STATEMENT IS NOT ACCESSIBLE
en la linea de CREATE OBJECT
Alguien me puede decir porque ???
MUchas gracias
CLASS pablo DEFINITION.
PUBLIC SECTION.
METHODS: get_cont EXPORTING value(val) TYPE i,
inc_cont,
set_cont IMPORTING value(val) TYPE i.
PRIVATE SECTION.
DATA: cont TYPE i.
ENDCLASS. "pablo
*----------------------------------------------------------------------*
* CLASS cont IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS pablo IMPLEMENTATION.
METHOD get_cont.
val = cont.
ENDMETHOD. "get_cont
METHOD inc_cont.
ADD 1 TO cont.
ENDMETHOD. "inc_cont
METHOD set_cont.
cont = val.
ENDMETHOD. "set_cont
ENDCLASS. "pablo IMPLEMENTATION
break abap.
DATA: obj TYPE REF TO pablo.
DATA: i TYPE i VALUE 0.
CREATE OBJECT obj.
CALL METHOD obj->set_cont
EXPORTING
val = i.
DO 5 TIMES.
CALL METHOD obj->inc_cont.
ENDDO.
CALL METHOD obj->get_cont
IMPORTING
i = val.
WRITE /i.
STATEMENT IS NOT ACCESSIBLE
en la linea de CREATE OBJECT
Alguien me puede decir porque ???
MUchas gracias
CLASS pablo DEFINITION.
PUBLIC SECTION.
METHODS: get_cont EXPORTING value(val) TYPE i,
inc_cont,
set_cont IMPORTING value(val) TYPE i.
PRIVATE SECTION.
DATA: cont TYPE i.
ENDCLASS. "pablo
*----------------------------------------------------------------------*
* CLASS cont IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS pablo IMPLEMENTATION.
METHOD get_cont.
val = cont.
ENDMETHOD. "get_cont
METHOD inc_cont.
ADD 1 TO cont.
ENDMETHOD. "inc_cont
METHOD set_cont.
cont = val.
ENDMETHOD. "set_cont
ENDCLASS. "pablo IMPLEMENTATION
break abap.
DATA: obj TYPE REF TO pablo.
DATA: i TYPE i VALUE 0.
CREATE OBJECT obj.
CALL METHOD obj->set_cont
EXPORTING
val = i.
DO 5 TIMES.
CALL METHOD obj->inc_cont.
ENDDO.
CALL METHOD obj->get_cont
IMPORTING
i = val.
WRITE /i.
Comentario