Import SIH using Web Services

Hi all, as you can read i'm trying to import an invoice in my Sage X3 V9 PATCH 6 using Web Services, in my specific script(SPESIH) there is an action that i don't want to perform if i'm importing using web services.

I wonder if there is a method to do so or if there a specific condition that i can put in an if like IF (NOT_FROM_WEB_SERVICE) THEN (DO SOMETHING).