Shopping centers are moving into the cities.

Encouraged by the phenomenal success of his Faneuil Hall Market-place in Boston and the Gallery on East Market Street in Philadelphia, James W. Rouse, one of the nation's largest shopping-center developers, has broken ground for similar facilities in New York City and Baltimore.

The South Street Seaport Market on the tip of Manhattan, below the Brooklyn Bridge, will include recycled old buildings and a harbor museum. Baltimore's Harborplace flanks the restored Inner Harbor near the docked U.S.S. Constellation, the nation's oldest battleship.

But other big shopping-center developers, such as Ernest W. Hahn and Cadillac Fairview, also are seriously shopping for downtown locations.

"'Back to the city,' a real tide in places like Washington, Philadelphia, Baltimore, San Francisco and Chicago, is bound to happen in countless other less glamorous cities in the 1980s; it is just a question of time," says a recent report of the International Council of Shopping Centers.

The council was formed in 1957, when shopping centers were still an innovation brought on by highways and mass migration to suburbia. Then, there were fewer than 3,000 shopping centers nationwide. Today, there are well over 17,000, most built on cow pastures and all on the ruin, or near-ruin, of old downtown central business districts.

But urban sprawl and shopping center proliferation now have come to a halt. It is entirely conceivable that due to changes in America's life style, the destinies of urb and suburb are reversed.

The most important basis for this possibility is demographic-the drastic shifts in the rate at which the U.S. population has grown.

As Gordon Kennedy, president of Gladstone Associates, a national economic consulting firm, has sumarized it, total births dropped during the Depression from nearly 3 million a year to about 2.5 million. This represented a fertility rate of close to 2.1-the replacement level.

This was followed by the postwar baby boom, which continued into the early 1960s. The fertility rate rose to 3.57 and there were more than 4 million births a year.

The baby boo, was followed by the baby bust, when the fertility rate fell below the replacement level. Today the birth rate is 1.85, and decline in population growth is expected to continue.

So is prosperity, because the babies of the baby boom are now old enough to work, and more women are entering the labor force, generating more purchasing power.

But prosperity is likely to shift from the suburbs to the city because the baby boom adults aren't having babies of their own. That means they won't buy large suburban houeses, they won't be bothered with mowing crab grass, they won't be as concerned about schools as their parents were. They will want to be where the action is, to spend their money on culture, entertainment, travel, recreation and adult education.

The stress will be on quality. "This generation will have more sophisticated tastes," Kennedy says.

This is what Boston's Faneuil Hall Marketplace, Philadelphia's Gallery, Baltimore's Harborplace and Manhattan's South Street Seaport Market cater to. The new downtown markets have realized that the rapidly increasing number of Americans between 25 and 45 are no longer a Pepsi generation but a wine generation.

Other factors, too, favor city revitalization.

One is the energy crunch. It is likely to be a dominant influence in the '80s, as consumers react to rising utility and transportation costs. Higher prices for gasoline and heating fuel are not likely to drive many suburbanites out of their present homes. But the costs are bound to drive young homemakers to look for apartments, condominums and townhouses downtown-to say nothing of the new preference for old building charm which only cities can offer.

All this is not to say that all new shopping centers will be built downtown. A good many developers are still skeptical about the "back-to-cith" movement. But the days of ever more Tysons Corners and White Flints are over.

Most developers, according to the International Council of Shopping Centers, are now focused on "infill." That means retail developments on sites overlooked in the haste to cover the countryside with parking lots-sites held by schools and other institutions, or kept out of the market by zoning or speculation.

One example of an infill market is Washington's Pentagon City, where 800,000 square feet of new retail stores is being built on land that was tied up in an estate for years and just now has been freed.

"Infill" also means modernization of old shopping centers and creation of new ones along the main streets of small towns within metropolitan areas.

But a downtown location, says Gerald D. Schwartz, who has directed numerous studies for shopping center developers, "has the greatest potential." CAPTION: Picture, Harborplace in Baltimore, with restored U.S.S. Constellation