I have an internal table filled with the type reference for the objects I want to create, like so (first line is the header of internal table ITAB):
+==========+===============+
| OBJ_TYPE | OBJ_CLASS_REF |
+==========+===============+
| TYPE1 | ZCL_CLASS1 |
|----------|---------------|
| TYPE2 | ZCL_CLASS2 |
+----------+---------------+
What I would like to do in my program is this (I put line numbers):
1 LOOP AT itab
2 "Concatenate LO_ and the value of ITAB-OBJ_TYPE
3 CONCATENATE 'LO_' itab-obj_type INTO v_obj_name.
4 "Create a reference object
5 CREATE DATA (v_obj_name) TYPE REF TO itab-obj_type.
6 CREATE OBJECT (v_obj_name).
7 ENDLOOP
How do I successfully do lines 5 and 6?