cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic change of input field attributes

Former Member
0 Kudos

Hi,

how can i change attribute of an input field?

for example, i have matnr field in view with state "Normal Item". Now I want to change it's state from "Normal Item" to "Required".

How can i do that?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

done

Former Member
0 Kudos

Hi Khandal,

I've not done this with Normal to Required, but I've done this with many other attributes, so it should be similar. What I usually do is create a context attribute with the proper data type (check SAP documentation for that). Then you bind the field attribute to the context attribute (click on the box to the right of the attribute entry blank). In your code, you can simply change the value of the context attribute and the field will change right away.

Good luck,

Adam

Former Member
0 Kudos

Hi Adam,

Thanks for replying.

I had already tried the same. but coundn't figure out what should be the value of the context attribute which is attached with input field state attribute.

will you please help me out for that?

Thanks.

Former Member
0 Kudos

I'm seeing references in the documentation to these for Input Fields:

normal - CL_WD_INPUT_FIELD=>E_STATE-NORMAL

required - CL_WD_INPUT_FIELD=>E_STATE-REQUIRED

You should take a look at the class CL_WD_INPUT_FIELD and see what E_STATE is. I think it is WDUI_STATE, but I don't have system access at this moment, so I can't double check.

Regards,

Adam