By
Published: 18 Feb 2004
To set a function code by program (without user action), you can use the function module SAPGUI_SET_FUNCTIONCODE. this function sets the code and executes it. eg. in the program the HELLO WORLD is shown and afterwards the program returns to the selection screen.
REPORT ztestjcr.
PARAMETERS: p.
START-OF-SELECTION.
WRITE: 'Hello world'.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode = 'BACK'
EXCEPTIONS
function_not_supported = 1
OTHERS = 2.
Dig Deeper on SAP development and programming languages