Quantcast
Channel: SCN : All Content - Web Dynpro ABAP
Viewing all articles
Browse latest Browse all 3667

Check-box --- Read only property in Table UI Element of Webdynpro

$
0
0

Hi Experts,

 

We have standard SRM webdynpro component where in we have a Table UI element about 26 columns,

 

Here one of the Column is a check-box. Based on the Login user this check box column should be in read only mode.

 

for instance if any users log-in he should have the previlage to check or uncheck the check box, But whenever an approvers sees the same page the check-box column should be in a dis-abled mode. i tried the below code... but unfortunately it is not behaving as expected.

 

"Get table reference
    lo_table ?= view->get_element('ITEMS_TABLE').

    "Get Columns of table


    lt_cols = lo_table->get_columns( ).

 

    "Check if no columns found
    IF lt_cols[] IS INITIAL.


      "get grouped columns list
      lt_grp_cols = lo_table->get_grouped_columns( ).


      "collect into columns table
      LOOP AT lt_grp_cols INTO ls_grp_cols.
        ls_cols ?= ls_grp_cols.
        APPEND ls_cols TO lt_cols.
      ENDLOOP.
    ENDIF.

 

    "For each column and its editor, set the read only property
    LOOP AT lt_cols INTO ls_cols.


      " get the cell editor,
      lo_inp ?= ls_cols->get_table_cell_editor( ).

IF ls_cols->id = 'ITEMS_TABLE_ACPT_IND'.

      IF lo_inp IS BOUND.
        lv_path =  lo_inp->bound__primary_property( ).

 

        CONCATENATE lv_path 'READ_ONLY' INTO lv_path SEPARATED BY ':'.

    

      "bind the read_only property to the attributes property


        lo_inp->bind_read_only( path = lv_path ).
      ENDIF.

endif.

    ENDLOOP.


Viewing all articles
Browse latest Browse all 3667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>