* Company sees margins flat in Q4, recovery in 2018
* Raises midpoint of 2017 revenue, profit guidance
* Q3 revenue 5.59 bln euros, misses consensus for 5.71 bln
* Q3 core profit 1.64 bln euros, just below forecasts (Writes through with management outlook, analysis, details)
FRANKFURT/LONDON, Oct 19 (Reuters) - SAP, Europe's most valuable technology company, missed market expectations for third-quarter profit as it invested heavily to shift business customers into cloud computing.
The German software maker is in the midst of a transition to offering cloud-based services to its business customers and management had flagged that 2017 would see a trough in profit margins as it invested in datacenters and redeployed staff.
SAP shares fell 1.6 percent in early Frankfurt trading, even as management slightly raised its full-year guidance for revenues and core profits, and forecast a recovery going into next year.
The company has a "very good shot" at stabilising margins in the fourth quarter, Chief Financial Officer Luka Mucic told a conference call with reporters. "Going into 2018 we see a margin turnaround."
Revenue for the German business planning software provider grew 8 percent to 5.59 billion euros ($6.6 billion) from a year earlier, falling short of the mean forecast of 5.71 billion euros from 16 analysts surveyed by Reuters.
Core profit excluding special items rose by 4 percent to 1.64 billion euros at constant currency rates, SAP said, below the 1.69 billion euros expected by analysts in a Reuters poll.
The euro's strength sliced 4 percentage points off core profits, which was flat after taking currency moves into account. Analysts at Baader Helvea said they expected currency headwinds to continue for the next three quarters.
The company nudged up guidance for the full-year core operating profits to 6.85-7.0 billion euros and said 2017 total revenue would range from 23.4-23.8 billion euros, marking year-to-year growth around 6-8 percent, excluding currency effects.
At Wednesday's close, the company was valued at $137 billion, and its shares remain near record highs set in June.
IN THE CLOUD
Cloud subscriptions and support revenue rose 27 percent in the third quarter to 938 million euros, excluding currency effects, compared with the 29 percent analysts had expected, on average.
This was offset by its classic software license and support business revenue, which rose 4 percent to 3.72 billion euros, slightly above the 2.2 percent growth rate expected by analysts.
Chief Executive Bill McDermott was bullish for the fourth quarter: "We are gaining share against our competitors. SAP is growing faster in the cloud - and we are doing it organically," McDermott said during a conference call, contrasting the acquisition-fuelled growth of rivals.
Competitors such as Salesforce.com, Workday and Amazon.com's web services unit, offer cloud-only services, challenging legacy businesses of SAP and its long-time rival Oracle, which are both making big cloud bets.
The key question for investors is whether a tipping point is indeed at hand for SAP to return to delivering consistent growth in profit margins late this year or during 2018.
That would reverse five years of declining growth in core profit margins as the company spent heavily to shift its business into the cloud instead of relying on traditional software license sales for its suite of business planning tools.
"We think the key investor debate on SAP today is around margins is there operating leverage at SAP after a period of heavy investment or is the move to cloud structurally negative for margins?" Morgan Stanley said ahead of the quarterly report.
SAP management has signalled that its rapid employee expansion since 2015 should slow in coming quarters as its cloud -focused hiring spree runs its course. ($1 = 0.8475 euros) (Reporting by Douglas Busvine and Eric Auchard; Editing by Tom Pfeiffer and Keith Weir)