Foreign Minister Yitzhak Shamir and Deputy Prime Minister David Levy today were locked in a complex political battle to succeed Prime Minister Menachem Begin. The two men met, but neither agreed to drop out of the race, throwing the issue to the central committee of Herut, their political party.

The central committee is scheduled to meet Thursday night. To give both his party and political allies more time to agree on who should succeed him, Begin has continued to postpone submitting his letter of resignation to President Chaim Herzog.

Shamir is the strong choice to replace Begin among the eight Herut party members who are Israeli government Cabinet ministers. Levy is said to have more support in the central committee. However, a vote in the central committee, which traditionally chooses the party leader, will not necessarily mean that Levy will emerge as the victor.

Levy, 45, is Israel's housing minister and, under Begin, also holds the largely meaningless title of deputy prime minister. There has been considerable speculation here that Levy is really seeking an enhanced government position that would give him the foreign policy or defense experience he now lacks for a future bid to be prime minister, while the 69-year-old Shamir would succeed Begin.

Earlier today, former defense minister Ariel Sharon announced that he was not a candidate. Sharon lacks the internal party support to be a viable candidate and was never considered a serious contender.

It was still not clear how long Begin will wait before submitting his resignation letter to Herzog, which will bring the automatic resignation of his government. Under Israeli law, Herzog is obliged to consult with leaders of Israel's parliament, the Knesset, and ask one of them to try to form a new government.

Herut party leaders hope that by the time the resignation becomes official, or shortly thereafter, they will be able to present Herzog with a successor who has the backing of a solid parliamentary majority. This would leave Herzog, a member of the opposition Labor Alignment, no choice but to accept the Knesset's will, and would prevent him from asking Labor Alignment leader Shimon Peres to attempt to form a government.

But how long this will take was also unclear, for it involves a complex process revolving around the magic number in Israeli politics--61, representing a majority in the 120-member Knesset.

There was agreement among leaders of the current coalition government that it is the prerogative of Herut--the party of Begin, Shamir, Levy, Sharon and Defense Minister Moshe Arens, among others--to choose the successor and see if he can hold together the Begin coalition. Beyond that, there was little agreement.

The Begin government is a coalition of six political parties--Herut and Israel's Liberal Party, which together form the ruling Likud bloc, plus the smaller National Religious Party, Agudat Israel, TAMI and Tehiya. These six parties, in combination with three maverick Knesset members who have formally broken with the coalition but still vote with it on crucial issues, control 64 parliamentary votes.

Winning the backing of the Herut party is only the first step in the process to succeed Begin. The designated successor would still have to satisfy the smaller parties in order to preserve the coalition. This will involve satisfying not only their ideological demands but also the desires of all the party leaders, including those in Herut and the Liberal Party, for certain key government jobs.

The Israeli press, presuming that Shamir will be the next prime minister, is already speculating on what the next Israeli Cabinet will look like. There has been talk of Levy becoming foreign minister, or of a shuffle in which Finance Minister Yoram Aridor would take over the Foreign Ministry and Energy Minister Yitzhak Modai would succeed Aridor.

Another possible combination has Arens, who is not a Knesset member and therefore is ineligible to be prime minister, becoming foreign minister, and former defense minister Ezer Weizman, who resigned in 1980 under pressure from Begin, returning to his old job.

Yet every combination has its potential pitfalls. The leader of Tehiya, for example, has already announced that the far right-wing party will quit the coalition if Weizman is returned to the government.

The whole process sometimes resembles a gigantic card game of "Old Maid" in which various political figures are shuffled around the table in various Cabinet positions until someone comes up with just the right combination. He then becomes the prime minister.

Meanwhile, at a news conference in Tel Aviv today, four Knesset members who are members of the government coalition said they will support only a Likud-led "national unity government" that also would include the Labor Party.

However, the formation of such a government seemed unlikely since it would require the Labor Party, which appeared doomed to its opposition role as long as Begin led the government, to join forces with its ideological adversaries at the moment Begin was vacating the political field.

Through the first days of the maneuvering the Labor Party has remained largely on the sidelines, and is waiting until Begin submits his resignation to Herzog before it issues an official statement.