set_focus

Use this static method to set the focus to a custom control.

This method is not queued in the automation queue. Instead it is sent directly to the frontend.

On a screen, only one element can have the focus, be it a control or another kind of screen element such as an input field. The element with the focus is always the one to which the last set_focus method call or SET CURSOR statement was applied.

CALL METHOD cl_gui_control=>set_focus
      EXPORTING  control           = control
      EXCEPTIONS cntl_error        = 1
                 cntl_system_error = 2.

Parameters

Description

control

Object reference ( TYPE REF TO cl_gui_control ) to the control on which you want to set the focus.