cancel
Showing results for 
Search instead for 
Did you mean: 

how to apply ALV filter

Former Member
0 Kudos

Hi..

i have a ALV.

1.Apply filter on ALV. Assume i get 15 results.

2.Delete one row. Still i get 15 results.

How to reapply the ALV filter by code.

Thanks

Vimalraj

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vimalraj Madhavan ,

Are u trying to delete record from the records thats are displaying after applying filter?.

if so before deleting from itab you have to find the actual index of the record that corresponds to the itab, and you have to delete from itab based on that index.. the actaul index that corresponds to each record thats currently displayed in the alv is there in one of the itab of the alv parameters.

you can get the details of currently displayed record using

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_alv_invoice( ).

catch CX_WDR_RT_EXCEPTION.

endtry.

if not lr_INTERFACECONTROLLER is initial.

l_VALUE = lr_INTERFACECONTROLLER->Get_Ui_Info(

).

in itab l_value you can check for the index of selected.

Regards

Sarath

Former Member
0 Kudos

Hi Sarath,

Assume i applied filter on connid = AA.

i am getting 15 results.

Now i delete one record. Record is also delted

But the 15th record comes from AZ.

Here the filter is wrongly executed.

how to execute properly or tell gimme a idea to overcome the issue.

Thanks

Vimalraj

Former Member
0 Kudos

Hi Vimalraj,

if thats the case you have to apply filter again, there is no other way, since for the delete button we are manually writiing codes, and the filter option thats a standard button. Filtering is a standard function and the records are displayed based on the index of each record, not on values, thats y after delete the next record will automatically append to the table.ie after filter the system will suppose decided to display record 1, 5 ,6 and when we delete 6th record, seventh record will become the 6th one.

One solution for this is instead of deleting a record you can insert a blank record so that index of the records wont change. but after that you have to do manual coding to hide blank rows from alv.

Regards

Sarath