cancel
Showing results for 
Search instead for 
Did you mean: 

List must contain AbstractList (ProxyList) of Type {0}, not of {1}!

former_member212767
Participant
0 Kudos

Hi,

After creating the model and calling it I get error like this:

java.lang.ClassCastException: com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCException: List must contain AbstractList (ProxyList) of Type , not of !

Here's the code:

StringTokenizer tok = new StringTokenizer(abapCode, "n");Zselect.Zselect_List selectList = new Zselect.Zselect_List();while (tok.hasMoreTokens()) {	Zselect line = new Zselect();	line.setText(tok.nextToken().trim());	selectList.addZselect(line);}wdContext.nodeZ_Rfc_Fetch_Data_Input().currentZ_Rfc_Fetch_Data_InputElement().modelObject().setSelect(selectList); // this is the line it complains aboutwdContext.nodeZ_Rfc_Fetch_Data_Input().currentZ_Rfc_Fetch_Data_InputElement().modelObject().setColumn_Header(false);

This used to work in SP14, but since updating to SP15 I'm getting this error.

Any help appreciated!

Regards,

Jari Pakarinen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Jari,

Very strange, code looks ok and should work.

However, as a workaround you may try:


StringTokenizer tok = new StringTokenizer(abapCode, "n");
Z_Rfc_Fetch_Data_Input query = 
  wdContext
    .nodeZ_Rfc_Fetch_Data_Input()
      .currentZ_Rfc_Fetch_Data_InputElement()
        .modelObject();

while (tok.hasMoreTokens()) 
{
	Zselect line = new Zselect();
	line.setText(tok.nextToken().trim());
	query.addRelatedModelObject("Select", line);
}
query.setColumn_Header(false);

Does this version works for you?

VS

former_member212767
Participant
0 Kudos

Valery,

Same error after your changes.

This worked in SP14. Nothing else has changed.

Zselect_List extends com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCList

and DynamicRFCList extends com.sap.aii.proxy.framework.core.AbstractList

so everything should be ok here.

Do you know what the Type and mean here ?

Thanks,

Jari

Former Member
0 Kudos

Obviously,

-- is expected type (correct) -- type of argument given Both should be compatible (i.e. assignable to ). In your case they are not compatible. Seems that you are updating wrong relation (should be something other then "Select" / setSelect)

VS

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You are trying to set the "Select" not the "Select_List".

And also there is no need for model object at all to set the input paramters. Create an instance of the input elementm, bind it and then the set the input parameters.

Thanks and regards

RB

former_member212767
Participant
0 Kudos

Hi,

There's no method setSelect_List here. SetSelect takes AbstractList as its parameter.

I'll do the model thingy as you said

Thanks,

Jari

former_member212767
Participant
0 Kudos

Code again:


StringTokenizer tok = new StringTokenizer(abapCode, "n");
Zselect.Zselect_List selectList = new Zselect.Zselect_List();
while (tok.hasMoreTokens()) {
	Zselect line = new Zselect();
	line.setText(tok.nextToken().trim());
	selectList.addZselect(line);
}
wdContext.nodeZ_Rfc_Fetch_Data_Input().currentZ_Rfc_Fetch_Data_InputElement().modelObject().setSelect(selectList); // this is the line it complains about
wdContext.nodeZ_Rfc_Fetch_Data_Input().currentZ_Rfc_Fetch_Data_InputElement().modelObject().setColumn_Header(false);