A Wemyss Bay man is to stand trial charged with sending messages of a sexual nature to undercover police officers he believed to be 13-year-old girls.