cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass multiple selected values of a table to RFC

Former Member
0 Kudos

Hi all,

My scenerio is that user selects multiple rows and click a button. i want to pass a unique id of the row to rfc.

means there are userid is unique in the table.

i want to paas the userids of all the selected rows to rfc.

Can any one help me to implement that??

regards

Anoop

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use the following code to get the selected data, replace the nodeName to that which is bound to the table


for(int x=0; x<wdContext.nodeOrders().size(); x++)
	  {
		  if(wdContext.nodeOrders().isMultiSelected(x))
		  {
			  IOrdersElement ordersElement = wdContext.nodeOrders().getOrdersElementAt(x);
			  wdComponentAPI.getMessageManager().reportSuccess(String.valueOf(x) + " Is Selected");
			  wdComponentAPI.getMessageManager().reportSuccess(ordersElement.getUserID());
		  }
	  }

Regards

Ayyapparaj

Answers (3)

Answers (3)

Former Member
0 Kudos
Former Member
0 Kudos

Hi

You are giving the multiple selected values to rfc, this means its table input for rfc....

For the Table input you must have a structure, for that create a instance and set the values by iterating

Regards

Chandran S

Former Member
0 Kudos

Yes the RFC has a table to collect the multiple inputs.

please Put some code to paas the multiple value to the table of the rfc.

Former Member
0 Kudos

Hi

In the context view the properties of the model node for which you have to pass the table data.

In the properties you will find a property called Structure from where you can get the structure name..in my example scenario the structre name is

Zdp_Str_Shopping_Cart

After adding all the datas to the model node, finally add that instance to the root node....

You want to pass only the selected data in the table right, for that refer the looping concept suggested by of Ayyapparaj KV

Zdp_Str_Shopping_Cart shoppingCart;

for(int i=0;i<wdContext.nodeChnIt_Shopping_Cart().size();i++)
		{
			shoppingCart = new Zdp_Str_Shopping_Cart();
			shoppingCart.setEquipment_No(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getEquipment_No());
			shoppingCart.setIbase(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getIbase());
			shoppingCart.setKbetr(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getKbetr());
			shoppingCart.setMaktx(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getMaktx());
			shoppingCart.setMatnr(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getMatnr());
			shoppingCart.setQuantity(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getQuantity());
			shoppingCart.setSerial_No(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getSerial_No());
			shoppingCart.setUnit(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getUnit());
			shoppingCart.setUnit_Of_Wt(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getUnit_Of_Wt());
			shoppingCart.setWaers(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getWaers());
			shoppingCart.setWeight(wdContext.nodeChnIt_Shopping_Cart().getChnIt_Shopping_CartElementAt(i).getWeight());
			createProductOrder.addIt_Shopping_Cart(shoppingCart);      	
		}
		wdContext.nodeZdp_Bapi_Create_Product_Order_Input().bind(createProductOrder);

Let me know whether you got an idea and your problem get solved......

Regards

Chandran S

Former Member
0 Kudos

Hi

In table add a checkbox field and that lets you to select multiple rows. And while you set action to the button put a condition and check the status of the checkboxes and pass rows accordingly..

Regards

- Vinod

*