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.

/wp-content/uploads/2015/05/table1_709049.png

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:

Application Configuration

FPM_TEST_LIST_ATS_CELL_PROPS_AC

Feeder Class

CL_FPM_TEST_LIST_ATS_CELL_PROP

Remarks:

  • 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.
To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Fran├žois Henrotte

    in version 7.40 SP8 we have a problem when we insert new fields in description only (at least in feeders inheriting from standard /BOFU/CL_FBI_GUIBB_FORM) because all fields that are not customized in the configuration of UIBB are not taken into account. Of course the new fields are not customized, so adding them to description leads to nothing.

     

    but there is something else that works: using the field catalog. When we add a new field to the field catalog, this one is taken into account even if not present in field description. The data segment is then enhanced with the new field and it is possible to fill it in the method GET_DATA of the feeder class.

     

    there is a simple way to add a field into the catalog: here is in yellow.

    /wp-content/uploads/2015/09/add_field_785118.jpg

    The second part is just to try being compliant with the upcoming Service Packs and having the new (technical) field in the description also. I hope this will not lead to inconsistencies.

     

    Note: this example is about semantic colour but the principle is the same as text visibility.

    (0) 

Leave a Reply