ABAP Begin of Block to group selection-screen fields plus add title and frame

The following ABAP code demonstrates how you can arrange your report selection screen fields into separate groups using the selection-screen block statement.

It also shows you how to add a frame / border to each block and how to add a text title to the frame. See example output below.


Basic structure of the syntax
SELECTION-SCREEN Begin of block <blockname>.
...
SELECTION-SCREEN End of block <blockname>.


Additions
WITH FRAME � Adds a frame to the block

TITLE <text symbol> - Adds a title to the frame


Full syntax
SELECTION-SCREEN Begin of block <blockname> WITH FRAME TITLE <text symbol>.
...
SELECTION-SCREEN End of block <blockname>.



Example ABAP Code listing
*&---------------------------------------------------------------------*
*& Report  ZSELSCR_BLOCK.
*&
*&---------------------------------------------------------------------*
*& Group ABAP report selection screen fields into groups using the
*& block statement. This also allows you to add a border frame and title
*&
*& Created by SAPDev
*&---------------------------------------------------------------------*
REPORT ZSELSCR_BLOCK.
* Block 1
* Selection screen block with frame border and title text
* Note: To create text-001 simply double click on it below or use menu
* option Goto->Text Elements->Text Symbols
SELECTION-SCREEN begin of block block1 with frame title text-001.
   PARAMETERS: p_num1 type i.
   PARAMETERS: p_num2 type i.
SELECTION-SCREEN end of block block1.
* Block 2
* Selection screen block with frame border but no title text
SELECTION-SCREEN begin of block block2 with frame.
  SELECT-OPTIONS: so_date for sy-datum.
  PARAMETERS: p_num3 type i.
  PARAMETERS: p_num4 type i.
SELECTION-SCREEN end of block block2.
* Block 3
* Selection screen block with no frame border.
* Note: if you dont have a fram you can't add a title.
SELECTION-SCREEN begin of block block3.
  PARAMETERS: p_num5 type i.
  PARAMETERS: p_num6 type i.
SELECTION-SCREEN end of block block3.
********************************************************************
*START-OF-SELECTION
START-OF-SELECTION

Output result for example ABAP code listing above



Also see selection-screen_block for more info about the syntax of this statament

or Return to Selection Screen home page

Related Articles

Adding buttons to an ABAP report selection screen within SAP
Add buttons to Application toolbar of selection screen
Add buttons with icon to selection screen
Add buttons to dynamically change the selection screen entry fields
ABAP parameter as checkbox plus initiate 'AT selection-screen' EVENT to unselect other checkboxes
Initiate the 'AT selection-screen' EVENT from a checkbox
Dynamically alter a selection screen based on user
SAP dropdown list box for an ABAP report selection screen
Initiate the 'AT selection-screen' EVENT from a LISTBOX within an ABAP report sel screen
ABAP Radiobutton to Initiate the 'AT selection-screen' EVENT on SAP report
Report Selection Screen - Example code and information on various sel screen processing techniques
Selection screen push buttons
F4 search help manually called from report selection screen
Modify Selection Screen(LOOP AT SCREEN)
Restrict select-options to only allow specific restrictions
Radiobutton (inc desc) and entry field on same line of SAP selection screen
Add blank line to SAP report selection screen
Add Tab strip to Selection Screen