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: 

syntax for radio button declaration

Former Member
0 Kudos

dear all,

can u plz tell me how to declare a parameter in the type of radio button. can u also provide me the syntax of grouping radio buttons.

9 REPLIES 9

Former Member
0 Kudos

Hi,

plz check below syntax.

PARAMETERS: rad1 RADIOBUTTON GROUP r1,
rad2 RADIOBUTTON GROUP r1 DEFAULT 'X',
rad3 RADIOBUTTON GROUP r1,
rad4 RADIOBUTTON GROUP r2,
rad5 RADIOBUTTON GROUP r2,
rad6 RADIOBUTTON GROUP r2 DEFAULT 'X'.

Here there are 2 groups r1 and r2.

In r1 three radio buttons where rad2 is selected default.

And in r2 three radio buttons of which rad6 is selected.

thanx.

Edited by: Dhanashri Pawar on Sep 17, 2008 8:11 AM

Edited by: Dhanashri Pawar on Sep 17, 2008 8:14 AM

Former Member
0 Kudos

Hi,

Syntax.

parameter : p1 for data_type radiobutton group R1,

p2 for data_type2 radiobutton group R1.

If you mention the same radio button group for 2 parameters, it means they are grouped.

Regards,

Pramod

Former Member
0 Kudos

Hi,

Declare radio buttons like this


PARAMETERS:
  p_num RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND abc,
  p_char RADIOBUTTON GROUP rad1.

Also check F1 help.

Regards

Abhijeet

Former Member
0 Kudos

Hi

tables : sscrfields.

selection-screen comment /2(50) text-001 modif id sc1.

selection-screen skip 2.

selection-screen comment /10(50) ques1 .

parameters:     rb1_1 radiobutton group q1gr user-command flag,
                rb1_2 radiobutton group q1gr ,
                rb1_3 radiobutton group q1gr ,
                rb1_4 radiobutton group q1gr ,
                rb1_5 radiobutton group q1gr ,
                rb1_6 radiobutton group q1gr ,
                rb1_7 radiobutton group q1gr ,
             comment1(255) type c  modif id abc.


selection-screen uline /1(50).


selection-screen comment /10(50) ques2 .

parameters:   rb2_1 radiobutton group q2gr,
              rb2_2 radiobutton group q2gr,
              rb2_3 radiobutton group q2gr,
              rb2_4 radiobutton group q2gr,
              rb2_5 radiobutton group q2gr,
              rb2_6 radiobutton group q2gr,
              rb2_7 radiobutton group q2gr default 'X'.

selection-screen uline /1(50).

selection-screen comment /10(50) ques3 .

parameters:   rb3_1 radiobutton group q3gr,
              rb3_2 radiobutton group q3gr,
              rb3_3 radiobutton group q3gr,
              rb3_4 radiobutton group q3gr,
              rb3_5 radiobutton group q3gr,
              rb3_6 radiobutton group q3gr,
              rb3_7 radiobutton group q3gr default 'X'.

selection-screen uline /1(50).

selection-screen comment /10(50) ques4 .

parameters:   rb4_1 radiobutton group q4gr,
              rb4_2 radiobutton group q4gr,
              rb4_3 radiobutton group q4gr,
              rb4_4 radiobutton group q4gr,
              rb4_5 radiobutton group q4gr,
              rb4_6 radiobutton group q4gr,
              rb4_7 radiobutton group q4gr default 'X'.

selection-screen uline /1(50).

selection-screen comment /10(50) ques5 .

parameters:   rb5_1 radiobutton group q5gr,
              rb5_2 radiobutton group q5gr,
              rb5_3 radiobutton group q5gr,
              rb5_4 radiobutton group q5gr,
              rb5_5 radiobutton group q5gr,
              rb5_6 radiobutton group q5gr,
              rb5_7 radiobutton group q5gr default 'X'.

selection-screen uline /1(50).


*DATA:

initialization.

  ques1 = 'How did you like the Course? ' .
  ques2 = 'How did you like the Course Material? ' .
  ques3 = 'How did you like the Instructor? ' .
  ques4 = 'How did find the class Environment? ' .
  ques5 = 'Did course meet your expectation '.


at selection-screen output.
  if rb1_7 eq 'X'.
    loop at screen.
      if screen-name = 'COMMENT1' .
        screen-input = '0'.
        screen-output = '1'.
        modify screen.
      endif.
    endloop.

  endif.

at selection-screen on radiobutton group q1gr.

start-of-selection.

  perform process_data.


end-of-selection.


*&---------------------------------------------------------------------*
*&      Form  process_data
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form process_data.


endform.                    "process_data

Try this sample code.

Regards,

Kasuladevi

Former Member
0 Kudos

The syntax is :

PARAMETERS : alv_list RADIOBUTTON GROUP g1,

alv_grid RADIOBUTTON GROUP g1,

s_class RADIOBUTTON GROUP g1.

Regards,

Amit.

Former Member
0 Kudos

Hi,

Syntax,

Parameter : p1 RADIOBUTTON GROUP r1 default 'X'.

p2 radiobutton group r1.

at a time only one radiobutton is selected from single group.

Regards,

Alpesh

Former Member
0 Kudos

Hi,

Please check this, it will solve your problem.

REPORT zsscr.

*TYPE POOLS DECLARATIONS FOR VALUE REQUEST MANAGER AND ICONS

TYPE-POOLS : vrm,

icon.

*SELECTION SCREEN FIELDS

TABLES : sscrfields.

*GLOBAL DECLARATIONS

DATA : flag TYPE c,

tablename(10),

mmtable LIKE dd02l-tabname,

sdtable LIKE dd02l-tabname,

hrtable LIKE dd02l-tabname.

*DECLARATIONS FOR SELECTION SCREEN STATUS

DATA it_ucomm TYPE TABLE OF sy-ucomm.

**********SELECTION-SCREENS*********************

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.

*FOR DYNAMIC DISPLAY OF MODULES

PARAMETERS : pa RADIOBUTTON GROUP rad USER-COMMAND com MODIF ID mod,

pb RADIOBUTTON GROUP rad MODIF ID rad,

pc RADIOBUTTON GROUP rad MODIF ID cad.

SELECTION-SCREEN SKIP.

**TO INCLUDE DYNAMIC ICONS

SELECTION-SCREEN COMMENT 2(6) text_001.

*DYNAMIC LIST BOX BASED ON USER SELECTIONS

PARAMETERS one AS LISTBOX VISIBLE LENGTH 20 MODIF ID mod.

PARAMETERS two AS LISTBOX VISIBLE LENGTH 20 MODIF ID rad.

PARAMETERS three AS LISTBOX VISIBLE LENGTH 20 MODIF ID cad.

SELECTION-SCREEN END OF BLOCK blk1.

*DISPLAY DYNAMIC PUSHBUTTON ON APP TOOLBAR ON USER CLICKS

SELECTION-SCREEN: FUNCTION KEY 1,

FUNCTION KEY 2,

FUNCTION KEY 3.

**EVENT ON SELECTION SCREEN FOR OUTPUT DISPLAY

AT SELECTION-SCREEN OUTPUT.

*CLICK OF FIRST RADIO BUTTON

IF pa = 'X'.

sscrfields-functxt_01 = 'Materials Management'.

WRITE icon_plant AS ICON TO text_001.

*CODE TO GET DYNAMICS BASED ON THE SELECTED RADIO

LOOP AT SCREEN.

IF screen-group1 = 'MOD'.

screen-intensified = '1'.

screen-active = 1.

screen-display_3d = '1'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'RAD'.

screen-intensified = '0'.

screen-active = 0.

screen-display_3d = '0'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'CAD'.

screen-intensified = '0'.

screen-active = 0.

screen-display_3d = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*CLICK OF SECOND RADIO

IF pb = 'X'.

sscrfields-functxt_02 = 'Sales And Distribution'.

WRITE icon_ws_ship AS ICON TO text_001.

LOOP AT SCREEN.

IF screen-group1 = 'RAD'.

screen-intensified = '1'.

screen-active = 1.

screen-display_3d = '1'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'MOD'.

screen-intensified = '0'.

screen-active = 0.

screen-display_3d = '0'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'CAD'.

screen-intensified = '0'.

screen-active = 0.

screen-display_3d = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*CLICK OF THIRD RADIO

IF pc = 'X'.

sscrfields-functxt_03 = 'Human Resources'.

WRITE icon_new_employee AS ICON TO text_001.

LOOP AT SCREEN.

IF screen-group1 = 'RAD'.

screen-intensified = '0'.

screen-active = 0.

screen-display_3d = '0'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'MOD'.

screen-intensified = '0'.

screen-active = 0.

screen-display_3d = '0'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'CAD'.

screen-intensified = '1'.

screen-active = 1.

screen-display_3d = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*CUSTOMISING THE TOOLBARS OF THE SELECTION SCREEN

*WITH F8 BUTTON DISABLED

APPEND : 'PRIN' TO it_ucomm,

'SPOS' TO it_ucomm,

'ONLI' TO it_ucomm.

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

p_status = sy-pfkey

TABLES

p_exclude = it_ucomm.

**EVENT ON THE SELECTION

AT SELECTION-SCREEN.

  • LIST BOX ONE VALUES

CASE one.

WHEN '1'.

mmtable = 'MARC'.

WHEN '2'.

mmtable = 'MARA'.

WHEN '3'.

mmtable = 'MARD'.

WHEN '4'.

mmtable = 'MARM'.

ENDCASE.

  • LIST BOX TWO VALUES

CASE two.

WHEN '1'.

sdtable = 'VBAK'.

WHEN '2'.

sdtable = 'VBAP'.

WHEN '3'.

sdtable = 'VBUK'.

WHEN '4'.

sdtable = 'VBUP'.

ENDCASE.

  • LIST BOX THREE VALUES

CASE three.

WHEN '1'.

hrtable = 'PA0001'.

WHEN '2'.

hrtable = 'PA0006'.

WHEN '3'.

hrtable = 'PA0022'.

WHEN '4'.

hrtable = 'PA0008'.

ENDCASE.

*VALUES FOR CLICK OF THE PUSHBUTTON ON APP TOOLBAR

*AND ENABLING THE BUTTONS TO PERFORM F8

CASE sscrfields-ucomm.

WHEN 'FC01'.

tablename = mmtable.

sscrfields-ucomm = 'ONLI'.

WHEN 'FC02'.

tablename = sdtable.

sscrfields-ucomm = 'ONLI'.

WHEN 'FC03'.

tablename = hrtable.

sscrfields-ucomm = 'ONLI'.

ENDCASE.

*INITIALIZATION EVENT

INITIALIZATION.

*VALUES ASSIGNED TO DROPDOWNLISTS IN THE SUBROUTINES

PERFORM f4_value_request_pa.

PERFORM f4_value_request_pb.

PERFORM f4_value_request_pc.

*START OF SELECTION EVENT

START-OF-SELECTION.

*SUBROUTINE FOR OUTPUT

PERFORM output.

&----


*& Form f4_value_request_PA

&----


  • text

----


*SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST1

FORM f4_value_request_pa.

DATA: l_name TYPE vrm_id,

li_list TYPE vrm_values,

l_value LIKE LINE OF li_list.

l_value-key = '1'.

l_value-text = 'Plant Data for Material'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '2'.

l_value-text = 'General Material Data'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '3'.

l_value-text = 'Storage Location Data for Material'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '4'.

l_value-text = 'Units of Measure for Material'.

APPEND l_value TO li_list.

CLEAR l_value.

l_name = 'ONE'.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = l_name

values = li_list

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " f4_value_request_tabname

&----


*& Form f4_value_request_PB

&----


  • text

----


*SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST2

FORM f4_value_request_pb.

DATA: l_name TYPE vrm_id,

li_list TYPE vrm_values,

l_value LIKE LINE OF li_list.

l_value-key = '1'.

l_value-text = 'Sales Document: Header Data'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '2'.

l_value-text = 'Sales Document: Item Data'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '3'.

l_value-text = 'Sales Document:Header Status'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '4'.

l_value-text = 'Sales Document: Item Status'.

APPEND l_value TO li_list.

CLEAR l_value.

l_name = 'TWO'.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = l_name

values = li_list

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " f4_value_request_PB

&----


*& Form f4_value_request_PC

&----


  • text

----


*SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST3

FORM f4_value_request_pc.

DATA: l_name TYPE vrm_id,

li_list TYPE vrm_values,

l_value LIKE LINE OF li_list.

l_value-key = '1'.

l_value-text = 'HR Master :Infotype 0001 (Org. Assignment)'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '2'.

l_value-text = 'Address Infotype 0006'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '3'.

l_value-text = 'Education Infotype 0022'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '4'.

l_value-text = 'Basic Pay Infotype 0008'.

APPEND l_value TO li_list.

CLEAR l_value.

l_name = 'THREE'.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = l_name

values = li_list

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " f4_value_request_PC

&----


*& Form OUTPUT

&----


  • text

----


  • -->P_TABLENAME text

----


*fINAL OUTPUT

FORM output.

DATA p_table(10).

p_table = tablename.

*popup to display teh selected table and

*Continue button is clicked

CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

EXPORTING

titel = 'User Selections '

textline1 = p_table

textline2 = 'is the Selected table'

start_column = 25

start_row = 6.

*assigning the table value in p_table to the

  • Table in SE16 transaction by explicitly calling

SET PARAMETER ID 'DTB' FIELD p_table.

CALL TRANSACTION 'SE16'.

ENDFORM. "OUTPUT

With best wishes,

Murthy.

Former Member
0 Kudos

Hi

F1 help on radiobutton.

Regards,

Sravanthi

Former Member
0 Kudos

answered.