Application Development 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: 

TABLE CONTROL LINES COLOR CHANGE

Former Member
0 Kudos

<i>Hi Friens.,

I need small help ie.,

Let us assume we have table control like this.,

col1 | col2 | group |

-


a1 | b1 | 1

a2 | b2 | 1

a3 | b3 | 2

a4 | b4 | 2

a5 | b5 | 3

a6 | b6 | 3

1) User need differentiation between groups to look and feel.,thats why I want to change the Line colors based on Group.,

2) I am getting this one .,but I made case on Sy-stepl., while scrolling it is not showing correct .,

3) Is there any good way to do this., like in ME21 CONDITIONS TAB at Item level</i>

If any body have Idea., share with me.,

<b>Thanks.,</b>

<i><b>Surendher Reddy.Baddam</b></i>

8 REPLIES 8

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

In your PBO, inside your Loop, you need to loop at your screen and change the value of SCREEN-INTENSIFIED to "1".

Regards,

Rich Heilman

nablan_umar
Active Contributor
0 Kudos

As what Rich has said, you can dynamically intensified the line based on changed group id. This is my recommendation.

1. On field attributes of the loop fields of table control, define a group id 1 for field COL1, COL2, and GROUP.

2. In PBO of you screen, call a module pool while looping at the table control.

3. In this module pool, check the value of Group. If it has been changed from the previous line, do LOOP at SCREEN and change the INTENSIFIED value of the screen field where group1 is the one you defined in 1)

Former Member
0 Kudos

Than Q..,

I made condition Same what u said.,

But PBO LOOp AT tableccontrol

ENDLOOP.

is processing only 7 times.,

In my case table control contains 20-30 lines.,

It is modifying only in first two cases.,

0 Kudos

Hi Surendher,

Could you please post the coding you use between LOOP and ENDLOOP so we can have a look at your problem?

Regards,

John.

Former Member
0 Kudos

LOOP AT itab WITH CONTROL tc4_400 CURSOR tc4_400-current_line.

MODULE check_rej_hld_400.

MODULE radio_checkbox_400.

ENDLOOP.

DATA : l_stf TYPE i.

DATA : l_hyd TYPE i,l_knr TYPE i.

l_hyd = 1.

LOOP AT SCREEN.

IF screen-name = 'ITAB-BATCHNO'.

IF itab-group = l_hyd. " this is group

screen-intensified = 1.

MODIFY SCREEN.

ELSEIF l_knr = l_stf.

screen-intensified = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

ADD 2 TO l_hyd.

Former Member
0 Kudos

Re: TABLE CONTROL LINES COLOR CHANGE

Posted: Nov 5, 2004 6:47 AM Reply E-mail this post

PBO >>>like thise.,

LOOP AT itab WITH CONTROL tc4_400 CURSOR tc4_400-current_line.

MODULE check_rej_hld_400.

MODULE radio_checkbox_400.

ENDLOOP.

>>>

MODULE radio_checkbox_400.

DATA : l_stf TYPE i.

DATA : l_hyd TYPE i,l_knr TYPE i.

l_hyd = 1.

LOOP AT SCREEN.

IF screen-name = 'ITAB-BATCHNO'.

IF itab-group = l_hyd. " this is group

screen-intensified = 1.

MODIFY SCREEN.

ELSEIF

screen-intensified = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

ADD 2 TO l_hyd

ENDMODULE.

I made logic like this.,

Thanks.,

Surendher Reddy.Baddam

0 Kudos

Hi Surendher,

Could you set a breakpoint on the line:

IF itab-group = l_hyd. " this is group

I suspect this condition is only valid once and thus the intensified attribute will be set onlu once.

Regards,

John.

0 Kudos

All fields you defined in module pool will be considered as global variables. So field l_hyd is a global variable. However, I see that you initialize l_hyd as 1 everytime module radio_checkbox_400 is called. So the IF statement always check for '1'.

Since you are checking for ITAB-GROUP in that module pool, you probably need to read table ITAB with index tc4_400-current_line in module radio_checkbox_400.

Do like this,

READ TABLE ITAB index tc4_400-current_line.

before LOOP AT SCREEN.