The traditional back-scratching alliances are out the window, legislators are sniping bitterly at each other and the Reagan administration is drawing a line in the sand as the Senate prepares to take up a long-germinating and expensive four-year farm bill this week.

In this atmosphere, with the bill scheduled to be called up for debate today, programs providing federal price supports for dairy products, peanuts, tobacco, sugar and the major grains are under unprecedented attack.

Farm organizations, united in an informal National Farm Coalition, are saying the bill does not go far enough. The administration says it goes too far, so far, in fact, that in its present form it is a candidate for presidential veto.

Farm state senators, usually united in defense of each others' favorite commodities, are caught in the middle. Most are hounded by farmers' complaints about falling prices, high interest rates and mounting production costs. But they also are being hectored by an administration that is insisting on a more modest support package.

The support programs, providing loans on farm products at guaranteed levels, have a direct impact on government spending, on prices offered in the marketplace and on farmers' ability to obtain operating loans from commercial banks.

The basic legislative problem is this: The Senate Agriculture Committee turned out a bill that is $1.8 billion over the congressionally approved fiscal 1982 cap on farm spending. The administration, faced with more severe budget deficits than anticipated, is threatening a veto unless the Senate backs off and passes a less costly bill.

Three days of caucusing last week by the committee, sometimes in consultation with Agriculture Secretary John R. Block, failed to produce compromises that would preclude nasty confrontation on the floor.

"Unless that caucusing can get a compromise agreeable to the administration, every commodity could become a problem on the floor," an aide to Block said. "In the past there has been a coalition of commodities that have looked out for each other. But because of the budget situation and the farm surpluses, that has broken down. It could be real tough."

Frustrated by the inability of fellow committee members to compromise, Sen. Richard G. Lugar (R-Ind.) denounced "special-interest legislating" and announced Friday that he will introduce amendments this week to bring the bill back within budget limitations.

His amendments, he said, will reduce the five-year cost of the farm legislation from the estimated $13 billion approved by the committee to the $9.2 billion sought by Block and the White House.

Lugar's main approach would be to abolish target price payments for certain crops--direct payments to farmers, based on their production costs--that the committee bill would maintain. Block, in opposing target prices, has argued they are an impediment to the "free market" farm philosophy he and the administration support.

The impact of target prices on the federal budget can be seen from this year's wheat experience. With production expected to hit an all-time high, causing a major surplus, the administration faces paying farmers $500 million in direct target price subsidies for unsold grain.

The Senate bill would raise the wheat target price from $3.81 per bushel, which means a payment of between 18 and 20 cents per bushel, to $4.20 next year. It would rise more in succeeding years.

More excess production next year would cause additional budget outlays, which Block and David A. Stockman, director of the Office of Management and Budget, call unacceptable.

Block, reconciled to the Senate committee's insistence on continuation of target prices, told the caucus he would accept no more than $4 a bushel as next year's wheat target. The committee offered a $4.l0 compromise but, as of Friday, it was rejected by the secretary.

Similar disagreements have cropped up in other commodities with the dairy program, according to sources, offering the least hope of compromise between the administration's adamant stand on scaled-down supports and the industry's push for greater largess.

"We view dairy as a major item and the caucus hasn't liked what we proposed," the Block aide reported.

The Senate bill would allow semiannual adjustment of the dairy price support; the administration wants to change it only once a year to hold down spending and reduce the expensive dairy surpluses the government must acquire.

Sen. John Melcher (D-Mont.), one of the most vocal critics of the committee bill, said, "I've never known a farm bill that has had as few people advocating it as this one. I've not seen people all over the lot as much as they are now on a farm bill--the commodity groups, legislators, the Department of Agriculture, the White House."

Melcher, who intends to propose amendments raising certain support levels, said, "I never was for the bill in the first place and I can't agree to weaken it. And I don't know why Democrats should be asked to participate in further weakening of an already weak bill."

Amendments are anticipated that would kill the sugar support program in the bill, to modify or wipe out tobacco price supports and to end the system of support and acreage allotments for peanut growers, all of which are expected to generate intense debate.

In a sense, the administration has undermined its austerity arguments by agreeing to back away from opposition to costly support schemes for sugar and peanuts, concessions made to southern legislators by President Reagan in his effort to win approval of his budget and tax cut proposals this summer.

But repeating earlier warnings from Block, Lugar said Friday that the president is prepared to make the farm bill his first major veto if Congress exceeds its and the administration's spending limits.

"If at the end of the month there is still a hullaballoo about a big budgetary deficit, what a target for a veto," Lugar said. "It's just big, fat and ready to be shot down."