How To Format Cell Color in BSP

It is quite simple to color cells in a BSP table using getter methods to achive a better look

We start by generating the GET_P method of the attribute that we want to color conditionally

 

Then in the getter method, we use find method of the collection wrapper to determine current table line

Next we set the value of the returning parameter under the condition(s) we provide and we are done

METHOD GET_P_PARTNER_SERV.

  DATA: lr_collection TYPE REF TO cl_bsp_wd_collection_wrapper,
        lr_prop_acc   TYPE REF TO if_bol_bo_property_access,
        lv_tech       TYPE string.

  CASE iv_property.
    WHEN if_bsp_wd_model_setter_getter=>fp_bgcolor.
      lr_collection = me->get_collection_wrapper( ).
      lr_prop_acc   = lr_collection->find( iv_index = iv_index ).
      lv_tech       = lr_prop_acc->get_property_as_string( iv_attr_name = 'PARTNER_TECH' ).

      IF lv_tech EQ '9999999999'.
        rv_value = 'lightyellow'.
      ENDIF.
  ENDCASE.

ENDMETHOD.

 

ABOUT Furkan Sönmez

www.linkedin.com/profile/view?id=122521475

RELATED POSTS

COMMENTS

comments powered by Disqus