cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic filterering of table entries

Former Member
0 Kudos

Hi,

Maybe someone can help me with the following scenario:

I have two tables in different tabstrips.

Both are bound to the same context node. The context node ist filled by a supply method.

Both tables should display different data depending on an attribute in the context node. If this context attribute has a specific value, the data should be displayed in the table of the first tabstrip. For all other attribute values the data should be displayed in the table of the second tabstrip.

Is it possible to do a kind of dynamic filtering before the table of a tabstrip is displayed? In case it is possible, how?

I don't want to use two different context nodes, one for each table.

Thanks in advance,

Anika

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Anika,

Such type of things can be done using Cell Vairant. Please search that so many threads are there for Cell variant which will help you so much to do your work

Warm Regards,

Vijay.

Message was edited by:

Vijaya Bhaskarudu Gangisetty

Former Member
0 Kudos

Hi Vijay,

could you please provide an example for this case. I don't get it.

Thank you very much,

Anika

Former Member
0 Kudos

Hi Annika.

Maybe this helps you.

Cheers,

Sascha

Former Member
0 Kudos

Just one question .

Do you want to display some rows in the table of tab1 and some rows in table of

tab2? Or do you want to display some columns in table of tab1 and some other

columns in table of tab2?

Cheers,

Sascha

Former Member
0 Kudos

Hi Sascha,

I want to see some rows in the table of tab1 and some rows in table of

tab2.

Ciao,

Anika

Former Member
0 Kudos

Hi Anika.

Maybe <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/DE/2d/390e422dfcde2ce10000000a1550b0/content.htm">this</a> helps you.

There is the property filter value which can be set on each column of a tyble. But

I've never used it so I do not know how to ... Seems that you can filter rows out this way.

Cheers,

Sascha

Former Member
0 Kudos

Hi Anika,

I am providing the code for the Cell Variant. just execute this, then you will get knowledge on this.

method configure_alv .

*... check ALV component usage

data:

lr_salv_wd_table_usage type ref to if_wd_component_usage.

lr_salv_wd_table_usage = wd_this->wd_cpuse_salv_wd_table( ).

if lr_salv_wd_table_usage->has_active_component( ) is initial.

lr_salv_wd_table_usage->create_component( ).

endif.

*... get ALV component

data:

lr_salv_wd_table type ref to iwci_salv_wd_table.

lr_salv_wd_table = wd_this->wd_cpifc_salv_wd_table( ).

*... (1) get ConfigurationModel from ALV Component

wd_this->r_table = lr_salv_wd_table->get_model( ).

  • ...(2) init ConfigurationModel

*... init TableSettings

data:

lr_table_settings type ref to if_salv_wd_table_settings.

lr_table_settings ?= wd_this->r_table.

lr_table_settings->set_visible_row_count( '15' ).

lr_table_settings->set_read_only( abap_false ).

data:

lr_header type ref to cl_salv_wd_header.

lr_header = lr_table_settings->get_header( ).

data:

l_header type string.

concatenate sy-sysid ' Flight overview' into l_header. "#EC NOTEXT

lr_header->set_text( l_header ).

lr_header->set_tooltip( 'Tooltip Flight Overview' ). "#EC NOTEXT

lr_header->set_image_source( 'ICON_FLIGHT' ).

lr_header->set_image_first( abap_false ).

*... init FunctionSettings

cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(

r_model = wd_this->r_table ).

*... init ColumnSettings

data:

lr_column_settings type ref to if_salv_wd_column_settings.

lr_column_settings ?= wd_this->r_table.

data:

lt_columns type salv_wd_t_column_ref.

lt_columns = lr_column_settings->get_columns( ).

data:

ls_column type salv_wd_s_column_ref,

lr_col_header type ref to cl_salv_wd_column_header,

l_tooltip type string.

loop at lt_columns into ls_column.

lr_col_header = ls_column-r_column->get_header( ).

l_header = lr_col_header->get_text( ).

concatenate 'Tooltip:' l_header into l_tooltip separated by space."#EC NOTEXT

lr_col_header->set_tooltip( l_tooltip ).

*... create textview cellvariant for each column

data:

lr_cv type ref to cl_salv_wd_cv_standard.

create object lr_cv.

lr_cv->set_key( 'TEXT_VIEW' ).

data:

lr_textview type ref to cl_salv_wd_uie_text_view.

create object lr_textview.

lr_textview->set_text_fieldname( ls_column-id ).

lr_cv->set_editor( lr_textview ).

ls_column-r_column->add_cell_variant( r_cell_variant = lr_cv ).

ls_column-r_column->set_sel_cell_variant_fieldname( 'CELLVARIANT' ).

case ls_column-id.

when 'CARRID'.

data:

lr_input_field type ref to cl_salv_wd_uie_input_field.

create object lr_input_field

exporting

value_fieldname = ls_column-id.

ls_column-r_column->set_cell_editor( lr_input_field ).

when 'CONNID'.

data:

lr_button type ref to cl_salv_wd_uie_button.

create object lr_button.

lr_button->set_text_fieldname( ls_column-id ).

ls_column-r_column->set_cell_editor( lr_button ).

when 'FLDATE'.

data:

lr_link_to_action type ref to cl_salv_wd_uie_link_to_action.

create object lr_link_to_action.

lr_link_to_action->set_text_fieldname( ls_column-id ).

ls_column-r_column->set_cell_editor( lr_link_to_action ).

when 'CARRID_CONV'.

data:

lr_drdn_by_key type ref to cl_salv_wd_uie_dropdown_by_key.

create object lr_drdn_by_key

exporting

selected_key_fieldname = ls_column-id.

ls_column-r_column->set_cell_editor( lr_drdn_by_key ).

when 'PRICE'.

data:

lr_link_to_url type ref to cl_salv_wd_uie_link_to_url.

create object lr_link_to_url.

lr_link_to_url->set_text_fieldname( ls_column-id ).

lr_link_to_url->set_reference( 'http:
www.amazon.de' ).

ls_column-r_column->set_cell_editor( lr_link_to_url ).

when 'CHECKBOX'.

data:

lr_checkbox type ref to cl_salv_wd_uie_checkbox.

create object lr_checkbox

exporting

checked_fieldname = ls_column-id.

ls_column-r_column->set_cell_editor( lr_checkbox ).

when 'URL'.

data:

lr_image type ref to cl_salv_wd_uie_image.

create object lr_image.

lr_image->set_source( 'ICON_FLIGHT' ).

ls_column-r_column->set_cell_editor( lr_image ).

when 'SEATSOCC'.

data:

lr_progr_indicator type ref to cl_salv_wd_uie_progr_indicator.

create object lr_progr_indicator.

lr_progr_indicator->set_percent_value( 80 ).

lr_progr_indicator->set_display_value_fieldname( ls_column-id ).

lr_progr_indicator->set_show_value( abap_true ).

lr_progr_indicator->set_width( '5em' ).

ls_column-r_column->set_cell_editor( lr_progr_indicator ).

when 'DISTANCE'.

data:

lr_toggle_button type ref to cl_salv_wd_uie_toggle_button.

create object lr_toggle_button

exporting

checked_fieldname = 'CHECKBOX'.

lr_toggle_button->set_text_fieldname( ls_column-id ).

ls_column-r_column->set_cell_editor( lr_toggle_button ).

when 'PLANETYPE' or 'CURRENCY' or 'DISTID'.

when 'ICON'.

create object lr_image.

lr_image->set_source_fieldname( ls_column-id ).

ls_column-r_column->set_cell_editor( lr_image ).

ls_column-r_column->set_visible( cl_wd_uielement=>e_visible-visible ).

ls_column-r_column->if_salv_wd_column_service_ref~set_sort_fieldname( 'ICON_SORT' ).

when others.

ls_column-r_column->set_visible( cl_wd_uielement=>e_visible-none ).

endcase.

endloop.

*... init FieldSettings

data:

lr_field_settings type ref to if_salv_wd_field_settings.

lr_field_settings ?= wd_this->r_table.

data:

lr_field type ref to cl_salv_wd_field.

*... set reference fields

lr_field = lr_field_settings->get_field( 'PRICE' ).

lr_field->set_reference_field( 'CURRENCY' ).

lr_field->set_reference_field_type( if_salv_wd_c_field_settings=>reffieldtype_curr ).

lr_field = lr_field_settings->get_field( 'PAYMENTSUM' ).

lr_field->set_reference_field( 'CURRENCY' ).

lr_field->set_reference_field_type( if_salv_wd_c_field_settings=>reffieldtype_curr ).

lr_field = lr_field_settings->get_field( 'DISTANCE' ).

lr_field->set_reference_field( 'DISTID' ).

lr_field->set_reference_field_type( if_salv_wd_c_field_settings=>reffieldtype_quan ).

endmethod.