LOHATLHA, SOUTH AFRICA -- While South Africa's army, navy and air force routed a mock enemy here last weekend in their biggest joint maneuvers in six years, a more serious challenge was developing that is expected to change fundamentally the most powerful military force in southern Africa.

The rousing operation here took place under the shadow of the latest announcement on cutbacks in South African Defense Forces spending and in the midst of a difficult transition to the "new South Africa," in which the army's main role so far has had nothing to do with conventional warfare.

To meet budget restrictions, bases are being closed, weapons are being sold off and nearly a dozen major new arms projects have been canceled.

At the same time, as the government of President Frederik W. de Klerk begins talks on shifting power from the white minority to the black majority, the now-segregated military's future command, composition and role remain unsettled.

But the main issues looming for South Africa's military now are affirmative action programs to accelerate promotion of black officers, a start on integrating troop units, and the trickiest political issue, incorporating the African National Congress's (ANC) exiled guerrilla army into the national military force.

The operation here in the open savannah of the northern Cape Province was notable for its size, attempt at precision and concern for detail as the South African Defense Forces worked to revive their conventional-warfare capability after years of concentrating almost exclusively on counterinsurgency operations in Namibia and southern Angola.

The "enemy" pretended to invade from three neighboring countries -- Namibia, Botswana and Mozambique -- and was closing in on one of South Africa's key industrial areas. But the South African 7th Division quickly mobilized a counterattack and routed the invaders. Invited foreign military attaches and correspondents watched the final "assault" on the mock enemy force at the Army Battle School training grounds here.

But South Africa's military, with its proud tradition of colorfully named units such as the Cape Highlanders, formed in 1857, now seems to be an old army in search of a new peacetime mission.

The bush wars to the north in Namibia and southern Angola are over for Africa's biggest, oldest and most experienced army. So, too, are the cross-border raids and counterinsurgency strikes against guerrillas of the ANC.

As change looms for the military, the only likely prediction is that the chances of it having to cope with an invasion by conventional forces from South Africa's black neighbors, none of which has even an operational brigade, seem remote indeed.

Meanwhile, the notion of expanding the army's civic-service capabilities seems to be drawing little attention from the commanders, even though it is being called upon increasingly to help keep the peace among feuding black factions and to maintain a semi-permanent presence in the black townships around Johannesburg and in Natal Province.

The most sensitive political issue that lies ahead is how to deal with the 7,000 guerrillas belonging to the ANC's Umkhonto we Sizwe, or Spear of the Nation, which thinks it ought to form the backbone of a new post-apartheid armed force.

Its chief of staff, Chris Hani, says the organization is actively recruiting high school- and university-educated youths for advanced training to become the pilots, tank drivers and technicians for a new, desegregated South African military.

But Defense Minister Magnus Malan voiced his total opposition again yesterday to any suggestion the military and the ANC guerrilla force might one day merge to form a single new armed forces.

"There is absolutely no chance of such integration," Malan told a conference of the ruling National Party in Port Elizabeth.

He said he was opposed to it partly because of the different levels of training and professional standards and partly because Umkhonto was just the instrument of one black political party, the ANC. If the military integrated Umkhonto units as such, he said, it would also have to take in the military forces of Chief Mangosuthu Buthelezi's Inkatha Freedom Party.

Furthermore, Malan said, the "culture" of Umkhonto is "one of trying to take over power" for the ANC while that of the South African military is totally different, "protecting all citizens of South Africa," as he described it.

As clearly illustrated here during the maneuvers, the military is concerned with how to maintain morale and give a sense of purpose and new direction to an armed force facing severe budget cutbacks.

"If you want peace, be prepared for war," a briefing officer said, explaining to visitors why the military was again emphasizing conventional-warfare training.

But officers here admit that maneuvers like these, involving 7,500 soldiers in a week-long live-fire exercise, are not likely to be repeated often in coming years. They note that the latest buzzwords at the Defense Ministry are terms like "cost effectiveness" and "rationalization" of manpower, equipment and forces. What this has meant in practice is a 15 percent cut in real spending for the military this year, a 25 percent cut in the navy's forces and the selling or mothballing of the air force's aging British-made Buccaneer and Canberra bombers, its Super Frelon and Westland Wasp helicopters and its Dakota and Albatross maritime surveillance aircraft, and others.

A score of navy, army and air force bases are being closed or amalgamated and the government has just announced that 16 air force squadrons and army units will be disbanded or merged with others next year. The overall budget, set at just under $4 billion this year, will be cut another $250 million -- roughly 5 percent -- next year.

Defense expenditures accounted for about 14 percent of the government's 1990 budget -- 3.7 percent of the country's gross national product. Last year, it accounted for 15.4 percent of the total and 4.2 percent of GNP.

Hardest hit by the cutbacks has been Armscor, the state consortium set up to break the 1977 U.N. arms sales boycott of South Africa that eventually turned this country into the world's 10th largest arms merchant. Armscor has already laid off 2,100 employees this year, and its total work force is down from 29,000 in 1984 to about 20,000.

The government has canceled 11 major weapons projects Armscor was to start this year. Armscor's newest weapon, an attack helicopter called the Rooivalk, has been left without a local customer and its fate is uncertain. Also uncertain is whether it will go ahead with costly development of a new aircraft that Israeli technicians reportedly have been helping to build.

Least affected by the budget cutbacks so far has been the army -- a small standing force of 77,500, according to the International Institute of Strategic Studies, with a reserve Citizens' Force of 150,000 and similar-sized Commando Force that can be called up quickly when needed.

The permanent force includes nine black and mixed-race battalions, most of them counterinsurgency units and all segregated from white units. One, the 32nd Battalion, consists largely of Portuguese-speaking Angolans who fought in South Africa's 13-year clandestine war in southern Angola.

The military command recently made the risky decision to commit the 32nd Battalion to its first internal South African security mission, ending the open warfare in Natal between supporters of the ANC and Buthelezi's Inkatha Party and policing the townships there.

At first, the decision was bitterly criticzed by the ANC. But the battalion accomplished its mission with impartiality and has now been replaced by another unit.

Meanwhile, other army units have been called up to help police in the townships around Johannesburg. The ANC, which once clamored for the withdrawal of the army from all townships, has fallen largely silent on this issue, limiting its complaints to specific allegations of military misbehavior.

Total active forces........... 103.000

Reserves...................... 425,000

Para-military (police)......... 55,000

1989-90 budget.......... $3.91 billion

SOURCE: The Military Balance, 1989-90