Application Development and Automation 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: 
Read only

CREATE_OBJECT_CLASS_NOT_FOUND by CREATE-TYPE field name

former_member1161170
Participant
0 Likes
1,343

Hello to everyone.

It's faster to put the code before to explain:

REPORT  Zmassimiliano LINE-SIZE 356 NO STANDARD PAGE HEADING.

CLASS cl_ZPP15 DEFINITION.

 PUBLIC SECTION.
    METHODS constructor.

ENDCLASS. "cl_ZPP15

*---------------------------------------------------------------------*
*       Classe figlio implementazione: ZPP15 (Etichettatrice)
*---------------------------------------------------------------------*
CLASS cl_ZPP15 IMPLEMENTATION.

  METHOD constructor.
    WRITE 'CIAO'.
  ENDMETHOD.

ENDCLASS. "cl_ZPP15

DATA:  ro_zpp TYPE REF TO object,
       ro_zpp15 TYPE REF TO cl_ZPP15,
       wa_zmaildef TYPE zmail_def.

*---------------------------------------------------------
START-OF-SELECTION.

      wa_zmaildef-cc = 'cl_ZPP15'.

*      CREATE OBJECT ro_zpp15.   " Works fine

*      CREATE OBJECT ro_zpp TYPE cl_ZPP15.   " Works fine

       CREATE OBJECT ro_zpp TYPE (wa_zmaildef-cc). " DOESN'T WORK !!!

      FREE ro_zpp.

The first and the second "CREATE OBJECT" work fine, the third give me the error "CREATE_OBJECT_CLASS_NOT_FOUND - CREATE OBJECT: The class "cl_ZPP15" was not found".

It recognizes the field value "cl_ZPP15" and looks for this class (declared just above) but it can't find it.

What am I doing wrong? The statement "CREATE OBJECT ro_zpp TYPE cl_ZPP15." works fine: isn't this the same thing?

1 ACCEPTED SOLUTION
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
1,288

Hello massimiliano2.beghini

Try replacing

wa_zmaildef-cc = 'cl_ZPP15'.

with

wa_zmaildef-cc = 'CL_ZPP15'.

Best regards

Dominik Tylczynski

2 REPLIES 2
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
1,289

Hello massimiliano2.beghini

Try replacing

wa_zmaildef-cc = 'cl_ZPP15'.

with

wa_zmaildef-cc = 'CL_ZPP15'.

Best regards

Dominik Tylczynski

Read only

1,288

GREAT!!!

Thank you very much.

Problem solved.