Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i declare a type ref to a class that is determined dynamically

Former Member

Hello everyone,

How can i declare a type ref to the class that is determined dynamically? i.e, the class name is determined dynamically and i need to create a reference for that at runtime.

Thanks in advance,

Padma.

1 ACCEPTED SOLUTION

Former Member

Hi,

You can have something like this -

data class_name(30).
data objref type ref to object.

class_name = 'CL_GUI_ALV_GRID'.

create object objref type (class_name).

<b>objref</b> will not point to an inteance of the class CL_GUI_ALV_GRID.

Hope that's clear.

Regards,

Anand Mandalika.

1 REPLY 1

Former Member

Hi,

You can have something like this -

data class_name(30).
data objref type ref to object.

class_name = 'CL_GUI_ALV_GRID'.

create object objref type (class_name).

<b>objref</b> will not point to an inteance of the class CL_GUI_ALV_GRID.

Hope that's clear.

Regards,

Anand Mandalika.