The Manchester City midfielder retired from international duty after the World Cup this summer, but his feats will be celebrated at the Estadio de Gran Canaria on November 18.
Although the fixture will not count as an official international appearance, Silva will be rewarded with a special cap by UEFA to mark his 100-plus games for his country.
Silva, who scored 35 times in 125 caps, won the 2010 World Cup as well as the 2008 and 2012 European Championships with Spain.
"November 18 will be a special day for all," said Spanish FA president Luis Rubiales at the launch event for the game.
"Remember that many players from this island have represented the national team."
"As well as Bosnia and Herzegovina, Spain travel to Croatia three days prior in the Nations League.