cancel
Showing results for 
Search instead for 
Did you mean: 

Modify the config parameter of static context attribute

florian_halder
Participant
0 Kudos

Hi experts,

is it possible to modify/update the config parameters of static context attribute.

I searched the web and looked at the methods of the context_node interface etc. but found no solution.

I can read the values in this way:

Data:

 

        lo_nd_info      TYPE REF TO if_wd_context_node_info,

        lo_nd_project TYPE REF TO if_wd_context_node.

FIELD-SYMBOLS:

       <ls_attribute> TYPE wdr_context_attribute_info.

.....

  lo_nd_info = lo_nd_project->get_node_info( ).

  lt_attributes = lo_nd_info->get_attributes( ).

  read table lt_attributes assigning <ls_attribute>

       with key name = 'PROJECT_NO'.

.....

But I found no way to set it. Is it not possible to modify it on runtime?

Thanks in advance

Florian

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

There is no provision to set the attribute/ to set read only of the attribute. However you can set the nullable property of attribute.

so, use remove attribute method to delete the attribute and add it back using add attribute method and pass the is_read_only value ( or enhance the class CL_WDR_CONTEXT_NODE_INFO and add method set_read_only and write your logic as like in set_nullable method ).

Hope this helps u,

Regards,

Kiran

florian_halder
Participant
0 Kudos

Hi Kiran,

thanks for your quick response.

I had this idea also, but it doesnt't work to remove "not dynamic" attributes. 😉

The reason why I tried to do the modification of this parameter was, because I create a form with the following method. But all fields on the form will be editable unless I changed the parameter of the context attribute to read_only.

  cl_wd_dynamic_tool=>create_form_from_node(

       ui_parent   = lo_container

       node        = lo_nd_project

          ).

If the modification of the attribute doesn't work, I will copy the method and set the read_only parameter inside the method, when creating the input field.

Regards,

Florian

former_member184578
Active Contributor
0 Kudos

Hi,

Fine, Try enhancing the class mentioned in the earlier reply and call that method to set the read only property.

Regards,

Kiran