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

Casting error ABAP dump...

Former Member
0 Likes
1,204

Hello, I am getting issue when casting is done. I get a ABAP dump. In the constructor of call following code is there. I get dump during "refCX_SubRC ?= Imp_ExcObj_Ref. "" object casting"

IF EXC_CLASS_NAME CS 'ZCX_AL_SUBRC'.

refCX_SubRC ?= Imp_ExcObj_Ref. "" object casting

tp_app_log-subobject = CO_LOG_SUBOBJ_AL.

ENDIF.

It says, "A cast operation tried to assign a object or interface variable to a refernce variable. However the contents of the source variable do not fir the target.

Source type, "\PROGRAM=Y4MIG_DIT\CLASS=ZCX_AL_SUBRC"

Target Type, "CLASS=ZCX_AL_SUBRC".

Regards,

Jainam

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
736

Hi.

Please try.

TRY.

  • It is Cast here.

refCX_SubRC ?= Imp_ExcObj_Ref. "" object casting

CATCH CX_SALV_MSG INTO GCL_ROOT. "#EC NO_HANDLER

ENDTRY.

3 REPLIES 3
Read only

Former Member
0 Likes
737

Hi.

Please try.

TRY.

  • It is Cast here.

refCX_SubRC ?= Imp_ExcObj_Ref. "" object casting

CATCH CX_SALV_MSG INTO GCL_ROOT. "#EC NO_HANDLER

ENDTRY.

Read only

0 Likes
736

Please help as how can I avoid this casting error ?

Read only

0 Likes
736

In information only on this, it doesn't understand.

Do when the error message is acquired and analyzed?

catch cx_salv_msg into gcl_root. "#EC NO_HANDLER

v_msg = gcl_root->get_text( ).

write:/001 v_msg. "<---