With the feeder class of the List ATS UIBB, you can control the properties Read Only, Enabled and Visibility for single cells as well as columns. This blog describes how to control the properties at single-cell level.
For this blog, let’s use the following example. There is a column (ID “TEXT”). We want to make the content of some cells in this column invisible.
The following steps show you how to do this:
1. For each property, you need to create a technical column (for holding Meta data). A technical column is a column that contains Meta information only and will never appear on the screen. In this example we are adding a new technical column that will contain the information about the Visibility property.
Do this: In the feeder class method if_fpm_guibb_list~get_definition, parameter eo_fied_catalog, add a column with the ID “TEXT_VISIBLE” and the data type “ABAP_BOOL”.
2. Mark the new column as technical; as a result, it will not appear in FLUID in the column repository (as only columns that should appear on the screen are visible).
Do this: In the feeder class method if_fpm_guibb_list~get_definition, parameter et_field_description, add a new entry and fill the attributes: NAME = “TEXT_VISIBLE” and TECHNICAL_FIELD = abap_true.
3. Now it is necessary to link the Visibility property of the column “TEXT” to the technical column “TEXT_VISIBLE”.
Do this: In the feeder class method if_fpm_guibb_list~get_definition, parameter et_field_description, add a new entry and fill the attributes: NAME = “TEXT” and visibility_ref = “TEXT_VISIBLE”. If there is already an entry with NAME = “TEXT”, use that one.
4. Provide the content of the technical column “TEXT_VISIBLE”.
Do this: In the feeder class method if_fpm_guibb_list~get_data, there is a parameter ct_data. This is where the feeder class passes the table data to the FPM List UIBB ATS. Here, you need to populate the new technical column “TEXT_VISIBLE” with values, either abap_false or abap_true. For example, if the content in the first row of column “TEXT” should be visible, then enter abap_true into “TEXT_VISIBLE”, and so on.
And that’s all there is to it.
An example application for this is shipped with SP 12 of SAP_UI component for NetWeaver 7.40:
- The procedure described in this blog is also valid for the FPM Tree UIBB.
- If you want to control a property for the whole column, then the above approach is not recommended; there is a simpler way to do it. In the feeder class method if_fpm_guibb_list~get_definition, parameter et_field_description, you find the attributes “READ_ONLY”, “VISIBILITY” and “DISABLED”. Simply set them to abap_true or abap_false for the corresponding columns.