cancel
Showing results for 
Search instead for 
Did you mean: 

Lead Selection does not work after setting filter for ALV.

prasanthidesira
Discoverer
0 Kudos

Hi, Can you please suggest on below scenario :

I have a Node with a sub node in it .

I am using the supply function on Sub Node to retrieve the date based on Parent Node.

There are two ALV's to display parent and item data. The issue is when a filter(user defined filter) is done on Parent table, the supply function does not work. The value is that of the selected row before setting the filter. Even after removing the filter, the item data is stuck and does not change on Lead Selection.

One thing I noticed is if the child table is a table UI, there is no issue. The only problem is when the second table is ALV

Thanks In Advance

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Prashanthi,

Your issue can be resolved as below

  • Create an event handler method 'set_alv_data'  for the event 'ON_LEAD_SELECT' of parent alv
  • Write the below code inside the event handler method

METHOD set_alv_data.

  DATA lo_node TYPE REF TO if_wd_context_node.

  DATA lv_path TYPE string.

  DATA lv_index TYPE string.

  lv_index = r_param->index.

  CONDENSE lv_index.

  CONCATENATE wd_this->wdctx_my_parent_node

  lv_index

  wd_this->wdctx_my_child_node

  INTO lv_path SEPARATED BY '.'.

  lo_node = wd_context->path_get_node(

      path                          = lv_path

  ).

  DATA lo_interface TYPE REF TO iwci_salv_wd_table.

  lo_interface = wd_this->wd_cpifc_alv_child( ). "get the ref of alv comp of child

  lo_interface->set_data(

    EXPORTING

*    only_if_new_descr =

      r_node_data       = lo_node

  ).

ENDMETHOD.

The above code sets the data node of child alv based on lead selection of parent alv data.

Note: Replace 'parent_node', 'child_node'  with your nodes & 'alv_child' with your alv component name of child alv.

If you want to control the data of child alv on filter function, you can use the event ON_STD_FUNCTION_AFTE and once you define the filter you get the r_param->id = 'SALV_WD_FILTER_DEFINE'  & now you can clear data of child alv.

Hope this helps you.

Regards,

Rama

prasanthidesira
Discoverer
0 Kudos

Hi, The Code above is working fine, but the ALV layout of the child node (changes made using if_salv_wd_table_Settings, if_salv_wd_std_functions ) is lost. I am not able to  set the values again .

Please let me know if I am missing something.

Thank you so much

ramakrishnappa
Active Contributor
0 Kudos

Hi Prashanthi,

Yes, your changes will not be there once you set data again.

So, you need to create a method 'CONFIG_ALV_CHILD" and place your alv settings logic inside this method and you call this method wherever required.

Now, after set_data method, call method "config_alv_child" as below


  lo_interface->set_data(

    EXPORTING

*    only_if_new_descr =

      r_node_data       = lo_node

  ).

" here goes your alv table settings for the child alv

wd_this->config_alv_child( ).

....

You can call this method in WDDOINIT( )  for initial settings.

Hope this helps you.

Regards,

Rama

prasanthidesira
Discoverer
0 Kudos

I tried that.. But that is not working. I Created a custom method and put the new settings but that is somehow not reflecting

ramakrishnappa
Active Contributor
0 Kudos

Hi Prashanthi,

Are you sure that you are making settings for child alv in that custom method? In any case, you might have called parent alv settings or inside the custom method,  you might be referring to parent alv component usage.

If still the issue persists, please share the code, for further analysis.

Regards,

Rama

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

when the filter is applied, does the key fields for supply function are having values.

Just a thought.

Regards

Sree