cancel
Showing results for 
Search instead for 
Did you mean: 

need FILTERED data in ALV table

Former Member
0 Kudos

Hi,

I have an ALV table,which user can filter on basis of some data and accordingly the other part of same page is updated.

Now suppose user filter's the page gets the refreshed data in lower part,he saves it,closes window and login's again now he will be shown the filtered ALV table.NOW HOW CAN I GET FILTERED ALV DATA SO THAT I CAN SHOW OTHER PART OF PAGE ACCORDINGLY.

This has to be done in web-dynpro ABAP.

hoping to get some positive and quick responses.

thanks

aditya

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

DATA: lt_filtered_entries    TYPE lvc_t_fidx.

CALL METHOD go_grid->get_filtered_entries

  IMPORTING

    et_filtered_entries = lt_filtered_entries.

Former Member
0 Kudos

Thanks for the information Sallie, it solved my problem.

Thanks

Aditya

Faaiez
Advisor
Advisor
0 Kudos

Kumar

You can use the following code to get the filtered data in an ALV table:

  • Get values of result of filter

  DATA: lr_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,
        l_VALUE type If_Salv_Wd_Table=>S_Type_Param_Get_Ui_Info.

  try.
      lr_INTERFACECONTROLLER =   wd_This->wd_CpIfc_<b>Alv_Graphics_Data</b>( ).
    catch CX_WDR_RT_EXCEPTION.
  endtry.

  if not lr_INTERFACECONTROLLER is initial.
    l_VALUE = lr_INTERFACECONTROLLER->Get_Ui_Info(
    ).
  endif.

<b>Alv_Graphics_Data</b> above must be replaced by the name of your usage component.

L_VALUE-T_DISPLAYED_ELEMENTS contains the index's of all the resultant data of the filter.

Regards

Faaiez
Advisor
Advisor
0 Kudos

Have you managed to sort out this problem?

I am trying to do the same thing?

Regards

Former Member
0 Kudos

Hi Sallie,

I could not find solution for that problem so i had to change my approach a little bit so now everytime user comes to screen default screen with all data will be shown and if he enters something in filter section then we are going to change the lower screen accordingly.

But i haven't still figured out how am i going to find out what the user has entered in filter column.

If you know something related to that please let me know.

thanks

aditya

Former Member
0 Kudos

Hi Sallie,

I could not find solution for that problem so i had to change my approach a little bit so now everytime user comes to screen default screen with all data will be shown and if he enters something in filter section then we are going to change the lower screen accordingly.

But i haven't still figured out how am i going to find out what the user has entered in filter column.

If you know something related to that please let me know.

thanks

aditya

Faaiez
Advisor
Advisor
0 Kudos

Kumar

You can use the following code to access the filter values of the ALV table:

data: lt_t_fields        TYPE SALV_WD_T_FIELD_REF.

lt_t_fields =  WD_THIS->SALV_CONFIG->IF_SALV_WD_FIELD_SETTINGS~T_FIELDS.
  loop at lt_t_fields into ls_t_field.
    lr_salv_wd_field = ls_t_field-r_field.
    lt_salv_wd_t_filter = lr_salv_wd_field->IF_SALV_WD_FILTER~T_FILTER.
    loop at lt_salv_wd_t_filter into ls_salv_wd_s_filter.
      lr_filter_rule = ls_salv_wd_s_filter-R_FILTER_RULE.

    endloop.
  endloop.

It would however be better if one could just get the result of the filter by accessing -R_RESULT_DATA which contains a reference to CL_SALV_BS_RESULT_DATA_TABLE which contains the results of the filter in T_RESULT_DATA.

Regards