cancel
Showing results for 
Search instead for 
Did you mean: 

Input fields enable/disable at runtime in oif component at form uibb

Former Member
0 Kudos

Hi,

I want to disbale/enable input fields in fpm_form_uibb based on some conditions. I have searched for couple of methods in feeder class but those are not working. Please suggest which method we have to use.

Thanks

Murali Papana.

Accepted Solutions (0)

Answers (1)

Answers (1)

hendrik_brandes
Contributor
0 Kudos

Hi Murali,

at least, you have to use the Method "GET_DATA" from the Feeder-Interface.

There are two parameters CT_FIELD_USAGE and EV_FIELD_USAGE_CHANGED which you must fill up correctly.

Insert the necessary components - indicated by NAME - in the table CT_FIELD_USAGE and provide the values for the fields

READ_ONLY, MANDATORY, ENABLED, VISIBILITY.

You can also change the fixed-values for comboboxes and even change the texts and links.

Kind regards,

Hendrik

Former Member
0 Kudos

Hi Hendrik

Thanks for your reply,

I have already written the code as below, but I am not able to disable the input field.

loop at ct_field_usage assigning <fieldusg> where name = 'ZZTEST'.

<fieldusg>-READ_ONLY = abap_true.

EV_FIELD_USAGE_CHANGED = abap_true.

endloop.

Thanks

Murali

Former Member
0 Kudos

Hey,

I found the solutions.

We have to write the code in GET_DEFINITION method as below.

FIELD-SYMBOLS <ls_field_descr> TYPE fpmgb_s_formfield_descr.

LOOP AT et_field_description ASSIGNING <ls_field_descr>.

if <ls_field_descr>-name = 'ZZTEST'.

<ls_field_descr>-read_only = abap_true.

<ls_field_descr>-read_only_ref = <ls_field_descr>-name.

ENDIF.

endloop.

Thanks

Murali Papana.

J_R
Employee
Employee
0 Kudos

The field READ_ONLY_REF needs only to be filled if you would like to control the property readOnly of form field ZZTEST by the field value of another form field. But then, it will not be possible to change the property via the field usage in method GET_DATA anymore (but only via the field value of the reference field).

Since this seems not to be the case according to your description you can leave the reference field READ_ONLY_REF of form field ZZTEST empty in method GET_DEFINITION.