The below code shows how SAPGUI_SET_FUNCTIONCODE is used to call an SAP screen function code. It can also be used to execute a transaction code by using '/o' i.e. '/OSE80'.
Call SAP function code or Transaction CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE' EXPORTING functioncode = '=SAVE'. CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE' EXPORTING functioncode = '/nSE80'. CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE' EXPORTING functioncode = '/oSE80'.