cancel
Showing results for 
Search instead for 
Did you mean: 

Can I filter some element-rows out from the context-table?

Former Member
0 Kudos

I have a context which has 20 elements.

Q1,

can I display the rows from 5th to 14th, with other rows hide from the user.

user cannot see the other row using scrolling bar.

Q2,

can I display 1-10 rows in table 1, display 11-20 rows in table 2.

and from table 1 I cannot see 11-20 rows. vice vesa.

I tried the such visble row ..but failed

Accepted Solutions (0)

Answers (3)

Answers (3)

thomas_szcs
Active Contributor
0 Kudos

Hi Jijing,

regarding Q2 you could probably use property firstActualRow and related properties to achieve this for a normal table, but I would strongle advice against that. Look, you only have 20 rows. Why not creating two context nodes and moving 10 rows to the first node and the other 10 rows to the other node? It would be a simple and straightforward solution that is a highly maintainable.

Best regards,

Thomas

Former Member
0 Kudos

the table and the context node bind to the table have a very complex structure, so, splitting is not easy.

Actually I did split the node into two nodes already, for the development pushing me moving forward to catch up the schedule. But the process of coding really annoyed me...

Former Member
0 Kudos

Hi Jijing,

Both your questions are achieveable using ALV Table. You can use the same context for both tables

and create filter rules on both tables seperately. Using alv filter rule you can use the same context node in two tables showing differnent records, and all this without having to touch the context node binding.

Thanks,

Pris.

Former Member
0 Kudos

Hi Prisford,

You mean this can be achieved by use ALV table but not CL_WD_TABLE?

Former Member
0 Kudos

Hi,

Basically what you require is table filtering. The table filtering is available in both ALV and normal table.

In ALV table its easy to perset the filter with simple code.

  DATA: lr_field TYPE REF TO cl_salv_wd_field.

  lr_field = wd_this->lr_config->if_salv_wd_field_settings~get_field( <column_name>).
  lr_field->if_salv_wd_filter~delete_filter_rules( ).
  lr_field->if_salv_wd_filter~create_filter_rule( low_value = <value> ).

I had a simiar requirement and tried it in both tables. I suceeded in doing it only with an ALV table.

Thanks,

Pris.

amy_king
Active Contributor
0 Kudos

Hi Jijing,

I think I can help with question #1. See SCN discussion,.

Cheers,

Amy