cancel
Showing results for 
Search instead for 
Did you mean: 

error calling method

Former Member
0 Kudos

Hi!

I'm trying to do that when the user clicks a cell in a table with item opens details of that item in another view, so i got 2 views and 1 controler and 2 rfcs, i'm new in webdynpros so help me with this tell me why this doesn't work and what the best way to do this.

in my first view(itens) i do this in a method that is called in the lead select...


String posnr = wdContext.nodeT_Zcrm_St_05().getT_Zcrm_St_05ElementAt(wdContext.nodeT_Zcrm_St_05().getLeadSelection()).getPosnr();
	String kunnr = wdContext.currentT_Zcrm_St_04Element().getKunnr();
	String vbeln = wdContext.currentT_Zcrm_St_04Element().getVbeln();
wdThis.wdGetDetPedidoCustController().executeDetItem(posnr,kunnr,vbeln);

when i call the method executeDetItem with this Strings a Conversion error comes but when i pass values in "" it goes ok...

wdThis.wdGetDetPedidoCustController().executeDetItem("000","0001000010","0000000001");

i already try to see if is the length but it is not... i raised the length and it goes ok with the method call above...

my method in the controller is like this


Z_Rfc_Detalhe_Item_Input inputItem = new Z_Rfc_Detalhe_Item_Input();
	wdContext.nodeDetalheItemNode().bind(inputItem);	
    
    inputItem.setI_Item(item);
	inputItem.setI_Cliente(cliente);
	inputItem.setI_Pedido(pedido);
	
	try{
		wdContext.currentDetalheItemNodeElement().modelObject().execute();
	}catch(Exception ex){
		ex.printStackTrace();
	}
	wdContext.nodeT_Zcrm_St_03().invalidate();
	wdContext.nodeT_Zcrm_St_06().invalidate();

thanks

Regards

Dalmo

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

What's the relation between

nodeT_Zcrm_St_05

T_Zcrm_St_04

T_Zcrm_St_03

T_Zcrm_St_06 and DetalheItemNode?

Is nodeT_Zcrm_St_05 the one connected to the table?

wdContext.currentT_Zcrm_St_04Element().getKunnr();?

Do you mean: wdContext.currentT_Zcrm_St_05Element().getKunnr(); ?

If you are going to invalidate anything, it should be DetalheItemNode i guess.

What's the error. Do you get stack-traces?

/Micke

Former Member
0 Kudos

Hi Löwgren,

I have two Models, DetalheItem and DetalhePedido.

The nodes T_Zcrm_St_03 and T_Zcrm_St_06 is subnode of output node from DetalheItemNode.

The nodes T_Zcrm_St_04 and nodeT_Zcrm_St_05 is subnode of output node from DetalhePedidoNode.

I have 3 views, in the first(DetPedidoCliente) i apply template of a form and have data from T_Zcrm_St_04, in the second (DetPedItem) i apply a template from a table and have data from T_Zcrm_St_05.

i wanna click a cell in the second view and that he brings to me data in the third view... this data will come from another rfc, the DetalheItemNode, and i have to pass three values to this rfc, two from T_Zcrm_St_04 and one from T_Zcrm_St_05.

the error is because posnr is coming with lenght 3 from the rfc in webdynpro, in SAP it is normal coming with lenght 6... so when i do this

inputItem.setI_Item(wdContext.currentT_Zcrm_St_05Element().getPosnr());

the error shows up, but when i just do this

inputItem.setI_Item("000030");

inputItem.setI_Pedido("12");

inputItem.setI_Cliente("1000020");

no error but no data comes from the rfc...

But in SAP passing the same data, data comes normally...

Thanks

Former Member
0 Kudos

Hi Dalmo,

why to pass parameters to methos.instead you can use binding .if you use binding it will not create problrm.

at the same time instead of using lead selection you can also use current contest element.

try this one and let me know

Regards

Naidu

Former Member
0 Kudos

Hi,

I cant use the binding because the table is already binded to another rfc... the one that brings the data...

I tried in another way using the context element, but the same error occurs.


 public void executeDetItem( )
  {
    //@@begin executeDetItem()
	Z_Rfc_Detalhe_Item_Input inputItem = new Z_Rfc_Detalhe_Item_Input();
	inputItem.setI_Cliente(wdContext.currentT_Zcrm_St_04Element().getKunnr());
	inputItem.setI_Item(wdContext.currentT_Zcrm_St_05Element().getPosnr());
	inputItem.setI_Pedido(wdContext.currentT_Zcrm_St_04Element().getVbeln());
	wdContext.nodeDetalheItemNode().bind(inputItem); 
	try{
		wdContext.currentDetalheItemNodeElement().modelObject().execute();
	}catch(Exception ex){
		ex.printStackTrace();
	}
	wdContext.nodeDetalheItemNode().invalidate();
    //@@end
  }

I didn't even try to get the lead selection, what i'm doing wrong?

Thanks

Regards....

Former Member
0 Kudos

hey, i didn't resolve this yet, i'm stuck please help...

is there anyway of binding the cell in the table with the field that income data to the one that sends?

I need with a table with filled data just to pass the value that i select to another rfc that will feed a new view....

Regards