The retired footballer will join David Jason and Nicholas Lyndhurst who are reuniting for the first time in ten years as part of BBC1's Sport Relief night in March.
David Beckham will appear with 'Only Fools And Horses' characters Del Boy and Rodney
It's not the first time Beckham has taken part in comedy sketches for charity. He also appeared in a 2012 spoof that saw him and James Corden share a bath and cuddle up together in bed.
The 'Only Fools And Horses' 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.
Viewers will see the short film during the broadcast on Friday 21 March. The evening will also feature a 'Strictly Come Dancing' special featuring a number of sporting stars.