Calling theflush method only updates the automation queue if the queue contains return values.
If you have a queue with no return values, and want to ensure that it is synchronized, you can use the Control Framework methodCL_GUI_CFW=>UPDATE_VIEW . You should only use this method if you absolutely need to update the GUI. For example, you might have a long-running application in which you want to provide the user with regular updates on the status of an action.
CALL METHOD cl_gui_cfw=>update_view
EXCEPTIONS CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2.