cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify property STATE of input field at runtime?

former_member184111
Active Contributor
0 Kudos

Hi Forum,

I am trying to modify the property STATE(set it to required i.e. 01) at runtime in WDDOMODIFYVIEW for a standard component in SRM but it throws a dump...

Could not find attribute TAXJURCODE:STATE

Code is:

DATA: ip_taxjur TYPE REF TO cl_wd_input_field.

ip_taxjur ?= view->get_element( 'TAXJURCODE' ).

 IF ip_taxjur IS BOUND.
   ip_taxjur->set_state( EXPORTING value = '01' ).
ENDIF.

I tried to find the actual biding path for this property at runtime using

ip_taxjur->bound_state( RECEIVING path = lv_state_path ).

and it gives the path as ADDRESS_DATA.TAXJURCODE:STATE .

How to set this property to REQUIRED dynamically?

Thank you,

Anubhav

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member199125
Active Contributor
0 Kudos

Anubhav,

value should be of type CL_WD_ABSTRACT_INPUT_FIELD=>T_STATE

default value is CL_WD_ABSTRACT_INPUT_FIELD=>E_STATE-NORMAL

for required CL_WD_ABSTRACT_INPUT_FIELD=>E_STATE-required

Regards

Srinivas

former_member184578
Active Contributor
0 Kudos

Hi Anubhav,

It seems like your attribute is under node ADDRESS_DATA. check this. Also my suggestion is, create one attribute in context of type wdy_boolean, now click on the input field in layout , under properties, bind the state property to the created attribute. And set it to true using set attribute method.

I guess you cannot use the above suggested one. please check the node under which the attribute is.

Hope this helps u.,

Thanks & regards,

Kiran.