Skip to Content
avatar image
Former Member

enhancement problem for GUIBB TREE

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

1.PNG (82.4 kB)
2.PNG (64.1 kB)
3.PNG (52.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 22, 2015 at 07:21 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 22, 2015 at 02:19 AM

    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

    Add comment
    10|10000 characters needed characters exceeded