Quantcast
Channel: SCN : All Content - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 4552

Disable or Hide the One Click Action Icon from Table View based on data

$
0
0

Hi All,

 

The below is useful to disable  or Hide the One Click Action Icons from Table view Based on data.

 

Go to the View  context node class -> redefine the method GET_OCA_T_TABLE.

 

Add the below code in above method.

 

 

 

DATA: ls_one_click_action TYPE crmt_thtmlb_one_click_action,

         lr_entity           TYPE REF TO cl_crm_bol_entity,

         lr_iterator         TYPE REF TO if_bol_bo_col_iterator,

         lv_winner           TYPE string.

 

CONSTANTS :lc_delete  TYPE char6 VALUE 'DELETE'.

 

   ls_one_click_action-id      = 'DELETE'.                   "#EC NOTEXT

   ls_one_click_action-icon    = 'delete.gif'.     

   ls_one_click_action-text    = ''.

   ls_one_click_action-active  = 'X'.

 

   APPEND ls_one_click_action TO rt_actions.

 

*--Check the winner is checked or not

   lr_iterator = me->collection_wrapper->get_iterator( ).

   CHECK lr_iterator IS BOUND.

 

   lr_entity ?= lr_iterator->get_by_index( iv_index ).

   CHECK lr_entity IS BOUND.

 

   lr_entity->get_property_as_value( EXPORTING iv_attr_name = 'WINNER'  " here Winner is table Attribute field which is having data

                                                   IMPORTING ev_result    = lv_winner ).

   IF lv_winner is NOT INITIAL.

    DELETE rt_actions WHERE id = lc_delete.

   ENDIF.



regards

rama


Viewing all articles
Browse latest Browse all 4552

Trending Articles