cancel
Showing results for 
Search instead for 
Did you mean: 

line Color in Tree GUIBB

Former Member
0 Kudos

Hello,

May I know if it is possible to change the background or the font of one line in a GUIBB tree.

E.g. After we select a line and want to highlight this line.

Thank you very much.

Shumin

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you very much!

Former Member
0 Kudos

Hi,

As the previous answer was a little oriented on pure WD ABAP rather than FPM, I will try to give the FPM answer: YES and NO

YES -> Yes, you can set the color for the line/cell.

NO -> No, you cannot set a color for the master column. (Issue addressed to FPM, but if you have any channels please also address it...maybe it gets promoted then )

To set the color for a line or cell you first have to create an additional attribute in the table structure used by the Tree GUIBB. After that you have to redefine the method

IF_FPM_GUIBB_TREE~GET_DEFINITION

in the Tree feeder class

CL_GUIBB_BOL_TREE

and link the cell you want to color to the new cell containing the value of the color:

  LOOP AT et_field_description ASSIGNING <ls_field_description>.
    CASE <ls_field_description>-name.
* set color for last column
      WHEN 'AMOUNT_09'.
        <ls_field_description>-cell_design_ref = 'CELL_COLOR'. "name of cell with color value

So now, after telling FPM where to find the color value, you have to define which color to use. Best place - or at least where we did it - is the method

IF_FPM_GUIBB_TREE~GET_DATA

of the Tree feeder class:

  LOOP AT ct_data ASSIGNING <ls_data>.
    ASSIGN COMPONENT 'AMOUNT_09'   OF STRUCTURE <ls_data> TO <l_amount>.
    ASSIGN COMPONENT 'CELL_COLOR' OF STRUCTURE <ls_data> TO <l_cell_color>.
    IF <l_amount> < '100-'.
      <l_cell_color> =  '06'."set red color for negative value
    ELSE [...]

I hope I could help you!

Kind Regards,

Robert

Former Member
0 Kudos

Hi,

define a context attribute cellEditor of type string inside the table node.

bind the tableCellEditor to the context attribute cellEditor. Set the color based on your requirement/condition