SAP told investors not to expect a major improvement in margins before next year as the German business software group reported a 21% decline in second-quarter operating profit on Thursday, sending its shares sharply lower.