cancel
Showing results for 
Search instead for 
Did you mean: 

Easy Question:Select many rows from a table and execute BAPI for these rows

Former Member
0 Kudos

Hi Experts,

I have created one WD project. The WD project fetches some records of backend using BAPI and displays in a table. I have to select some rows from the table and then execute BAPI for selected rows.

How I can select multiple records from the table and then execute another BAPI for selected rows.

Regards,

Gary

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Gray

You have asked two Question that is

1) Multiple row Selection in Table for this you can set the property

Selectionmode --> Multi

2) Next is calling the Bapi with the selected Rows

For this you can create an new model with the corresponding BAPI. on the event trigger You can call the Bapi with the Selected row by using the parameter as

node<Node>.currentElement.treeSelected() This will return the node of selected tree and you pass this node to the BAPI

Hope I have answered to your Question

Thanks & Regards

Noel

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

In the Node which you binded to the table create one more attribute of type boolean.

For example your node is as below:

//Table Node

TableNode

-


> Att1

-


> Att2

-


> isSelected(boolean) - Newly created attribute for this requirement.

//Result Node contains the elements selected in TableNode

ResultNode

-


>Att1

-


>Att2

Now in the table create one more Column with Checkbox as tablecell editor. Now bind this boolean attribute to that check box.

Now in the code you can get the selected rows by user as below:

for(int i=0;i<TableNode().size();i++)

{

if(wdContext.nodeTableNode().getTableNodeElementAt(i).getIsSelected()==true)

{

IPrivateTestView.IResultNode element=wdContext.createResultNodeElement();

element.setAtt1(wdContext.nodeTableNode().getTableNodeElementAt(i).getAtt1());

element.setAtt2(wdContext.nodeTableNode().getTableNodeElementAt(i).getAtt2());

wdContext.nodeResultNode().addElement(element);

}

}

Regards,

Charan

Former Member
0 Kudos

Hi Gary

To select many rows in a table you need to change the selectMode properties of table to Multi.

In your controller you could use method <NODE>.getMultiSelection() to retrieve the selected rows.

Regards

Marcos