What Does FLUSH Mean?
FLUSH is a method used in the SAP ABAP class cl_gui_cfw. It is mostly used for Graphical User Interface (GUI) communications. This method plays an important role during the communication between ABAP objects, control framework and automation controllers. Another use of the FLUSH method comes with JavaBean communications used in SAP Business Server Pages applications. FLUSH also may be used to pass importing parameters from generated proxies to an associated Java server.
Techopedia Explains FLUSH
While using the object-oriented approach, a call to control method of any ABAP class does not mean the automatic execution of the same at runtime. A SAP system buffers all the methods in an automation queue, which is used in SAP to reduce the number of used remote function calls. The ABAP program then picks up the methods from this queue, ensuring no alterations to the methods’ execution sequence. These methods are executed only if they are transferred by using the FLUSH methos via remote function call to the front end. In other words, FLUSH determines the synchronization point for the whole process.
The main advantage of using the FLUSH method to communicate with a Java server is that a request is not provided each time a JavaBean is provoked. This helps improve the performance of the involved systems.
If an error occurs while transferring the methods from the automation queue to the front end, exceptions are triggered in the FLUSH method. In most cases, it is not possible to identify the error from the provided exception. To identify proper errors, the tools provided in SAPGUI and SAP debugger are used.