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: 

CREATE_DATA_UNKNOWN_TYPE runtime error : CREATE_DATA used but created with CREATE OBJECT instead

sankar1781
Participant
0 Kudos

Hi Experts,

Apologize if I am not followed other help threads to resolve my issue.

The issue is happening from a customized program where the data is moving from Open text to SAP (method logic is provided for your reference) and below is the Error analysis.

Error analysis

An exception has occurred in class "CX_SY_CREATE_DATA_ERROR". This exception

was not caught

in procedure "IF_EX_ACC_DOCUMENT~CHANGE" "(METHOD)" or propagated by a RAISING

clause.

Since the caller of the procedure could not have anticipated this

exception, the current program was terminated.

The reason for the exception occurring was:

The reason for the exception is:

The type specified dynamically in CREATE DATA ("ACCOUNTPAYABLE") is not a

valid data

type.

The above error was raised from the below highlighted area as '====>'. Only part of the code is shared here.

METHOD if_ex_acc_document~change .

DATA: wa_extension TYPE bapiparex,
ext_value(960) TYPE c,
wa_accit TYPE accit,
l_ref TYPE REF TO data.

FIELD-SYMBOLS: <l_struc> TYPE any,
<l_field> TYPE any.

SORT c_extension BY structure.

LOOP AT c_extension INTO wa_extension.
AT NEW structure.
===> CREATE DATA l_ref TYPE (wa_extension-structure).
ASSIGN l_ref->* TO <l_struc>.
ENDAT.

ENDLOOP.

Other help threads are related to standard and no direct or manual solution was provided other than applying or referring a SAP Note.

So, I need your help how to correct this error?

Thanks.

1 ACCEPTED SOLUTION

sankar1781
Participant
0 Kudos

Hi Sandra,

Thanks a lot again for your quick and continuous help.

FYI, C_EXTENSION2 Changing Type BAPIPAREX_TAB_AC is declared. And, it leads to him only ACCOUNTPAYABLE field was called.

I will look otherwise will add the TRY CATCH to avoid the dump.

Thanks again.

2 REPLIES 2

Sandra_Rossi
Active Contributor

I have no idea why C_EXTENSION contains an invalid DDIC structure (obviously CREATE DATA fails because "ACCOUNTPAYABLE" is not a DDIC type).

You can fix your custom programs to pass an existing DDIC type instead of ACCOUNTPAYABLE.

Or you can skip CREATE DATA ... and rest of code without doing a short dump.

try.
    CREATE DATA l_ref TYPE (wa_extension-structure).
  catch CX_SY_CREATE_DATA_ERROR.
    CONTINUE.
endtry.

sankar1781
Participant
0 Kudos

Hi Sandra,

Thanks a lot again for your quick and continuous help.

FYI, C_EXTENSION2 Changing Type BAPIPAREX_TAB_AC is declared. And, it leads to him only ACCOUNTPAYABLE field was called.

I will look otherwise will add the TRY CATCH to avoid the dump.

Thanks again.