Skip to Content
avatar image
Former Member

CX_SY_MOVE_CAST_ERROR - Source type CLASS=CL_SRQM_INC_INCIDENTSRL_CN00 is

Hi,

I added a Z field with AET. After adding AET field I generated Getter and Setter methods. After adding Getter and setter methods WEB UI started to give below error;

"CX_SY_MOVE_CAST_ERROR - Source type CLASS=CL_SRQM_INC_INCIDENTSRL_CN00 is not compatible, for the purposes of assignment, with target type CLASS=ZL_SRQM_INC_INCIDENTSRL_CN00 "

I know after generating Getter and Setter for Z fields, CL_SRQM_INC_INCIDENTSRL_CN00 now differs from ZL_SRQM_INC_INCIDENTSRL_CN00. I have copied super class of ZL_SRQM_INC_INCIDENTSRL_CN00, I changed class names from CL.. to ZL but it did not work.

How can i fix it up? Could someone help me? I need to use Getter and Setter methods of Z fields. What is your advice?

Best wishes,

Ümit Yılmaz

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Feb 09, 2012 at 02:11 PM

    Umit

    First thing u dont hv to copy super class. when u enhance it SAP automatically manage it everything. Just simply create Setter Getter method. It sud work.

    Add comment
    10|10000 characters needed characters exceeded

    • First of all put a break-point in this method (CL_BSP_PAGE_BASE=>IF_BSP_PAGE~SET_ATTRIBUTE). And check the call stack. You'll see from where it is called.

      Seems that for some reason you (or generated code in Z-class) call a SET-method.

      I've actually checked the component and it seems that this is search result view. If so you do not need to have SET-method at all because it's only a list and get-methods only are required.

  • Feb 11, 2012 at 04:46 PM

    Hi Umit,

    What is the super class of ZL_SRQM_INC_INCIDENTSRL_CN00?

    Give the class CL_SRQM_INC_INCIDENTSRL_CN00 as superclass.

    Regards,

    Leon

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I wrote the issue to SAP OSS. They sent me a solution, it was helpful but incomplete. I completed the solution. Solution is as the following;

      Go to class ZL_SRQM_INC_INCIDENTSRL_IMPL's method WD_CREATE_CONTEXT;

      Code of method should be like this;

      method WD_CREATE_CONTEXT.
      *   create the context
        super->wd_create_context( ).
      
        context = cl_bsp_wd_context=>get_instance(
                iv_controller = me
                iv_type = 'ZL_SRQM_INC_INCIDENTSRL_CTXT' ).
      
        typed_context ?= context.
        ztyped_context ?= context.
      
      endmethod.

  • avatar image
    Former Member
    Feb 23, 2012 at 08:47 AM

    Solution is

    go to class ZL_SRQM_INC_INCIDENTSRL_IMPL

    then go method WD_CREATE_CONTEXT

    correct the code as the following;

    method WD_CREATE_CONTEXT.

    • create the context

    super->wd_create_context( ).

    context = cl_bsp_wd_context=>get_instance(

    iv_controller = me

    iv_type = 'ZL_SRQM_INC_INCIDENTSRL_CTXT' ).

    typed_context ?= context.

    ztyped_context ?= context.

    • super->wd_create_context( ).

    • Added by wizard

    endmethod.

    Add comment
    10|10000 characters needed characters exceeded