2019 Aug 15 7:00 AM
Hi!
I would like to create an abstract class dynamically.
I can instantiate a public class via:
data: lva_object type ref to zif_class,
lva_type type string value 'ZCL_CLASS'.
create object lva_object type (lva_type).
But how do i do that if i have a abstract class?
For example i have a interface:
ZIF_ABSTRACT_INTERFACE.
From this interface i made a class:
ZCL_ABSTRACT_CLASS.
And if i have an object:
data:
lva_abstract_object type ref to zif_abstract_interface,
lva_abstract_type type string value 'ZCL_ABSTRACT_CLASS'.
How do i assign this type dynamically to the class variable?
2019 Aug 15 7:35 AM
You cannot create instances of an abstract class, this is a key part of the concept. Only concrete subclasses derived from ZCL_ABSTRACT_CLASS can be instantiated.
2019 Aug 15 7:35 AM
You cannot create instances of an abstract class, this is a key part of the concept. Only concrete subclasses derived from ZCL_ABSTRACT_CLASS can be instantiated.