The Germany international will leave the professional game when his Borussia Dortmund contract expires at the end of the season.