cancel
Showing results for 
Search instead for 
Did you mean: 

NEW with dynamic typing

Former Member
0 Kudos

Hi gurus,

I was wondering if it was possible to use the new syntax for object creation with dynamic typing.

thus the old statement where iv_classname is a text.


DATA: lo_next TYPE REF TO object.

CREATE OBJECT lo_next TYPE (iv_classname).

This cannot become something like this:


DATA(lo_next) = NEW (iv_classname).

Is this possible?

Kind regards,

Wim

Accepted Solutions (0)

Answers (1)

Answers (1)

custodio_deoliveira
Active Contributor

Hi Wim,

The help says:

  • The operator NEW works in the same way as the statement CREATE OBJECT oref TYPE class, where oref stands for the result that points to the new object. The result is an object reference variable of the static type class.

So I'd say, no, you can't do it.

Cheers,

Custodio