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: 

ALV grid display issue from radio buttons

abhijnansaha
Explorer
0 Kudos

Hello,

I have a radio button group in a selection screen. On select of the first radio button, I display an ALV grid below the radio button group.

On selecting the next one, I want the grid to disappear which isn't happening currently.

Please help.

Thanks and Regards,

Abhijnan

8 REPLIES 8

Former Member
0 Kudos

May i know how you are using

kesavadas_thekkillath
Active Contributor
0 Kudos

You mean the old data is not getting refreshed ? Please let us know what you have coded. Post only the relevant parts.

abhijnansaha
Explorer
0 Kudos

Hello,

When I am selecting the second radio button, I would like the ALV already generated due to the selection of the first to go off from the screen.

I am creating ALV using SET_TABLE_FOR_FIRST_DISPLAY.

Hope the scenario is clear. Kindly let me know if its not.

Thanks and regards,

Abhijnan

0 Kudos

Please check if this is what you needed or something else


DATA: obj TYPE REF TO cl_gui_alv_grid,
      repid TYPE sy-repid,
      entered TYPE c,
      lv_structure TYPE tabname,
      dock TYPE REF TO cl_gui_docking_container,
      i_mara TYPE TABLE OF mara,
      i_marc TYPE TABLE OF marc.

FIELD-SYMBOLS:<fs_tab> TYPE table.

PARAMETERS: p_matnr TYPE matnr.
PARAMETERS: p_mara RADIOBUTTON GROUP a USER-COMMAND abc.
PARAMETERS: p_marc RADIOBUTTON GROUP a.

AT SELECTION-SCREEN OUTPUT.
  CHECK NOT p_matnr IS INITIAL.
  IMPORT entered from memory id 'E'.
  CHECK NOT entered IS INITIAL.
  CHECK dock IS INITIAL.
  repid = sy-repid.
  CREATE OBJECT dock
       EXPORTING
         repid = repid
         dynnr = sy-dynnr
         ratio = 80
         side  = cl_gui_docking_container=>dock_at_bottom
         name  = 'DOCK_CONT'.
  CHECK  obj IS INITIAL.
  CREATE OBJECT obj
  EXPORTING
  i_parent          =  dock.
  IF p_mara = 'X'.
    IMPORT i_mara FROM MEMORY ID 'IMARA'.
    FREE MEMORY ID 'IMARA'.
    lv_structure = 'MARA'.
    ASSIGN i_mara TO <fs_tab>.
  ELSE.
    IMPORT i_marc FROM MEMORY ID 'IMARC'.
    FREE MEMORY ID 'IMARC'.
    lv_structure = 'MARC'.
    ASSIGN i_marc TO <fs_tab>.
  ENDIF.
  CALL METHOD obj->set_table_for_first_display
  EXPORTING
  i_structure_name = lv_structure
  CHANGING
  it_outtab = <fs_tab>.


START-OF-SELECTION.

  entered = 'X'.
  EXPORT entered TO memory ID 'E'.
  IF p_mara = 'X'.
    SELECT * FROM mara UP TO 100 ROWS INTO TABLE i_mara
             WHERE matnr = p_matnr.
    EXPORT i_mara TO MEMORY ID 'IMARA'.
  ELSE.
    SELECT * FROM marc UP TO 100 ROWS INTO TABLE i_marc
           WHERE matnr = p_matnr.
    EXPORT i_marc TO MEMORY ID 'IMARC'.
  ENDIF.

Former Member
0 Kudos

Hi Abhijnan,

Firstly in the initial case you are calling SET_TABLE_FOR_FIRST_Display FM to display ALV , To implement the logic use call this FM only when first radio button is selected , Like in PBO of screen check which radio button has been selected an dbased on that build the screen in PBO and dont call that FM in second radio button case.

Former Member
0 Kudos

hI,

you calling the function module for the both condition.....call the fm only when p_mara = 'x' within If condition

if condition fails automatically grid will be disapper from selection screen.

thanks...

Former Member
0 Kudos

Hi,

you must have created a subscreen to display ALV grid right. You create another empty subscreen and call that subscreen when the user select the second radio button.

thanks and regards.

Aswath

Former Member
0 Kudos

it should be used in the AT SELECTION-SCREEN OUTPUT.

For ex:

IF Radio_button1 = 'X'.

ASSIGN i_tab TO <fs_tab>.

ELSE.

clear <fs_tab>.

ENDIF.