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

radio button

Former Member
0 Likes
606

hi,

i hav two radiobuttons on selection screen.

1 for alv list display & 2 nd for grid display.

can i hv cod for defining and handling this.

5 REPLIES 5
Read only

Former Member
0 Likes
585

Hi,

try like below......

PARAMETERS : rb1 RADIOBUTTON GROUP rad USER-COMMAND com,
             rb2 RADIOBUTTON GROUP rad.

START-OF-SELECTION.

  CASE 'X'.
    WHEN rb1.
      PERFORM grid_display.
    WHEN rb2.
      PERFORM list_display.
  ENDCASE.

form grid_display .
*******write ur code here for grid***********
endform.                    " grid_display

form list_display .
*******write ur code here for list***********
endform.                    " list_display

Cheers,

jose.

Read only

former_member576008
Active Participant
0 Likes
585

Hi..!

here is the code you requested.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : ALV RADIOBUTTON GROUP DISP USER-COMMAND U1 DEFAULT 'X',

GRID RADIOBUTTON GROUP DISP.

SELECTION-SCREEN END OF BLOCK B1.

START-OF-SELECTION.

IF ALV = 'X'.

**************DO ALV REPORTING*******

ELSE

**************DO GRID REPORTING*******

ENDIF.

regards

Nandha Kishore.K

Edited by: Nandha Kishore K on Feb 29, 2008 6:56 AM

Read only

dhruv_shah3
Active Contributor
0 Likes
585

Hi,

put a condition for displaying the reports.

IF rbt1 eq 'X'

perform display_alv_list_display.

else.

perform display_alv_grid_display.

endif.

here rbt1 is the name of the Radiobutton and = 'X' means if that radio button is selected then list display report will be executed Else Grid Display report Will be Executed.

HTH,

Regards,

Dhruv Shah

Read only

Former Member
0 Likes
585

Hi Sangeetha,

Its very simple.

If RB_1 eq 'X'.

populate all the relevant structure like layout, fieldcatelog as per LIST

Call FM for List display.

elseif RB_2 eq 'X'.

populate all the relevant structure like layout, fieldcatelog as per GRID

Call FM / method for Grid display.

endif.

Hope this helps.

Manish

Read only

Former Member
0 Likes
585

Hi sangeetha,

  • First store the data into your internal table by select from database table.

  • In your selection screen place the two radio buttons like this.

Parameters:
  list   radiobutton group rad1 default 'X',
  Grid radiobutton group rad1.

  • After that write the code like this.

AT SELECTION-SCREEN.

if list eq 'X'.
   give your internal table to list display function module.
else.
  if gird eq 'X'.
  give your internal table to grid display function module.
endif.
endif.

Reward if it is useful,

Mahi.