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

Dynamically change color / highlight.

Former Member
0 Likes
2,012

Hi,

I have 3 radio button, and was group as radio button group with FctCode 'RG'.

When select a radio button, the text of the radio button must change to other color or being highlighted to differentiate from the other 2. The inputfield beside the radio button also must change to the same color or highlighted. How do i go about it? Thanks

Regards,

Rayden

1 ACCEPTED SOLUTION
Read only

former_member189629
Active Contributor
0 Likes
1,378

Hi Rayden,

Use this code as reference...

at selection-screen output.

loop at screen.

*--- If Radio Button 1 is checked

IF rad1 = 'X'.

IF screen-group1 = 'MI2'.

*--- Fields with MODIF ID MI2 are colored

screen-color = 1.

screen-intensified= 1.

ENDIF.

endloop.

You may only get blue color tho'

Reward points for useful Answers

Regards

Karthik

Hi,

I have 3 radio button, and was group as radio button group with FctCode 'RG'.

When select a radio button, the text of the radio button must change to other color or being highlighted to differentiate from the other 2. The inputfield beside the radio button also must change to the same color or highlighted. How do i go about it? Thanks

Regards,

Rayden

6 REPLIES 6
Read only

former_member189629
Active Contributor
0 Likes
1,379

Hi Rayden,

Use this code as reference...

at selection-screen output.

loop at screen.

*--- If Radio Button 1 is checked

IF rad1 = 'X'.

IF screen-group1 = 'MI2'.

*--- Fields with MODIF ID MI2 are colored

screen-color = 1.

screen-intensified= 1.

ENDIF.

endloop.

You may only get blue color tho'

Reward points for useful Answers

Regards

Karthik

Read only

0 Likes
1,378

Hi Karthik,

Thanks for the reply. I don't understand the code. screen-group1 refer to the Radio button group is it?

Regards,

Rayden

Read only

0 Likes
1,378

Rayden,

No, Not the Radio Button grp...

The selection sceen fields musy have a MODIF-ID addition. Sry, i 4got to mention it... use the below code for ref...

*--- Radio buttons to set properties

PARAMETERS:

rad1 RADIOBUTTON GROUP rad default 'X' USER-COMMAND radio,

rad2 RADIOBUTTON GROUP rad,

rad3 RADIOBUTTON GROUP rad.

SELECT-OPTIONS:

s_matnr FOR mara-matnr MODIF ID MI1,

s_mtart FOR mara-mtart MODIF ID MI1.

at selection-screen output.

loop at screen.

*--- If Radio Button 1 is checked

IF rad1 = 'X'.

IF screen-group1 = 'MI1'.

*--- Fields with MODIF ID MI2 disappear from the screen

screen-color = 1.

screen-intensified= 1.

ENDIF.

endloop.

Reward points for useful Answers

Regards

Karthik

Message was edited by:

Karthik

Read only

0 Likes
1,378

Hi Karthik,

That was useful. I have abit clearer picture now. The reference given is for selection screen. I'm using dislog screen. I try to do a MODIF in my declaration but it seem like not working.

Sample Code:

========================================================

DATA:

rb_1(1) TYPE c MODIF ID SQ1,

rb_2(1) TYPE c MODIF ID SQ2,

rb_3(1) TYPE c MODIF ID SQ3,

=========================================================

The MODIF is in red color in my abap workbench. Any solution? Thanks

Regards,

Rayden

Read only

0 Likes
1,378

Rayden, if it is in dialog pgm, assign youe screen element to a screen GROUP (dbl click on it and u will see the GROUP field in properties.)

Now simply write a module to set screem propertieds in PBO. In that check if screen-group = X'... do ur stuff.

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,378

Hi this is the exmple code,

i am not using any color, but when the input is diabled, automatically its color will be different.

selection-screen begin of line.

parameters: p1 radiobutton group rg1 user-command ucomm default 'X'.

parameters: input(7) .

selection-screen end of line.

selection-screen begin of line.

parameters:

p2 radiobutton group rg1,

input1(7).

selection-screen end of line.

at selection-screen output.

loop at screen.

IF P1 = 'X'.

IF SCREEN-NAME = 'INPUT'.

screen-INPUT = 1.

ELSE.

IF SCREEN-NAME = 'INPUT1'.

screen-INPUT = 0.

ENDIF.

ENDIF.

ELSEIF P2 = 'X'.

IF SCREEN-NAME = 'INPUT1'.

screen-INPUT = 1.

ELSE.

IF SCREEN-NAME = 'INPUT'.

screen-INPUT = 0.

ENDIF.

ENDIF.

endif.

modify screen.

endloop.