How to check if program is running in WebUI

Problem: you want to know if program was executed in WebUI or SAP GUI.

Solution: to check this simply check result of the IS_ACTIVE method of class CL_CRM_BTIL, like so:

IF cl_crm_btil=>is_active( ) = abap_true.
  WRITE 'Executed in WebUI'.
ELSE.
  WRITE 'Executed in SAPGUI'.
ENDIF.
IF cl_crm_btil=>is_active( ) = abap_true.
  WRITE 'Executed in WebUI'.
ELSE.
  WRITE 'Executed in SAPGUI'.
ENDIF.

Komentowanie jest zakończone.