At Selection Screen on Block

When we create selection screen begin with block then this block can be handled by this event AT SELECTION SCREEN ON BLOCK. All the block elements are passed from the selection screen to the ABAP. In the following example we have created two blocks and apply this event on the first block. If the event is triggered with error message then the second block gets disabled.

TABLES ekpo.

  PARAMETERS p_bsart TYPE ekko-bsart.
  SELECT-OPTIONSs_ebeln FOR ekpo-ebeln,
                  s_ebelp FOR ekpo-ebelp.

              r_cls RADIOBUTTON GROUP g1.
  SELECT-OPTIONS s_date FOR ekpo-abdat.

  IF p_bsart   IS INITIAL AND
     s_ebeln[] IS INITIAL.
    MESSAGE 'Enter PO or Type' TYPE 'E'.

At the first block it is mandatory to enter PO or PO type. Without entering this we have executed the program.

The first block is completely enabled whereas the second block is completely disabled.