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: 

Module pool : Radio Buttons

Former Member
0 Kudos

Hi experts,

Need Small help on radio buttons in module pool..

my requirement is i have r1 and r2 radiobuttons.

If i select r1. field1 and field2 has display and field3 and field 4 has to be not to display.

and viceversa ..

how to do pls send some code.....

Urjent please....

1 ACCEPTED SOLUTION

Former Member
0 Kudos

first take two radion button and assign in one group. Select both the radio button at a time and right click to assign the radio button group. Now for the radio buttons assign the fcode in the property window(just dbl click on the button to get the property window).

in your PBO

module pbo output.

if r1 = 'X'.

loop at screen.

if screen-name = 'FIELD3' or screen-name = 'FIELD4'.

screen-active = '0'.

modify screen.

endif.

endloop.

elseif r2 = 'X'.

loop at screen.

if screen-name = 'FIELD1' or screen-name = 'FIELD2'.

screen-active = '0'.

modify screen.

endif.

endloop.

endif.

endmodule.

regards

shiba dutta

6 REPLIES 6

Former Member
0 Kudos

Hi Laxmi,

Take a loop at screen in PBO module and check it,

e.g.

LOOP AT SCREEN.

IF screen-group1 = 'MOD'.

IF flag = ' '.

screen-INVISIBLE = '0'.

ELSEIF flag = 'X'.

screen-INVISIBLE = '1'.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Reward if useful!

0 Kudos

HI,

Assign some function code to the radio button.

LOOP AT SCREEN.

if rad1 = 'X'.

if SCREEN-NAME = 'FIELD3' OR SCREEN-NAME 'FIELD4'.

screen-input = 0.

modify screen.

endif.

if SCREEN-NAME = 'FIELD1' OR SCREEN-NAME 'FIELD2'.

screen-input = 1.

modify screen.

endif.

ENDLOOP.

LOOP AT SCREEN.

if rad2 = 'X'.

if SCREEN-NAME = 'FIELD3' OR SCREEN-NAME 'FIELD4'.

screen-input = 1.

modify screen.

endif.

if SCREEN-NAME = 'FIELD1' OR SCREEN-NAME 'FIELD2'.

screen-input = 0.

modify screen.

endif.

ENDLOOP.

Regards,

Sesh

Former Member
0 Kudos

hello,

In screen elements of FIELD1, FIELD2 assign common screen group 'GR01'

In screen elements of FIELD1, FIELD2 assign common screen group 'GR02'

In PBO event decalre a MODULE with following piece of code.

LOOP AT SCREEN.

IF R1 = 'X'.

IF SCREEN-GROUP1 = GR01.

SCREEN-ACTIVE = 1.

MODIFY SCREEN.

ELSEIF IF SCREEN-GROUP1 = GR02.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards,

A.Singh

0 Kudos

Please read as

INVISIBLE instead of ACTIVE.

Former Member
0 Kudos

first take two radion button and assign in one group. Select both the radio button at a time and right click to assign the radio button group. Now for the radio buttons assign the fcode in the property window(just dbl click on the button to get the property window).

in your PBO

module pbo output.

if r1 = 'X'.

loop at screen.

if screen-name = 'FIELD3' or screen-name = 'FIELD4'.

screen-active = '0'.

modify screen.

endif.

endloop.

elseif r2 = 'X'.

loop at screen.

if screen-name = 'FIELD1' or screen-name = 'FIELD2'.

screen-active = '0'.

modify screen.

endif.

endloop.

endif.

endmodule.

regards

shiba dutta

Former Member
0 Kudos

In-order for your radiobuttons to work correctly you need to group them together so that SAP knows they are linked together. To do this using the grahical layout editor simply select all the radiobuttons you what in the same group and then right click on them, Now choose define group. Once you have done this your radiobuttons will work as they should and only allow one to be selected at any one time.

Highlight individual table control field

The example below sets the EBELN field on the 3rd row of the table control to not be an input field. This is a fairly simple process which involves firstly calculating which row of the internal table is displayed at the top of the table control. From this you can work out which itab row is on the 3rd row and set its attributes using the LOOP AT SCREEN command.

Based on the example table control the ABAP code for this will be as follows, resulting in a modified version of the PBO MODULE 'populate_screen'.

MODULE populate_screen OUTPUT.

DATA: ld_line TYPE i.

  • Set which line of itab is at the top of the table control

IF sy-stepl = 1.

tc100-lines =

tc100-top_line + sy-loopc - 1.

ENDIF.

  • move fields from work area to scrren fields

MOVE-CORRESPONDING wa_ekko TO ztc_ekko.

ld_line = sy-stepl + tc100-top_line - 1.

  • Changes individual field attributes of table control,

  • Sets EBELN field on 3rd row of TC to not be an input field!

LOOP AT SCREEN.

IF ld_line EQ 3.

IF screen-name EQ 'ZTC_EKKO-EBELN'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

ENDMODULE. " populate_screen OUTPUT

reward points if it is usefull ....

Girish