cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting a row in a table

Former Member
0 Kudos

Hi,

I have 2 BAPIs, through the 1st one i get a table displayed. Now, if i click on any specific row i should get the details for that row. This is done using the 2nd BAPI.

I have 1 small doubt, my 2nd BAPI needs an input parameter in order to get the details. When i select a specific row i need 1 of the column values to be sent to the BAPI2 as input in order to retrieve the details. How do i go abt doing this.

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sunil,

Say your table is bound to a node 'TableNode' and the column you want is 'MyCol'.

When you select a row, get the selected row's column as

wdContext.currentTableNodeElement().getMyCol();

You can call the second Bapi as :


<Bapi_name>Input input = new <Bapi_name>Input();
input.set<Parameter_name>(wdContext.currentTableNodeElement().getMyCol());
wdContext.node<Bapi_name>Input().bind(input);
wdContext.current<Bapi_name>Element().modelObject().execute();

Hope this helps,

Best Regards,

Nibu.

Former Member
0 Kudos

hi sunil,

you can make use of the leadselection action. creat an action for lead selection. Also create a parameter of the type tableelement in that action.let it be 'tabele'

Do proper binding of this parameter in the domodify,

IWDTable t = (IWDTable)view.getElement("your table id");

t.mappingOfOnLeadSelect().addSourceMapping("row","parameter name in the action onleadselect(say tabele)");

now tabele.get<yourattribute> in leadselect action will give the values

of the corresponding row that is clicked.

regards,

rahul

Former Member
0 Kudos

Parameter mapping is not needed here. Simply access the lead selected node element in the event handler via current<node>Element().

Armin

Former Member
0 Kudos

Hi,

You can get the lead selection of the table by using

int i = wdContext.node<node name>().getLeadSelection();

You can the required value from the table by using

wdContext.node<node name>().get<node>ElementAt(i).get<attribute name>();

The above value can be set as the input to your second BAPI.

Do revert for further assistance.

Regards,

Vijith