cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the field attributes dynamically in FPM_FORM_UIBB_GL2

0 Kudos

I want to resue one form for both display and edit page of one object. In the display page, all fields are set to read only, and in edit page, fields are set to changable. But i go through the training document and cannot find how to set the field attribute dynamically.

Best regards,

Robin

Accepted Solutions (1)

Accepted Solutions (1)

harsha_jalakam
Active Contributor
0 Kudos

Hi Robin,

The parameter ct_field_usage is used to set the attributes to read only/ editable. Below is a sample code used to do the same, in get_data method. After the fields are set, cv_fied_usage_changed must be set to true, so that the changes are reflected.

field-SYMBOLS: <fs_field> like line of CT_FIELD_USAGE.
   loop at CT_FIELD_USAGE ASSIGNING <FS_FIELD>.

     case <FS_FIELD>-NAME.

     when 'VEBLN'. " name of the field
         <FS_FIELD>-READ_ONLY = 'X'. " ' ' for editable

     ENDCASE.


CV_FIELD_USAGE_CHANGED = abap_true.


Regards,

Harsha

0 Kudos

Hi Harsha,

Thanks.

Best regards,

Robin

Answers (1)

Answers (1)

0 Kudos

I found one parameter CT_FIELD_USAGE in method IF_FPM_GUIBB_FORM~GET_DATA, not sure whether it's the correct way.