FRANKFURT, July 14 (Reuters) - Software AG is buying IT consultancy IDS Scheer for an agreed 487 million euros ($681 million) in what will be the first major corporate takeover in Germany this year.