Robert White won a very small skirmish in a very large war last week when the city council of Port Elizabeth voted to desegregate its beaches.

The managing director of General Motors' South African subsidiary there had fired off an angry letter to the editor last month questioning the council's courage and integrity for, in his eyes, ducking the issue. He called the Jim Crow beach law "abhorrent" and its enforcement "incredulous."

White went a step further and pledged legal and financial support to any of his black employes who might decide to break the law by stepping onto the wrong sand.

His statement set off fireworks in the white establishment here, which accused GM of encouraging civil disobedience. Soldiers patrolled the beaches on the following weekend to keep blacks out, while a Cabinet minister told GM to "keep its nose out of South Africa's business" and a far right lawmaker called for a consumer boycott.

But last week the council caved in, spurred by White's letter and by a strong lobbying campaign from local business leaders.

In a country where blacks cannot vote in national elections and where schools and housing remain segregated, GM's stance on the beach issue symbolized a new mood and a new strategy among many of the 300 American companies doing business in South Africa.

Many companies, beset by the rising militancy of the black majority here, by proponents of disinvestment in the United States and by a faltering South African economy, are seeking new justifications for remaining here and are speaking out more loudly and often against the apartheid system.

"It seems quite clear to me that business is going to have to take a far more active role in pushing for change," said White. "Our involvement in politics has to move to another level, and we're all in a position of groping for an effective way of doing that."

In recent months, Citibank and Coca-Cola have announced new programs to support black economic development and education, while the American Chamber of Commerce here and other business groups have made strong public statements criticizing the white-minority government on such issues as segregated schools and allegations of police brutality.

The efforts seem intended to demonstrate that big business and apartheid do not mix and that American corporations are committed to the system's peaceful but rapid demise.

Until recently that would have been a tough thesis to prove. South Africa was a relatively small, tranquil but lucrative outpost for American companies. Kenneth Mason, executive director of the American chamber here, cites Commerce Department figures indicating that the rate of return on investment was 15 percent in 1983, compared with 10 percent in the United States. "There has always been a strong profit motive in doing business in South Africa," he said.

But profits have been drained in recent years by a lingering recession whose impact has been compounded by two years of racial violence. Art Tregenza, a spokesman for General Motors, noting the general decline in South Africa's car industry, conceded that "for the past few years, we haven't done well, and it raises a question: how long does a company like GM continue to participate in a market if there's no return?"

The steep decline in profits has been more than matched by a plunge in the confidence of businesses in the country's white rulers. Just a few years ago, many businessmen were optimistic that the government's self-proclaimed "reforms" would ultimately meet black aspirations and maintain political stability. But the government's inability to cope with the violence, which has now claimed more than 1,300 lives, has led some businessmen to conclude that Pretoria is leading South Africa toward disaster.

"Time is very definitely running out," said David English, managing director of the South African branch of Rank Xerox, a British corporation that is 51 percent owned by Xerox of America. "A lot of people are thinking of pulling the rug out for commercial and political reasons. They're frankly running out of patience with this government."

For some time has already run out. About 20 American companies pulled out of South Africa last year, according to the American chamber, and perhaps five more are in the process of leaving. Others are said to be quietly withdrawing their assets through a variety of back-door methods, while many American banks have suspended further loans.

"We're seeing movement mostly among companies that are marginal," said Lionel Grewan, a Citibank vice president. "But the big giants -- the IBMs, the Citibanks -- plan to stay."

Since 1978, their showcase has been the Sullivan Principles, a code of business conduct proposed by the Rev. Leon Sullivan of Philadelphia that commits 186 signatory companies to full integration of work facilities, pay scales and employment opportunities, as well as training programs and community development.

One indication of growing corporate concern is that the number of signatories increased 50 percent last year. Since January, under the executive order signed by President Reagan last year, all American companies with more than 25 employes here have been forced to comply with a Sullivan-based code or else be barred from government export assistance.

The code has been credited with improving the economic status of the 40,000 black employes who work for participating companies and with creating little islands of racial equity. But the signatories employ less than 1 percent of this country's work force.

A recent report by a political scientist and an economist at the University of Durban concluded that the code has had little or no impact here other than in creating "a small worker elite as a very expensive public relations exercise."

Anglican Bishop Desmond Tutu, last year's Nobel peace laureate, said it is "humbug" for American firms to argue that they are a progressive force for change here. At best, Sullivan has an ameliorative impact on apartheid, said Tutu. "But we don't want our chains made more comfortable. We want them removed."

Stung by such criticism, the Sullivan signatories have pledged to move outside company walls and take a more active role in promoting fundamental social change. But success has been limited.

A prime example has been in education, where 12 signatories set up a task group in 1983 and, advised by black teachers' organizations, devised a plan to upgrade teachers' skills. It was the kind of nuts-and-bolts program that they believed would go to the heart of a major social and political problem. But it has drawn little support from American corporations.

Only about two dozen have contributed to the programs, according to task force chairman Patrick O'Malley, public affairs officer at Mobil Oil in Cape Town, who added, "Obviously we would like to expand."

One involved businessman, speaking not for attribution, explained the problem this way: "The companies back home have no problem with this kind of program. But most of the guys here are only interested in warmhearted gestures that improve their corporate image with blacks or alleviate shareholder pressure in the U.S. They're not interested in collective programs because they have no individual PR value."

O'Malley's group has also had trouble making impact on the government. Late last year, all of the Sullivan signatories sent a telex to President Pieter W. Botha urging that he intervene personally in the country's education crisis to allow boycotting students to reschedule their final exams. Botha reportedly responded angrily to what he saw as an unwarranted and overly publicized intrusion into domestic politics.

Gerrit Viljoen, the Cabinet minister in charge of black education, dismissed the telex and a follow-up report from the task group, saying in an interview that "in fact, everything they've called for has already been done for almost a year."

Angering the South African government is a secondary consideration for many companies these days. White, of GM, noted that he was more concerned about reaction among his black workers. His response to government criticism was, "That doesn't bother me. What else would you expect?"

But White conceded he was more bothered by the possibility that the government might stop buying GM's products. Last year, about 7 percent of GM's vehicles were sold to government agencies -- more than 2,000 cars or trucks, 916 of them to security forces.

Spokesman Tregenza said that while driving to work in the morning he has occasionally seen GM pickup trucks, outfitted with cages, in use as police paddy wagons. "It makes you uneasy," he conceded. But there are practical reasons for such sales, he said, the main one being that if GM refused to sell to the Army and police, it would likely lose the rest of its governmental contracts.

The government forces the company into other dilemmas as well. When Botha declared a state of emergency in Port Elizabeth last July, one of the first people picked up was a part-time union shop steward named James Tamboer. He was held for 14 days and, according to an affidavit he has filed in a lawsuit here, was physically assaulted by police while in detention.

Yet GM concedes it made no effort to ascertain Tamboer's whereabouts or seek his release. When he got out, he got his job back -- but forfeited his pay for the two weeks he missed. Said Tregenza, "We would not pay any employe for a period of time not worked like that."

Tamboer said he was not surprised by the company's attitude. "We have to fight the company for every little thing we get," he said. "Sullivan is just window dressing for them."

Businessmen worry that an increasing number of blacks will come to agree with Tamboer. "If we don't get our act together, Sullivan won't survive because the blacks will kill it themselves," said one who insisted on anonymity.