Skip to Content
0
Former Member
Mar 24, 2009 at 10:29 AM

protected components

32 Views

Dear Experts,

1)

in this below shown example.

zcl_worker_as_doc is a global class and zinherit

is lokal class.

check_existence is a protected method of zcl_worker_as_doc

How can I call in this case zinherit's method

m2.

2)

Is this the common way to access classes protected

methods generally

DATA lv_matnr TYPE mara-matnr.
DATA ls_quee TYPE zdms_queue.

*----------------------------------------------------------------------*
*       CLASS zinherit DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*

CLASS zinherit DEFINITION INHERITING FROM zcl_worker_as_doc.
  PUBLIC SECTION.
    METHODS m2.
ENDCLASS.                    "zinherit DEFINITION

*----------------------------------------------------------------------*
*       CLASS zinherit IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS zinherit IMPLEMENTATION.

  METHOD m2.
    DATA lv_kl TYPE REF TO zinherit.

    CALL METHOD lv_kl->check_existence
  EXPORTING
    i_zdms_queue = ls_quee
  IMPORTING
    e_ref        = lv_matnr.
  ENDMETHOD.                    "m2

ENDCLASS.                    "zinherit IMPLEMENTATION

DATA lcl TYPE REF TO zinherit.