enhancement problem for GUIBB TREE
in SAP TM, i want to set the Rate Amount column as read only field.
the component configuration of the view is /SCMTMS/WDCC_TCM_CHARGES_TREE
this /SCMTMS/WDCC_TCM_CHARGES_TRESS is a child class inherited from parent class /BOFU/CL_FBI_GUIBB_TREE.
Since the method IF_FPM_GUIBB_TREE~GET_DATA is defined in the parent class, i made a POST-EXIT enhancement for this method in the parent class itself. The system does not allow me to make a POST-EXIT enhancement in the child class unless i redefine the method. But redefining is also not allowed because the child class is not a Z custom class.
And here are my codes in the POST-EXIT enhancement:
DATA: ls_fieldusage TYPE fpmgb_s_fieldusage.
LOOP AT ct_field_usage INTO ls_fieldusage WHERE name = 'RATE_AMOUNT'.
ls_fieldusage-read_only = 'X'.
ls_fieldusage-fixed_values_changed = 'X'.
MODIFY ct_field_usage FROM ls_fieldusage INDEX sy-tabix TRANSPORTING read_only fixed_values_changed.
ev_field_usage_changed = 'X'.
After all the things done above, the column is still editable. I have been trying out for 1 and a half days and still couldn't figure out what's wrong. Could you guys please advise? Thanks
Ulrich Miller replied
could you check method get_definition. There is a parameter with name et_field_description.
Check whether there is an entry for column RATE_AMOUNT. If so, then let's see whether
there is an attribute with the id READ_ONLY_REF. If so, then just be sure that this is attribute
is not getting populated. Because via READ_ONLY_REF it is also possible to set the attribute
read only, but with that method it is even possible to set it on cell level and it might overrule
the field usage in get_data.