SAP extended its lead as Europe’s most valuable company after the business-software company’s stock saw its best surge in six years.