West German Chancellor Helmut Schmidt's surprise medical operation yesterday fueled speculation today about a possible successor for the Bonn leader, but party officials called such talk tasteless and the government's spokesman said Schmidt would be resuming his duties next week.

The Bonn spokesman said doctors attending Schmidt were "very pleased" with the West German leader's condition following yesterday's one-hour operation during which the 62-year-old chancellor was fitted with a heart pacemaker. Schmidt was described as feeling fine -- although a bit irritated, an aide confided, at being awakened so early in the morning at the military hospital in Coblenz where he is resting.

Although Schmidt is expected to return to Bonn this weekend, the spokesman said he probably would not attend next week's summit meeting of North-South leaders in Cancun, Mexico, -- a trip during which he had planned to confer with President Reagan. Doctors advised against the trip, fearing the change in climate could affect the chancellor's recovery.

The pacemaker, a small device that regulates the heartbeat with electrical pulses, was given to Schmidt to avoid the risk of a heart rhythm disturbance. It is expected that Schmidt will be able to shoulder a normal workload.

Still, the unexpected operation prompted questions in West German press, political and diplomatic circles about the Bonn leader's ability to continue working punishing 16-hour days.

In a letter to Schmidt, former chancellor Willy Brandt, who is chairman of Schmidt's Social Democratic Party and lately has been at odds with Schmidt over party policy, urged the chancellor to delay returning to work for a few days longer than doctors had suggested.

"I would like to be able to welcome you to the circle of those who no longer believe that more than 12 hours a day is reasonable," Brandt wrote. Brandt suffered a heart disturbance several years ago.

Schmidt's illness occurs at a time of deep division within his party over national defense and economic policies and during a period when the Bonn government is facing a serious challenge from peace activists over its support for Atlantic Alliance nuclear missile plans.

The operation threw a spotlight on the delicate matter of Schmidt's eventual successor. The chancellor's aides repeatedly have dismissed speculation that Schmidt might step down before the 1984 general elections, and no successor is easily apparent. The handful of obvious Social Democratic nominees for the job tend to be dismissed in Bonn circles for reasons of age, health or various political liabilities.

A spokesman for the Social Democratic Party told reporters today that speculation about a successor was "in bad taste and out of place."

Robust on the job, with a renowned iron sense of duty, Schmidt nonetheless has suffered several illnesses during his seven years as chancellor, including a widely reported thyroid problem.

Schmidt entered the hospital Monday after returning from Cairo, where he had attended Egyptian president Anwar Sadat's funeral.

The operation prompted comments on the strains of being in government these days -- comments that seem only natural in a city where several other government officials, including the foreign and finance ministers, also have experienced heart rhythm disturbances.