He will appear in a sketch of the sitcom to be screened as part of BBC1's Sport Relief night in March.
The Only Fools sketch sees Sir David Jason and Nicholas Lyndhurst reviving their roles as the wheeler-dealer Trotter brothers for the first time since a Christmas special in 2003.
Beckham is seen sitting with the duo in a greasy spoon cafe, gathered around a table on which there is a copy of the Peckham Echo.
The footballer, however, is not the only A-Lister to feature on a TV show. Here is our list of top 10 cameos -
Geri Halliwell, Sex and the City
Former Spice Girl Geri Halliwell surprised everyone with a cameo in the hit series Sex and the City.
The singer played receptionist Phoebe Kittenworth, an old frenemy of Samantha Jones in the show.
Her brief on-screen appearence, however, was somewhat cringeworthy.
Perhaps she should stick to being Ginger Spice.
Brad Pitt, Friends
The producers of Friends had us all in stitches when they brought Brad Pitt on the show as a former classmate of his then wife Jennifer Aniston.
Playing Will Colbert in a Thanksgiving episode, The One with the Rumour, Pitt joked that he and Ross Gellar, played by David Schwimmer, ironically started a club in High School in honour of Jennifer's character Rachel Green, known as the "I hate Rachel Club."
Stella McCartney, Absolutely Fabulous
Fashion designer Stella McCartney played herself in a cameo when Absolutely Fabulous returned to our screens for a Christmas special back in 2011.
Stella was involved in a skit with characters Edina (Jennifer Saunders) and Patsy (Joanna Lumley) who visited her shop.
The Christmas special also featured cameos from Emma Bunton and Dame Kelly Holmes.
Johnny Depp, The Vicar of the Dibley
Dawn French aka The Vicar of Dibley is one lucky woman. For Hollywood hunk Johnny Depp appeared on the show.
The non conventional actor appears in the episode entitled 'Celebrity Party', and the vicar Geraldine, played by French, invites him and other celebs to a party she is hosting because the BBC are doing a documentary about the village.
Only problem is the party takes place in the dark, and one of the villagers David does not believe it happened until he is quickly corrected.
Kylie, Dr Who
She made her name as Charlene in Neighbours, so acting comes a lot easier to Kylie than perhaps other singers.
The pint-sized star appeared in an episode of Dr Who with David Tennant as the doctor.
She played waitress Astrid Peth who assisted with the doctor to prevent an immiment collision with earth.
Victoria Beckham, Ugly Betty
Victoria Beckham was making cameo appearances long before her husband David.
For the fashionista appeared in an episode of Ugly Betty called, "It's a nice day for a Posh wedding."
Posh played herself in the show and was maid of honour to Vanessa Williams' character Wilhelmina, who was getting married in the episode.
Eventually she was locked up in a closet by Wilhelmina because she was worried Posh would steal the show at her wedding.
Kim Kardashian, CSI: New York
Is there anything Kim Kardashian can't do? The socialite made her acting debut with a cameo in CSI: New York.
She played a femme fatale whose fiance is supected of murder until the suspicion falls on her.
Britney Spears, How I Met Your Mother
Pop princess Britney Spears took on the role of a secretary at a dermotologist's office in hit show How I Met Your Mother.
In the episode, her character Abby falls for Ted, played by Josh Radnor.
James Franco, 30 Rock
James Franco appeared in 30 Rock as himself. The actor entered a fake relationship with Jenna, played Jane Krakowski in order to counteract rumours that he was in love with a Japanese body pillow.
Only on 30 Rock.
Sir Ian McKellen, Coronation Street
From Gandalf in the Lord of the Rings to a dodgy novelist in Coronation Street, did anyone see that coming?
Sir Ian McKellen took to the cobbles of Weatherfield to potray Mel Hutchwright in the soap.
Prince, New Girl
And finally, the purple one is expected to appear in hit US sitcom New Girl.
The singer contacted the show's producers to ask for a guest spot because he is such a big fan.
This one, we can't wait to see.