Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
Showing results for 
Search instead for 
Did you mean: 
Active Contributor
At vendor master screen enhancement, I create several customized screens to achieve the below purposes:

  • Screen 100- The main screen holds 1st/2nd level key fields along with Vendor no. and purchase org, provides buttons to create/modify/view address, etc.

  • Screen 200- Single address maintenance screen

  • Screen 300-View already maintained addresses using grid refer to cl_gui_alv_grid

Switching between screens:

  1. Button 'Create/Modify Address' will call screen 200 to support single address maintenance.

  2. Button 'View Address' will call screen 300 to display lists of already maintained addresses.

  3. Call screen 200 when double-click a single line at screen 300, and the user can modify already existed address details at 200 and click return then get back to screen 300.

Now the issue is:

At above point 3, the newest modification at screen 200 will not be reflected when back to screen 300 (already update the global data used by ALV grid at screen 300), now an extra 'Refresh' button has been created to achieve this refreshment. But it's quite annoying and not user-friendly. Many very similar issues had been brought out like the below questions:

I try the below approaches:

Call Method grid->refresh_table_display

  • Call refresh method at end of double click Event for screen 300 is triggered, but not working.

  • Call refresh method at PAI of screen 200 is triggered, but not working.

  • Call refresh method at PBO of screen 200 is not triggered at all.

Call method cl_gui_cfw=>flush

  • Call this method along with refresh_table_display is not working

LEAVE TO SCREEN 300 at return button of screen 200

  • using LEAVE TO SCREEN 300 instead of LEAVE TO SCREEN 0 will call another 300 with the initial screen and conflict with the original 300~ 

Call method set_new_ok_code

  • call the below code at the return button and no refresh as well~

        CALL METHOD cl_gui_cfw=>set_new_ok_code
new_code = 'REFRESH'.
CALL METHOD cl_gui_cfw=>flush.


  • call the below code at the return button and it's working!!!

functioncode = 'REFRESH'
function_not_supported = 1

The documentation for this FM:

This module simulates user input in the command field. This enables you
to run screen sequences without user input.


A screen contains a single output field:
Counter ____

with the field reference "count".

This field is changed in the single flow logic module:

process before output.
module pbo.

and the default function code "=" is processed:

module pbo output. add 1 to count. if count > 20.
leave to screen 0.


Since the function SAPGUI_SET_FUNCTIONCODE is not implemented for all
front end platforms, you may need to use a substitute solution. For

call function 'SAPGUI_SET_FUNCTIONCODE' exporting functioncode = 'ABCD'
exceptions function_not_supported = 1.
if sy-subrc <> 0. suppress dialog. endif. "For Motif etc.

One blog explains how to force Enter event by using this FM.

I'm not a master of the screen painter, please kindly let me know if any wrong 😄