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

Check box with Radio button functionality

Former Member
0 Likes
636

Hi All,

I have a requirement like I need to have two check boxes on selection screen when ever I check one the other should be cleared with out pressing enter or any thing on selection screen just like radio button, all helpful answers are rewarded

Thanks

Giridhar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
620

Hi,

Check the below code.

parameters: p_chk1 as checkbox user-command ucomm,

p_chk2 as checkbox user-command ucomm.

at selection-screen output.

if sy-curow = 1.

if p_chk2 = 'X'.

p_chk2 = ' '.

endif.

elseif sy-curow = 2.

if p_chk1 = 'X'.

p_chk1 = ' '.

endif.

endif.

Note: But you need to consider the rows.

6 REPLIES 6
Read only

Former Member
0 Likes
620

Hi,

Without Press Enter or doing anu other Event u cant trigger anything in SAP.

Regards,

Morris Bond.

Read only

Former Member
0 Likes
620

Hi Giridhar,

In that case why don't you take a Radio Button it self ... Because the selection screen will not get refreshed untill you press enter or any other action for meeting your functionality ..

Regards,

Santosh

Read only

Former Member
0 Likes
620

parameters : v_check as checkbox user-command USR1.

parameters : v_check1 as checkbox user-command USR1.

at selection-screen .

if v_check = 'X'.

clear : v_check1.

elseif v_check1 = 'X'.

clear : v_check.

endif.

Read only

Former Member
0 Likes
620

Check this code

report test.

parameters:
 p_cb1 TYPE C as checkbox user-command TS1,
 p_cb2 TYPE C as checkbox user-command TS2.


 AT SELECTION-SCREEN.
   IF sy-ucomm eq 'TS1'.
     if p_cb2 EQ 'X'.
     clear p_cb2.
     ENDIF.
   ELSEIF sy-ucomm eq 'TS2'.
     if p_cb1 EQ 'X'.
     clear p_cb1.
     ENDIF.    ENDIF.

START-OF-SELECTION.
  WRITE:p_cb1.

Read only

Former Member
0 Likes
621

Hi,

Check the below code.

parameters: p_chk1 as checkbox user-command ucomm,

p_chk2 as checkbox user-command ucomm.

at selection-screen output.

if sy-curow = 1.

if p_chk2 = 'X'.

p_chk2 = ' '.

endif.

elseif sy-curow = 2.

if p_chk1 = 'X'.

p_chk1 = ' '.

endif.

endif.

Note: But you need to consider the rows.

Read only

0 Likes
620

Hi Karnam Giridhar,

Try thee following code.

PARAMETERS: test1 RADIOBUTTON GROUP sc1 DEFAULT 'X' user-command u1,

test2 RADIOBUTTON GROUP sc1.

PARAMETERS : p_file TYPE rlgrap-filename.

AT SELECTION-SCREEN OUTPUT.

if test2 is initial.

loop at screen.

if screen-name EQ 'P_FILE'.

P_FILE = ''.

screen-input = '0'.

modify screen.

endif.

endloop.

endif.

AT selection-screen.

if not test2 is initial.

loop at screen.

if screen-name EQ 'P_FILE'.

if screen-input eq '0'.

screen-input = '1'.

modify screen.

endif.

endif.

endloop.

endif.

Regards

Raj