When he stepped off Air Force One Saturday night, President Carter was brimming with optimism as he told the Israelis: "I have good reason to hope that... [peace] can now be achieved... I look forward to completing the urgent business at hand."

A festive bread-and-salt greeting ceremony was followed by a friendly dinner at the home of Prime Minister Menachem Begin.

Then, suddenly, Begin told Carter something the American president had not heard before.

Begin said he could not sign any treaty -- not even initial it -- until after it had been submitted for approval by the Knesset, the Israeli parliament.

The American president suddenly faced a reality that he felt had never been stated explicitly to him before. Begin was, in effect, saying that there could be no dramatic gesture of peace during this extraordinary presidential effort to bring the spirit of Camp David back to life.

Carter had been willing to spend hours -- hundreds of them. in fact -- in the sort of painstaking, intricate negotiations that usually are left to the technicians of diplomacy.

He had hoped -- if all turned out for the best -- to be able to end his trip with a dramatic demonstration of success. Now that appeared remote, even if Begin and Sadat could be persuaded to resolve the issues that remained.

As the Israelis tell it, Carter should have known.

They say they had told the American side all about how the Knesset would have to approve the accord. But the Carter officials felt all along that this merely meant that, like the Camp David agreement, there could be a ceremonial initialing and all the celebration that entailed, followed by the Knesset debate and approval.

This apparently is not what the Israelis had in mind at all.

Adding to the perplexity of it all is the fact that, according to Israeli officials, the Knesset would be able to take up each article of the treaty -- in fact, even each paragraph -- separately. The Knesset could approve or reject each provision, and perhaps even amend it as it desires.

As the Americans see it, this would make the problem even more difficult for Egypt's President Anwar Sadat, because it raises the prospect that he would be put in the position of having to publicly agree to something -- and no doubt incur wrath in the Arab world -- and then find out that it was not the final Israeli position after all.

Which gets down to another of the intermingled problems of politics and perceptions that are scattered like buckshot throughout the task of making peace in the Middle East.

The Americans feel Begin does not adequately appreciate the problem Sadat has with the rest of the Arab world, where leaders deeply distrust what they see as Sadat's overriding desire to make a separate peace with Israel, relinquishing leverage Ehypt could use to help the cause of the Syrians, the Jordanians and the Palestinians.

The Israelis feel Carter does not adequately appreciate the problem Begin faces within Israel, where even his hard-lind posture is considered too soft among many ultraconservatives, and where the strong Labor Party opposes his position on autonomy for Palestinians in Gaza and the West Bank.

Today, Begin provided Carter with a first-hand look at just how tough things can be for the prime minister. He did this through the political courtesy of an uproarious session of the Knesset, a body that normally places rudeness on a par with Robert's Rules of Order and which today made no exception because Carter was there.

With the American president looking on, like prey trapped in a device designed to allure and ensnare him, Knesset members repeatedly interrupted Begin with angry shouts. Ultraright members denounced Begin for selling out Israel's rights in occupied territories. Communist members denounced him for not being far enough to the left. Some hecklers heckled other hecklers. It got so that the simultaneous translator had to say in English that she could not understand what was going on.

Through it all, Carter looked pained and even angry as he sat up there on the podium. But at the microphone, Begin just smiled.

"He seemed rather pleased to be showing Mr. Carter how deep his own problems run here at home," said one Israeli official.

And so last night, American officials appeared gloomy -- and at times clearly upset -- as they talked about how differences remain on only a few issues. And they also talked about how Carter and his entourage would apparently be going back to Washington empty-handed. They saw no last-minute breakthrough coming.

And certainly they did not foresee the kind of triumphant homecoming they had once hoped for their president, who is suffering through a period of political disquietude and declining polls.

Before leaving Washington, a senior White House official had declared: "If we are successful, there will be no doubt. If it is a failure, that will be clear too."

In Israel, the same official declared: "I wish I saw a middle ground. I really don't.

"But we'll surely try to create one if this is not to be..."