DEERFIELD, Ill. A still-moribund economy, weak consumer demand at the front end of the store and an easing of the flu epidemic all combined to put the brakes on same-store sales momentum at Walgreens in the second quarter. But tight cost controls and a more disciplined approach to purchasing and promotions at the front end helped propel a 4.6% gain in net earnings for the period ended Feb. 28, Walgreens reported Tuesday morning.

The nation’s top drug chain earned $669 million on sales of $17 billion for the quarter. That marked a 3.1% rise in total sales over the same period a year ago, but sales in comparable stores — those open at least a year — actually declined 0.2% in the second quarter, Walgreens reported. Comparable-store sales at the front end fell by 1.6% from year-ago levels.

Walgreens blamed the front-end same-store sales decline on “continued weak demand for discretionary goods and by lower demand for cough, cold and flu-related products, compared with the year-ago quarter.” Also troubling for the company — which reported a 4.9% year-over-year gain in same-store sales in the previous quarter — was a flattening of sales trends at the pharmacy counter. Total prescription sales rose 3.2% in the second quarter and accounted for 63.3% of sales, but comp-store prescription sales were up just 0.6%, versus the same period a year ago.

The slowdown in sales momentum at the pharmacy counter came despite a 6% increase in the number of prescriptions filled in the second quarter versus the same period last year, and increases in the number of patients filling 90-day prescriptions in Walgreens pharmacies.

Nevertheless, said president and CEO Greg Wasson, “During the quarter we continued to make progress in executing our key strategies for growth. We generated significant cash flow, despite the impact of a sluggish economy and lower-than-anticipated sales of flu-related products.”

At the front end of the store, he said, “We made a strategic decision to buy less seasonal inventory, which led to fewer markdowns and helped strengthen our margins. We continue to have a relentless focus on cost reduction and cash flow, allowing us to make strategic investments and return $656 million in cash to shareholders in the first half of the fiscal year through a combination of share repurchases and dividends.”

Walgreens is building a solid foundation for future profitability and industry leadership as a full-service health and wellness provider, Wasson asserted in a conference call with investment analysts this morning.

That leadership will come, he and other executives said, through ongoing and wide-ranging improvement initiatives like the “Rewiring for Growth” initiative — which company leaders predict will save Walgreens roughly a half-billion dollars in fiscal 2010 and $1 billion next year — and the expansion of the Customer Centric Retailing initiative to more stores. CCR has spawned a massive reduction in store inventories, a streamlined and easier-to-find assortment and a new, more open store design, set for early rollout beginning this month, that features improved sightlines, product adjacencies and signage, and more appealing graphics.

“During the quarter, Walgreens continued to make solid progress in executing its three core growth strategies — to leverage the best store network in America, enhance the customer experience and drive cost reductions and productivity gains,” Wasson noted. Walgreens’ CCR initiative continues to progress, the company reported today, and is now featured in nearly 700 of the company’s 7,180 drug stores. The company said it remains on track to have the new format in 2,500 to 3,000 stores by the end of fall 2010.

“Shoppers are reacting positively to our CCR format,” said Wasson. “As we’ve said before, this is an ongoing process with many checkpoints along the way to allow us the opportunity to tweak and refine as needed. As we move into the next phase, we’ll continue to build sales, take work out of stores, lower inventory and most importantly, improve our customers’ overall shopping experience.”

A prime CCR objective, he added, is to prompt customers to spend more in the store with each trip.

Walgreens’ CEO also revealed that CCR has already led to a significant reduction in redundant store items at the front end. “The further we get through the SKU reduction — and we’re about 85% done now — the easier it will be to roll this out going forward,” he said in this morning’s conference call.

Walgreens also reported progress on other fronts as it continues its massive overhaul. During the second quarter, the company restructured its healthcare divisions to support its integrated “Pharmacy, Health and Wellness Solutions” offering to employers, managed care organizations, pharmacy benefit managers and government clients.

“In the past several years, we’ve developed a broad set of quality, affordable and accessible pharmacy, health and wellness services unmatched in our industry,” said Wasson. “We are integrating Walgreens’ 70,000 healthcare providers, on the front lines of health care across the organization, with a unified sales team offering these services to payers as a single, seamless integrated solution.”

On the expansion front, the chain pursued an aggressive course during the quarter, striking a deal to acquire New York powerhouse drug chain Duane Reade in February and finalizing the purchase of 12 Eaton Apothecary pharmacies in the Boston area. The company also agreed to buy three El Amal pharmacies in Puerto Rico, along with the prescription files associated of 11 other El Amal pharmacies; and the pharmacy business and other assets of 25 company-owned Snyder’s Drug Stores in Minnesota. In addition, Walgreens announced last week an agreement with USA Drug to acquire the prescription files of 17 pharmacies in the Memphis area.

In all, Walgreens opened or acquired 41 new drug stores during the second quarter, for a net gain of 33 stores after relocations and closings. The company predicted “organic store growth of between 4.5 and 5% in fiscal 2010 and between 2.5 and 3% annually beginning in 2011.”