Skip to Content
0
Former Member
Oct 23, 2006 at 11:56 AM

Code

14 Views

How to code for this requirement.

In OO ALV, My final internal table has color_line field.

I need to color a two particuler row in the output.

I am using this logic, but it doesnt work.

LOOP AT GT_BPSTAB INTO WA_BPSTAB.

clear LV_COUNTER.

CASE LV_COUNTER.

WHEN '12 '.

*IF LV_COUNTER = 12.

*FORMAT COLOR COL_KEY INTENSIFIED ON.

WA_BPSTAB-COLOR_LINE = 'C610'.

MODIFY GT_BPSTAB FROM WA_BPSTAB.

**MOVE WA_BPSTAB TO GT_BPSTAB.

*ENDIF.

WHEN '13'.

*IF LV_COUNTER = 13.

*FORMAT COLOR COL_KEY INTENSIFIED ON.

WA_BPSTAB-COLOR_LINE = 'C910'.

MODIFY GT_BPSTAB FROM WA_BPSTAB .

*ENDIF.

ENDCASE.

ENDLOOP.

MOVE 'COLOR_LINE' TO LS_LAYOUT-INFO_FNAME.

CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

I_STRUCTURE_NAME = 'gt_STRUCT'

I_SAVE = X_SAVE

I_DEFAULT = LV_DEF

IS_LAYOUT = LS_LAYOUT

CHANGING

IT_OUTTAB = GT_BPSTAB[]

IT_FIELDCATALOG = GT_FIELDCATALOG[]

EXCEPTIONS

INVALID_PARAMETER_COMBINATION = 1

PROGRAM_ERROR = 2

TOO_MANY_LINES = 3

OTHERS = 4

.