its_ping Function 
You use the its_ping function to check whether a transaction has been called by the ITS or in dialog mode from the SAP GUI.
Syntax
its_ping
If its_ping determines that a transaction is called in dialog mode from the SAP GUI, it raises the exception its_not_available.
Syntax
form check_its.
call function ‘its_ping’
exceptions
its_not_available = 1
others = 2.
if sy-subrc = 0.
* perform ITS-specific processing
else.
* perform SAP GUI-specific processing
endif.
endform.