SAP Tutorials Blog


 

 


Report ZINHERITAN_1. 

CLASS Parent Definition. 

PUBLIC Section. 

Data: w_public(25) Value 'This is public data'. 

Methods: ParentM. 

ENDCLASS. 


CLASS Child Definition Inheriting From Parent. 

PUBLIC Section. 

Methods: ChildM. 

ENDCLASS. 


CLASS Parent Implementation. 

Method ParentM. 

Write /: w_public. 

EndMethod. ENDCLASS. 


CLASS Child Implementation. 

Method ChildM. 

Skip. 

Write /: 'Method in child class', w_public.

EndMethod. 

ENDCLASS. 


Start-of-selection. 

Data: Parent Type Ref To Parent, 

Child Type Ref To Child. 

Create Object: Parent, Child. 

Call Method: Parent→ParentM, 

child→ChildM.


Serkan AKKAVAK

Computer Engineer BSc

Head of SAP & Software Department

Contact : serkurumsal@yandex.com