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: 

plz clarify my doubt abt usage of check box and radio buttons

Former Member
0 Kudos

i have a doubt . suppose we have subtotal and grand totol as check boxes .

In tht subtotal , there are date wise , customer wise and country wise as radio buttons . if i click on subtotal , then only radio buttons are available to select . otherwise these radio buttons looks like disable .

can u plz favour me.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

i didnot get the answer wht i need exactly

14 REPLIES 14

Former Member
0 Kudos

are these on a selection screen or a module pool screen ??

0 Kudos

hi sir , i want to use this radio buttons and check boxes in selection screen . i dont know abt module pool upto nw .

can u plz send me clear code for this .

advance thank u

sumanth

Former Member
0 Kudos

Have a look in the forums for "loop at screen" in order to control the attributes for visible / active / input etc for... here's an example

cheers

Jonathan

Former Member
0 Kudos

Hi See this code ,

REPORT zm_selectoutput .

TABLES : lfa1, kna1 .

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME .

PARAMETERS : r1 RADIOBUTTON GROUP gr1 USER-COMMAND flag DEFAULT 'X',

r2 RADIOBUTTON GROUP gr1.

SELECTION-SCREEN END OF BLOCK blk1 .

SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME .

SELECT-OPTIONS : p_lifnr FOR lfa1-lifnr MODIF ID ide.

SELECTION-SCREEN END OF BLOCK blk2 .

SELECTION-SCREEN BEGIN OF BLOCK blk3 WITH FRAME .

SELECT-OPTIONS : p_kunnr FOR kna1-kunnr MODIF ID idf.

SELECTION-SCREEN END OF BLOCK blk3 .

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN .

IF r1 IS NOT INITIAL AND screen-group1 = 'IDE' .

screen-active = '0' .

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN .

IF r2 IS NOT INITIAL AND screen-group1 = 'IDF' .

screen-active = '0' .

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards,

Nihar Swain...........................

Former Member
0 Kudos

i didnot get the answer wht i need exactly

0 Kudos

I think this is what you are looking for:

REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

SELECTION-SCREEN BEGIN OF BLOCK tot WITH FRAME .
PARAMETERS : sub AS CHECKBOX DEFAULT 'X'  USER-COMMAND ucom,
             grd AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK tot .

SELECTION-SCREEN BEGIN OF BLOCK sub WITH FRAME .
PARAMETERS: x_dte RADIOBUTTON GROUP sub MODIF ID sub DEFAULT 'X',
            x_cus RADIOBUTTON GROUP sub MODIF ID sub,
            x_ctr RADIOBUTTON GROUP sub MODIF ID sub.
SELECTION-SCREEN END OF BLOCK sub .

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN .
    IF NOT sub IS INITIAL AND screen-group1 = 'SUB' .
      screen-active = '0' .
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Rob

0 Kudos

I am very greatful to u for answering my question . but i didnot get exactly wht it is in my mind . plz look this example in abap docu .

PROGRAM demo_dynpro_input_output .

when we execute this , observe check boxes . it is appearing but not suppose to select . similarly in my program also when we not check subtotal , radio buttons are suppose to appear but not suppose to select .

we have to use check boxes and radio buttons in same group .i dont know module pools upto now. i need this by using selection screens only. can u help me .

advance wishes ,

sumanth

0 Kudos

Then:

REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

SELECTION-SCREEN BEGIN OF BLOCK tot WITH FRAME .
PARAMETERS : sub AS CHECKBOX DEFAULT 'X'  USER-COMMAND ucom,
             grd AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK tot .

SELECTION-SCREEN BEGIN OF BLOCK sub WITH FRAME .
PARAMETERS: x_dte RADIOBUTTON GROUP sub MODIF ID sub DEFAULT 'X',
            x_cus RADIOBUTTON GROUP sub MODIF ID sub,
            x_ctr RADIOBUTTON GROUP sub MODIF ID sub.
SELECTION-SCREEN END OF BLOCK sub .

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN .
    IF NOT sub IS INITIAL AND screen-group1 = 'SUB' .
      screen-input = '0' .                         "<=============
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Former Member
0 Kudos

sorry for saying like this . i didnot get the answer wht i need .

i hope u all can answer asap.

0 Kudos

You've marked this message as answered, so a lot of people won't check it. Look at my last answer, I think it does what you are asking for.

If not, you should open a new thread.

Rob

0 Kudos

plz read my last last message. i clearly said wht i need .

PROGRAM demo_dynpro_input_output .

like as check boxes i need radio buttons (we can see but we cant select).

rgds

sumanth

0 Kudos

Please run my last program. It does exactly what you are asking for. If the SAP program does what you want, then you should try it.

Rob

0 Kudos

I am very greatful to u for answering my question . but i didnot get exactly wht it is in my mind . plz look this example in abap docu .

PROGRAM demo_dynpro_input_output .

when we execute this , observe check boxes . it is appearing but not suppose to select . similarly in my program also when we not check subtotal , radio buttons are suppose to appear but not suppose to select .

we have to use check boxes and radio buttons in same group .i dont know module pools upto now. i need this by using selection screens only. can u help me .

advance wishes ,

sumanth

0 Kudos

Building upon Rob's example, try the code below. You should see a checkbox for "subtotal" (p_subtot) then a frame with the subtotal options radiobuttons in it, and then another checkbox for "grand total" (p_grdtot). When you click on P_GRDTOT, the radio buttons grey out, when you click on P_SUBTOT they re-activate.

Is this what you were trying to do?

Jonathan

report zlocal_jc_radiobutton_checkbox.

tables:
  sscrfields.           "To allow trapping of Fcode on selection screen

selection-screen begin of block tot with frame.
parameters :
  p_subtot              as checkbox default 'X'  user-command zsub.

selection-screen begin of block subt with frame .
parameters:
  p_rbdte               radiobutton group sub modif id sub default 'X',
  p_rbcus               radiobutton group sub modif id sub,
  p_rbctr               radiobutton group sub modif id sub.
selection-screen end of block subt.

parameters:
  p_grdtot              as checkbox user-command zgrd.
selection-screen end of block tot .

at selection-screen output.
  perform at_selection_screen_output.

at selection-screen.
  perform at_selection_screen.

*&---------------------------------------------------------------------*
*&      Form  at_selection_screen
*&---------------------------------------------------------------------*
form at_selection_screen.
*" trap the checkbox clicked
  if sscrfields-ucomm = 'ZSUB'. "clicked Subtotal checkbox
    clear: p_grdtot.
  endif.
  if sscrfields-ucomm = 'ZGRD'. "clicked Grandtotal checkbox
    clear: p_subtot.
  endif.
endform.                    "at_selection_screen

*&---------------------------------------------------------------------*
*&      Form  at_selection_screen_output
*&---------------------------------------------------------------------*
form at_selection_screen_output.

*" open or close the radio buttons
  if p_subtot = 'X'.  "Subtotals selected
    loop at screen.
      if screen-group1 = 'SUB' .
        screen-input = '1'.  "turn input on
        modify screen.
      endif.
    endloop.
  else.
    loop at screen.
      if screen-group1 = 'SUB' .
        screen-input = '0'.  "turn input off
        modify screen.
      endif.
    endloop.
  endif.

endform.                    "at_selection_screen_output