CONTRARY to press reports, there is no "gentleman's agreement" between Bonn and Tehran over the freeing of two German hostages, says a German government official close to the negotiation process.The official says Bonn contacted Tehran Tuesday to ask about widespread media reports that Bonn had secretly agreed to release two jailed Lebanese Shiites, brothers Abbas Ali and Mohammed Ali Hamadei, in exchange for two Germans kidnapped in Lebanon in May 1989. Tehran, according to the official, said it "couldn't explain" the reports. The Iranian government, he says, reiterated its position that the German hostages are to be considered part of an anticipated exchange involving all of the Western hostages. "The Hamadei brothers have nothing to do with this," the official says, adding that Iran, the United Nations, the United States, and Britain all share this view. The Germans' captors - believed to be the Hamadei family - are of a different opinion. This group is coupling the release of Thomas Kempner and Heinrich Struebig, with the freeing of the two imprisoned Hamadei brothers. Mohammed Ali Hamadei is serving a life sentence in Germany for the hijacking of TWA Flight 847 in June 1985 and murder of a passenger, US Navy diver Robert Stethem. Abbas Ali Hamadei is serving a 13-year sentence for kidnapping two other Germans in Lebanon in an effort to free his brother. The Germans hope Iran can help bring about the release of the German hostages without involving the Hamadei brothers, and are keeping close contact with Tehran. Iran is a key to the German hostage case, says Helmut Hubel, Middle East specialist for the Institute for Foreign Affairs in Bonn. First, he says, Iran more or less controls Hizbullah, the pro-Iranian Shiite militia in which another Hamadei brother, Abdel, is a prominent leader. Second, Iran wants to better its economic and political ties with the west. Maintaining good relations with Germany could further this aim, Mr. Hubel says. Germany is Iran's most important trading partner. Iran is trying to rebuild its war-ravaged economy and infrastructure and is in desperate need of German machinery and electronics. The Iranians are especially pleased that Germany this summer greatly liberalized its export credit guarantees for Iran, a move that will free up trade. Meanwhile, a German bank consortium has just loaned the Iranian petrochemical industry DM 510 million ($285 million). Trade between the two countries is growing strongly. Despite repeated denials from the government, the German media continues to report that Bonn is holding open the option of either pardoning the Hamadei brothers or simply deporting them - an impossibility in Abbas Ali Hamadei's case because he has German as well as Lebanese citizenship. It is speculated that the Hamadeis may be released several months after the German hostages are released. Letting the Hamadeis go would be a mistake, Hubel says. "The government might get two free hostages but then be faced with two new ones."