Skip to Content
0
Former Member
Jan 26, 2009 at 10:52 PM

Supress selection-screen icon, screen 1001

107 Views

Hello all,

The following code will supress selection-screen (1001) EXECUTE icon.

*
*
include rsdbc1xx.      " selection screen stuff
*
*
data: l_alv      type ref to   cl_gui_alv_grid,
      lt_sflight type table of sflight.
*
* Global table of function codes to disable
data: lt_exclude  type standard table of syucomm.
*****************************************************************
parameters: p_nuthin as checkbox.
*****************************************************************
*
*----------------------------------------------------------------------*
selection-screen begin of screen 1001.
selection-screen end   of screen 1001.
*----------------------------------------------------------------------*
*
*at selection-screen output.
**
*  if sy-DYNNR = `1001`.
**
** disable functions:
**         Online execution
*  append 'ONLI' to current_scr-excl.   "Execute
**         Online execution & Printing
*  append 'PRIN' to current_scr-excl.   "Execute and print
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* events at selection-screen output.
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*
at selection-screen output.
*
  if sy-dynnr = '1001'.
    current_scr-mode = 'S'.
*                                        disable functions:
    append 'SPOS' to current_scr-excl.
    append 'SCRH' to current_scr-excl.
    append 'ONLI' to current_scr-excl.    "Online execution
*    APPEND 'PRIN' TO current_scr-excl.   "Execute and print
  endif.
*
******************************************************************
  if sy-tcode eq 'ZZREPORT'. " Replace with your own transaction code

*
    append 'GET'  to lt_exclude.  " Get variants function code

    call function 'RS_SET_SELSCREEN_STATUS'
      exporting
        p_status  = sy-pfkey
        p_program = sy-cprog
      tables
        p_exclude = lt_exclude.
*
  endif.
*

*
start-of-selection.
*
  select * from sflight into table lt_sflight.
* Creation of the ALV object, when we use cl_gui_container=>screen0 as
* parent, the ALVGrid control will automatically use the full screen to
* display the grid, NO CONTAINER DEFINITION IS REQUIRED !
  create object l_alv exporting i_parent = cl_gui_container=>screen0.
*
*  Set layout options:
  data: l_layout type lvc_s_layo.
*
  l_layout-zebra      = 'X'.
  l_layout-sel_mode   = 'D' .             "  D = cell selection
*
* calling the display of the grid, the system will automatically create
* the fieldcatalog based on the table name you pass in parameter
*
  call method l_alv->set_table_for_first_display
    exporting
      i_bypassing_buffer = 'X'
      is_layout          = l_layout
      i_structure_name   = 'SFLIGHT'
    changing
      it_outtab          = lt_sflight.
*
*
* You have to create an EMPTY screen, put NOTHING on it
*
  call selection-screen 1001.

Thanks

Bruce

Edited by: Bruce Tjosvold on Jul 30, 2009 3:35 PM

Edited by: Bruce Tjosvold on Jul 30, 2009 3:39 PM

Edited by: Bruce Tjosvold on Jul 30, 2009 3:40 PM