Terminating the Connection to R/3 

The client application initiates termination by calling It_Logoff. A subsequent call to It_GetEvent will return an event of type EVT_END_OF_SESSION. On receipt of this message, the client should not make any further SAP Automation GUI calls, as the subsystem has terminated.