The 50-year-old, who plays Alfie Moon in the BBC One soap, confessed to the awkward moment while appearing on The Graham Norton Show special for EastEnders' 30th anniversary.
He said: "It was when viagra had just come out and we all took one – we were told they would take 20 minutes to work so I popped a pill at the end of the day.
"Just as I was on my way out the director said, 'We need to shoot a scene again.' All the men filmed the scene pressed very close to the bar."
Shane also revealed that Alfie wasn't supposed to end up marrying Kat Slater initially.
Instead he was brought in as a toy boy for Peggy Mitchell!
He said: "When I started the show I heard a rumour that I was brought in as a love interest for Peggy, they were going to do this 'Cougar' story, but then they saw the chemistry between Jessie [Wallace, who plays Kat] and me and th writers said, 'Let's make this a slow burner'."
Shane and Jessie appeared on the show with June Brown, John Altman, Danny Dyer, Kellie Bright, Pam St Clement, Letitia Dean and Adam Woodyatt.
The special episode will be screened on Monday at 10.45pm on BBC One.