Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

color rows in table control

Former Member
0 Likes
1,727

Hi all,

Does anyone know how I can color spesific lines in a table

control?

I've only been able to color columns.

Thanx,

Baruch.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
646

Hi

Are you speaking about classical TABLE CONTROL? No ALV?

In this case you should modify the attribute using the LOOP/ENDLOOP statament into LOOP/ENDLOOP of TC in PBO:

PROCESS PBO.

LOOP AT ...

MODULE LOOP_SCREEN.

ENDLOOP.

PROCESS PAI.

MODULE LOOP_SCREEN.

IF ......

LOOP AT SCREEN.

SCREEN-INTENSIFIED = 1.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

ENDLOOP.

If you're speaking about ALV:

In your OUTPUT TABLE you need add a new field to manage the color:

DATA: BEGIN OT T_OUTPUT OCCURS 0,

..............

TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,

END OF T_OUTPUT.

It needs to specify the field name in layout structure:

IS_LAYOUT-coltab_fieldname = 'TCOLOR'.

So while you're appending the record into T_OUTPUT you fill the structure TCOLOR too.

These is a table where you need all fields (so the cells of a row) you want to change the color.

DATA: WA_COLOR TYPE SLIS_SPECIALCOL_ALV.

T_OUPUT-FIELD = ...........

REFRESH T_OUTPUT-TCOLOR.

WA_COLOR-FIELDNAME = <field name>

WA_COLOR-COLOR-COL = <color number>.

APPEND WA_COLOR TO T_OUTPUT-TCOLOR.

This way is ok for classical ALV, if you're using OO ALV the way is the same but change the structure you have to use:

IS_LAYOUT-CTAB_FNAME = 'TCOLOR'.

Where TCOLOR is like LVC_T_SCOL

Max

2 REPLIES 2
Read only

Former Member
0 Likes
647

Hi

Are you speaking about classical TABLE CONTROL? No ALV?

In this case you should modify the attribute using the LOOP/ENDLOOP statament into LOOP/ENDLOOP of TC in PBO:

PROCESS PBO.

LOOP AT ...

MODULE LOOP_SCREEN.

ENDLOOP.

PROCESS PAI.

MODULE LOOP_SCREEN.

IF ......

LOOP AT SCREEN.

SCREEN-INTENSIFIED = 1.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

ENDLOOP.

If you're speaking about ALV:

In your OUTPUT TABLE you need add a new field to manage the color:

DATA: BEGIN OT T_OUTPUT OCCURS 0,

..............

TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,

END OF T_OUTPUT.

It needs to specify the field name in layout structure:

IS_LAYOUT-coltab_fieldname = 'TCOLOR'.

So while you're appending the record into T_OUTPUT you fill the structure TCOLOR too.

These is a table where you need all fields (so the cells of a row) you want to change the color.

DATA: WA_COLOR TYPE SLIS_SPECIALCOL_ALV.

T_OUPUT-FIELD = ...........

REFRESH T_OUTPUT-TCOLOR.

WA_COLOR-FIELDNAME = <field name>

WA_COLOR-COLOR-COL = <color number>.

APPEND WA_COLOR TO T_OUTPUT-TCOLOR.

This way is ok for classical ALV, if you're using OO ALV the way is the same but change the structure you have to use:

IS_LAYOUT-CTAB_FNAME = 'TCOLOR'.

Where TCOLOR is like LVC_T_SCOL

Max

Read only

Former Member
0 Likes
646

Hi,

try this thread.

rgds,

latheesh