on 09-15-2011 8:33 AM
Hi friends,
There is a requirement for me, wherein, i need to provide a default filter line when the page loads initially. Generally we get a filter line, when we filter on any of the fields available, but in my case, without filtering on any of the fields, i should get the filter line. Is that possible in real?
If yes, kindly provide me the appropriate code.
Thanks & Regards,
Akshay
Edited by: akshay0222 on Sep 15, 2011 1:00 PM
Hi,
Please try the below code.you can find more solution in sdn.
This displays both the filter line and the FILTER option(rightside top)
DATA:
lv_value type ref to cl_salv_wd_config_table.
DATA: lt_fields TYPE salv_wd_t_field_ref,
ls_fields TYPE salv_wd_s_field_ref,
lr_field TYPE REF TO cl_salv_wd_field,
lr_filter TYPE REF TO cl_salv_wd_filter_rule.
CALL METHOD lv_value->if_salv_wd_field_settings~get_fields
RECEIVING
value = lt_fields.
LOOP AT lt_fields INTO ls_fields.
lr_field = ls_fields-r_field.
CASE ls_fields-fieldname.
WHEN 'VBELN'.
CALL METHOD lr_field->if_salv_wd_filter~create_filter_rule
EXPORTING
included = 'X'
operator = 'NE'
low_value = space
high_value =
RECEIVING
value = lr_filter.
WHEN 'ERDAT'.
WHEN 'ERZET'.
WHEN 'ERNAM'.
WHEN 'ANGDT'.
ENDCASE.
ENDLOOP.
Thanks,
Lavanya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akshay,
Try to config your ALV , I guess you are using a config methode :
you have to use set_filter_filterline_allowed with abap_true :
DATA : alv_config_table TYPE REF TO cl_salv_wd_config_table,
wd_table TYPE REF TO iwci_salv_wd_table.
.
.
alv_config_table = wd_table->get_model( ).
alv_config_table->if_salv_wd_std_functions~set_filter_filterline_allowed( abap_true ). " This instruction
Best regards.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.