The first referendum on Reaganomics in the hard-pressed Midwest is being waged, oddly enough, in a Democratic primary here. It is a thoroughly messy affair, rife with name calling, and bitter accusations of betrayal.

It's hard to imagine a more unlikely matchup or a tigher race. Incumbent Rep. Ronald M. Mottl, who backed President Reagan's economic program, and Democratic congressional leaders are pitted against Edward F. Feighan, an ambitious young county commissioner, the local Democratic organization and organized labor.

The way Feighan and his allies see it, Mottl should be purged from the party on June 8 for being "the only 'Boll Weevil' from north of the Mason-Dixon line."

The way Mottl and Democratic congressional leaders see it, the four-term congressman is a loyal Democrat. The election, he declares, is actually over what kind of congressman the new 19th Congressional District wants: "a person who has guts and courage or someone who is the puppet of Boss Hagan."

Hagan is Tim Hagan, the Cuyahoga County Democratic chairman. Hagan, a fiery liberal, considered running against Mottl himself, but decided Feighan, a friend with a well-known political name, would have a better chance of winning.

Mottl has a lot of support in Washington. House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.), Majority Leader James C. Wright Jr. (D-Tex.), and Majority Whip Thomas S. Foley (D-Wash.) have uttered words of support. Sen. William Proxmire (D-Wis.) and Rep. Claude Pepper (D-Fla.) have written widely circulated letters of support.

Rep. Tony Coelho (D-Calif.) has sent a $5,000 donation from the House Democratic campaign committee he chairs. And yesterday Rep. Henry A. Waxman (D-Calif.), chairman of the House Energy subcommittee on health and environment, was in Cleveland campaigning for Mottl.

"I don't believe we should purge Democrats," Waxman said. "Ron Mottl is an honest, decent, hardworking person. He isn't Phil Gramm after all."

This is the kind of statement that infuriates Hagan, who was asked by O'Neill's office to put pressure on Mottl last year during crucial votes on Reagan's program. He says its smacks of clubbiness, and the Democratic Party's failure to discipline itself.

"I know a county chairman from a podunk place like Cleveland isn't as sophisticated as those people in Washington, but how can I stand up and talk about Reaganomics and not say Ron Mottl is responsible for part of the problems that we're seeing all over Ohio?" he says. "He isn't any different from any other Republican."

Mottl, a combative infighter whose reputation here rests largely on his opposition to school busing, has been taking lumps like this for almost two months.

Both Cleveland newspapers have endorsed Feighan. And a quarterly newspaper, published by the Ohio AFL-CIO, carries the headline: "Ohio Republicans and Mottl Betray Ohio."

When Mottl appeared at two debates last week, Feighan and two minor candidates, Cleveland State history professor Melvin Drimmer, and high school teacher Arnold Gleisser, jumped all over him.

Feighan accused Mottl of being part of a "small band of radicals who took over the government" with Reagan and caused the "biggest shift of the tax burden in the nation's history from those most able to pay to those least able."

"Ronald Reagan's action and Ronald Mottl's frequent support for those actions have been disastrous for Ohio and the people of this community," he added.

In his old district, Mottl would have easily withstood such assaults. It was made up of the suburbs west and south of Cleveland. Mottl's base is in the large, blue-collar suburb of Parma, a place heavily populated by Poles, Ukrainians, and Slavs, and the local press calls him "the crown prince of Parma."

Ohio, however, lost two congressional seats in the 1980 census, one of which had been in Cleveland. Mottl's new district now circles the city on the west and south and includes the more affluent, and liberal, eastern suburbs. He describes it as "the emerald necklace district." Others call it the "toilet seat district."

By whatever description, the district poses problems for any candidate. It is a place of strange bedfellows, mixing quiche-and-chablis liberals with kielbasa-and-beer conservatives.

As a county commissioner, Feighan has previously run in the area, although he doesn't live in the district. He has also been able to raise a campaign warchest large enough to mount an extensive television ad campaign while Mottl says he probably won't have enough money for a single TV commercial.

But Feighan's biggest asset may be his name. His father, Francis, was an assistant U.S. attorney, his Uncle Mike served in Congress almost 30 years, and his Uncle Ed recently retired after 34 years on the Municipal Court bench.

"If I lose the election it may be because I'm underfinanced," says Mottl, who hopes to raise $60,000 to $70,000, about half that of Feighan. "Phil Gramm Reagan's most prominent Democratic supporter in the House won in Texas, but he had $500,000."

"I don't have an easy road ahead of me," he adds. "I have half a new district, and I'm running against a candidate who is well greased and has the party bosses, two newspapers and the labor bosses behind him."

But Mottl, last year mentioned as one of the northern Democrats considering switching parties, says he has no regrets. "I'm kind of an independent Democrat who looks after my country and not my party. All things being equal I'll always support my party leadership, but sometimes all things aren't equal."