RFC_INVALID_HANDLE error in SAP Adapter

we are trying to receive an IDOC from SAP but we get the above error in our trace files. The test connection to the SAP server works and so does the listener connection.

SM59 transaction on SAP side also does not give a error and the IDOCS are being submitted to the port.

Any clues?

thanks in advance