cancel
Showing results for 
Search instead for 
Did you mean: 

enhancement problem for GUIBB TREE

Former Member
0 Kudos

hi guys

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'.

     ENDLOOP.

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

Accepted Solutions (1)

Accepted Solutions (1)

ulrich_miller
Active Participant
0 Kudos

Hi there,
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.

Kind regards,
Ulrich

Answers (1)

Answers (1)

Former Member
0 Kudos

i have solved the issue, and here is the solution

instead of enhancing the standard class (which will affect all other programs), i created a custom subclass of /SCMTMS/CL_FBI_GUIBB_TREE and i redefined both methods GET_DEFINITION and GET_DATA

the field catalog of the tree is built inside GET_DEFINITION and inside here i can see that the rate_amount's read_only is referencing to a technical field named BOFU/R19

inside GET_DATA, i can see the CT_DATA table has a column called BOFU/R19 as well (which is the same as the fieldcat created in get_definition). So actually, the rate_amount's read_only is controlled at per cell level by populating this BOFU/R19 cell with 'X'

That is will take precedence over what you have set elsewhere as those are controlled as per column level