Skip to Content
author's profile photo
Former Member

ALV with radiobutton and checkbox

hi to all,

can anyone tell me how to write the code.....i have written one ALV report useing likp, lips , mara ,vbak.

and i wanted to get another report in the same selection screen using with tables vbap,vbak,MARA,mbew.

finally my question in brief.....IN ONE SELETION SCREEN I WANT TO GET DIFFERENT REPORTS USING WITH CHECKBOXS AND RADIO BUTTONS IN ALV...tell me how....

raju..

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Oct 04, 2005 at 08:23 AM

    Hi

    I can't understand your question: you want to choose the report in the selection-screen or in ALV.

    Max

    Add comment
    10|10000 characters needed characters exceeded

    • selection-screen:begin of block1

      give selection parameters for 1st report.

      end of block1

      select screen being of block2

      give selection parameters of 2nd report.

      end of block.

      parameters:p_reg radiobutton group ropt,

      p_spl radiobutton group ropt.

      start of selection.

      g_repid = sy-cprog.

      if p_reg = 'X'.

      perform get_report_data1.

      elseif p_spl = 'X'.

      perform get_report_data1.

      endif.

      perform comment_build using gt_list_top_of_page[].

      perform comment_user_build using gt_list_top_of_page[].

      internal_tablename = 'ITABREP'.

      perform build_fieldcatalog using 'I' fieldcat[].

      internal_tablename = 'ITABOFFER'.

      perform build_fieldcatalog using 'I' fieldcat1[].

      perform adjust_fieldcat using fieldcat[].

      perform display_alv_itab.

      form display_alv_itab.

      g_repid = sy-cprog.

      if p_reg = 'X'.

      call function 'REUSE_ALV_GRID_DISPLAY'

      exporting

      • i_background_id = 'DAK'

      i_callback_program = g_repid

      i_callback_user_command = g_user_command

      i_callback_top_of_page = g_top_of_page

      it_fieldcat = fieldcat

      is_layout = gs_layout

      i_save = g_save

      is_variant = gs_variant

      it_events = gt_events

      importing

      e_exit_caused_by_caller = g_exit_caused_by_caller

      es_exit_caused_by_user = gs_exit_caused_by_user

      tables

      t_outtab = itabrep

      exceptions

      program_error = 1

      others = 2.

      elseif p_spl = 'X'.

      call function 'REUSE_ALV_GRID_DISPLAY'

      exporting

      • i_background_id = 'DAK'

      i_callback_program = g_repid

      i_callback_user_command = g_user_command

      i_callback_top_of_page = g_top_of_page

      it_fieldcat = fieldcat1

      is_layout = gs_layout

      i_save = g_save

      is_variant = gs_variant

      it_events = gt_events

      importing

      e_exit_caused_by_caller = g_exit_caused_by_caller

      es_exit_caused_by_user = gs_exit_caused_by_user

      tables

      t_outtab = itaboffer

      exceptions

      program_error = 1

      others = 2.

      endif.

      endform. " display_alv_itab

  • Oct 04, 2005 at 08:37 AM

    Hi,

    U keep two check box or radiobuttons like

    PARAMETERS: cb_1 AS CHECKBOX,
                cb_2 AS CHECKBOX.

    Then u can use this and change the layout for the two different output screens in the same screen itself.

    DO that like

    IF cb_1 = 'X'.
      perform....
    ENDIF.
    
    IF cb_2 = 'X'.
      perform....
    ENDIF.

    No need for two screens in the same screen u can change the layout and pass the different output structure in the same screen depending upon the selection made.

    Hope u got it.GEt back if not.

    Add comment
    10|10000 characters needed characters exceeded