sapdev logo background
sapdev logo sapdev logo
Comments

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






comments powered by Disqus