Display an ALV based on a condition from another table

I would like to ask how can I display only certain rows of a table based on a condition from another table. In other words I want to relate the tables.

More concrete, I have a table with header data. I created a hotspot for the field “Purchase Order No”. I want to display the line items for a particular purchase order by clicking on the some purchase order number in the header table. The issue is the following: When I click on some purchase order number in the header table, I open the table with all line items accross all orders. How can I get only the line items for the particular order and not the whole table?

How can I do this using the class CL_SALV_TABLE? Thank you in advance and sorry for the silly question.

I believe you are displaying the Header data as ALV list with Hotspot set on Purchase Order Field. If so, in the event handler method of Hotspot_click, just get the selected purchase order number with the help import parameters and filter the item data based on it and call factory method of SALV class.

Leave a Comment