cancel
Showing results for 
Search instead for 
Did you mean: 

Populating second table from OnSelect of first table

Former Member
0 Kudos

Hi Experts,

I am new to ABAP Webdynpro. I have a requirement to show a search area, one table for header info, and second table for populating item level information.

I was successful building a search area and populating first table when the 'Search' button is pressed.

Now, I like to populate the second table with item details if a row on first table is selected. I tried to bind the OnSelect Event of first table to a method and try to get the results and bind to second table.. However, I am unsuccessful in this attempt.

Here are my questions/challenges.

1. When I select a row on first table, how can I extract the key information?

2. Is it sufficient to create a context attribute and populate it with FM and bind that with second table?

I appreciate your help in answering this question.

Thanks,

SG

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If I can go ito basis of WDA ... if you want to populate a different table on click of the colum or row of your first table you need to write a "Supply Function " which gets called automatically whenever you select the line item in your first table as pe context node properties.

So create your second table node as a child node of the first.

Hope this will help you.

Thanks

Pradeep

Answers (2)

Answers (2)

arjun_thakur
Active Contributor
0 Kudos

Hi,

When I select a row on first table, how can I extract the key information?

I had a similar requirement in my project. You can refer this thread for it:

Is it sufficient to create a context attribute and populate it with FM and bind that with second table?

I think you should get the ouput from FM in an internal table, bind that internal table to the node which you have binded with your second table.

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

Hi,

Create an event handler for OnLeadSelect event of the First table. In that event handler, you will get the corresponding context element of the row selected as event parameter. To get that, please see the following code snippet:


DATA ele TYPE REF TO IF_WD_CONTEXT_ELEMENT.

 ele = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

You can define a context node and bing it to the second table. And populate that context node in the above mentioned event handler based on the row selected.(you will be having the data of selected row in "ele".

You will have to create a context node to be able to populate data in a TABLE.

Hope this helps!

Regards,

Srilatha