SABMiller has agreed a deal to buy Foster's Group for AUD5.1 per share in cash, in a deal valuing the business at AUD12.3bn (US$12.6bn), including debt.