I came to this bustling university town to check in on two celebrated German companies -- software giant SAP and Heidelberger Druckmaschinen, the printing press maker -- that remain global leaders in their industries. What I found helps explain why Germany, along with much of Western Europe, is in such an economic funk.

Heidelberg Press reflects all the traditional strengths of Germany's manufacturing sector. Over its 150 years, it has grown and flourished in both domestic and foreign markets not as a result of any technological breakthrough, but through incremental improvements in product design and production methods. The quality of its engineering and workmanship is unmatched, thanks in part to an elaborate apprenticeship system and a determination to produce almost everything in-house. And until just this year, Heidelberg has been controlled by patient private owners willing to invest in research and new technology.

Most significantly, Heidelberg is in a low-volume industry with a limited number of buyers and only a handful of competitors. As a result, it could command high profit margins, which it shared with owners in generous dividends and with workers in above-average wages, six weeks of vacation a year and twice-yearly bonuses.

In the past few years, however, Heidelberg has been reeling. A worldwide recession has combined with a long-term decline in demand, reflecting the Internet's impact on a printing industry now in the midst of rapid consolidation. The recent 30 percent decline in sales has forced the company to post its first loss in decades and eliminate its dividends. Two divisions have been sold off, operations streamlined and work outsourced, cutting the payroll by nearly 10,000, while workers who remain have agreed to measures cutting their pay by up to 30 percent. And while Heidelberg's apprentice program continues, most of its graduates have to find jobs elsewhere.

In Heidelberg's story is a hard truth facing many proud German companies: They dominate stagnant or declining market categories with shrinking margins that can no longer generate new jobs or ensure middle-class lifestyles for workers.

That's not the case, of course, at SAP, which is fast becoming the Microsoft of business software. Having taken an early lead with its network server architecture in the mid-1990s, SAP has grown into a $9 billion behemoth offering entire suites of applications, often tailored to particular industries, that manage cash flow, supply chains, customer relations and other functions. And while many of its smaller rivals are now reeling from declining industry sales, SAP last year managed to expand margins and market share while doubling profit.

How does it do it? Basically, by not running itself like a German company. Its founder and guiding light, Hasso Plattner, is a flamboyantly un-German manager who abhors formality and hierarchy and early on decided to split his time between Germany and Silicon Valley. Its top management team communicates in English and includes executives from France, Israel, New Zealand and the United States. Adopting a don't ask, don't tell approach to the official 35-hour workweek, SAP employees work however long it takes to get their jobs done. And for most, a chunk of their pay is based on individual, group or company performance -- an oddity in a country where pay is set in nationwide pattern bargaining.

Unlike many American software companies, SAP never sells a product it hasn't yet produced and tested, but unlike German competitors, it is not shy about marketing them once it has. And while thousands of SAP engineers work in the United States, China, India and Bulgaria, it's hard to call it offshoring since SAP is one of those truly global companies that has no "shores."

What SAP proves is that German workers can be as smart, hard-working and creative as workers anywhere. Yes, government can help by lowering taxes and making labor laws more flexible. But it will all be for naught if German managers and workers don't figure out how to re-create a business culture better suited to service industries and a fast-moving global marketplace.

Steven Pearlstein can be reached at pearlsteins@washpost.com.