Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Narrow casting

Hi,

i done coding for narrow casting but iam not getting proper output.can you please explain the narrow casting using below code.

class c1 definition.

public section.

methods : m1.

endclass.

class c1 implementation.

method m1.

data m1 type i value 2.

write:/ m1.

endmethod.

endclass.

class c2 definition inheriting from c1.

public section .

methods m2.

endclass.

class c2 implementation.

method m2.

data m2 type i value 3.

write:/ m2.

endmethod.

endclass.

start-of-selection.

data obj type ref to c1.

data obj1 type ref to c2.

CREATE object obj1.

obj = obj1.

call method obj1->m2.

Regards,

Suresh

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question