cancel
Showing results for 
Search instead for 
Did you mean: 

State of column of table

Former Member
0 Kudos

Hi experts,

I have a question for you. I have a table and I need to show a column with state required or not depending of the role of the user. Is it possible to realize this?

Tks a lot!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi ,

u procced like this :

1 check the user , just read the context attribute which is bind to the field for user using get_attribute

2 now using set_attribute method , set the value to REQUIRED or NOT REQUIRED depending on the user value

here u wud set the context attribute which is binded to the table column to the value Required or Not Required

regards,

amit

Former Member
0 Kudos

Hi webdynpro.gc,

can you more elaborate your query.

As per my understanding you want to check the value in some column for specified role.



DATA lt_attr TYPE cl_wd_dynamic_tool=>t_check_mandattr_tab.
DATA ls_attr TYPE cl_wd_dynamic_tool=>t_check_mandattr_struct.

DATA lv_error TYPE wdy_boolean.

CASE user_role

 WHEN 'ADMIN'.
  ls_attr-attribute_name = 'MAND_ATTR1'. 
  ls_attr-element_empty_ok = abap_true.
  APPEND ls_attr TO lt_attr.
  CLEAR ls_attr.

 WHEN 'SIMPLE'.
  ls_attr-attribute_name = 'MAND_ATTR2'.
  ls_attr-element_empty_ok = abap_true.
  APPEND ls_attr TO lt_attr.
  CLEAR ls_attr.

 WHEN OTHERS.

ENDCASE.

lv_errors = cl_wd_dynamic_tool=>check_mandatory_attributes(
  attribute_list   = lt_attr
  display_messages = 'X'
  context_root     = lo_nd_alv_data ).

Hope it will solve your query.

Nawal Kishor Mittal