on 02-09-2012 1:14 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joshi,
I applied that before. It resolves only the problem of generating getter and setter for fields created EEWB and AET. My problem is different from this.
Hi Andrei,
I tell you what i did exactly;
Firstly, I created a Z field with AET. The name of field is ZZAFLD000008.
Secondly, I extended SRQM_INCIDENT_S's IncidentSRL view.
After second step there is no problem I can use view wthout any problem.
Thirdly, I generated getter and setter of ZZAFLD000008.
After third step I get 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 "
Then my intention is adding a Z field and change its value when listing service request.
Thanks
Ümit Yılmaz
Complete error message
Cannot display view SRQM_INCIDENT_S/IncidentSRL of UI Component SRQM_INCIDENT_S
An exception has occurred Exception Class 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
Method: CL_BSP_PAGE_BASE=>IF_BSP_PAGE~SET_ATTRIBUTE
Source Text Row: 24
Source code line;
method IF_BSP_PAGE~SET_ATTRIBUTE .
* uses ****************************************************************
* data ****************************************************************
data: valtype.
field-symbols: <value> type any.
* code ****************************************************************
translate name to upper case. "#EC NOTEXT
assign me->(name) to <value>.
if sy-subrc <> 0.
raise exception type cx_bsp_inv_attr_name
exporting name = name.
endif.
describe field value type valtype.
if valtype = 'r' or
valtype = 'l'.
<value> ?= value.
else.
<value> = value.
endif.
endmethod.
The above method is standard method, I think I did something wrong or incomplete.
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.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.