The Carter administration's plan to sell Somalia U.S. arms in exchange for using Somali ports will end up causing more trouble than it's worth, the House Foreign Affairs subcommittee on Africa has told Secretary of State Edmund S. Muskie.

Seven of the subcommittee's eight members said in their letter that the $20 million in fiscal 1980 funds the administration wants to transfer from other accounts to start the arms flow should not be shifted.

The Foreign Affairs subcommittee does not have the authority to stop the reprogramming; the congressional appropriations committees do. They have not yet acted.

Because there are already new base agreements with Kenya and Oman, and ones in negotiation with Egypt, the subcommittee wrote Muskie, use of the Somali ports of Berbera and Mogadishu "would appear to add little to our regional military capabilities."

Once the United States establishes a military presence in Somalia, the subcommittee said in the letter sent to Muskie Thursday, the Soviet Union may press Ethiopia for comparable facilities in that country.

Other dangers of U.S. military links to Somalia, the subcommittee wrote, include exacerbation of the Somali-Ethiopian conflict over Ethiopia's Ogaden; U.S. involvement in a regional war and estrangement of the United States "from the economically, politically and militarily important African states who overwhelmingly oppose Somalia's efforts in the Ogaden."

Only Rep. John Buchanan (R-Ala.) did not sign the letter.

Somalia has been fighting since 1974 to annex Ethiopia's Ogaden district.

Although the State Department insists Somalia has given up on the idea of a military takeover and no longer has a significantly body of troops in the Ogaden, the Central Intelligence Agency told the subcommitte this week that elements of three Somali battalions, plus up to 1,000 Somali regulars serving with insurgents, still appear to be in the Ogaden.

"Despite its written and verbal assurances to the contrary," the subcommittee wrote Muskie, "Somalia remains deeply and intimately involved in the armed struggle which continues to rage in the Ethiopian Ogaden."

If the United States established a military presence in Somalia and the long conflict with Ethiopia heats up, the subcommittee reasoned, American leaders would be faced with abandoning its new friend or becoming involved in regional warfare.

Given Somalia's continued military action in the Ogaden, and the risks posed to the United States from escalation, the subcommittee said the administrations plan to reprogram $20 million should not go forward.

Chairman Stephen J. Solarz (D-N.Y.) said if State ignores the subcommittee he will move to change the law to make such objections binding.

The House and Senate Appropriations committees, under the 1979 law covering foreign military sales, can stop such a reprogramming request at the $20 million for Somalia. Each must give its "written prior approval" before the action can go forward.

The subcommittee letter leaves the door open for going along with the reprogramming later if State can provide better assurances that Somali regulars are out of the Ogaden and will stay out.

Subcommittee members have said that Richard M. Moose, assistant secretary of State for African affairs, and the CIA gave conflicting reports earlier this week on the extent of the Somalia military presence in the Ogaden.

State Department spokesman John Trattner insisted Thursday that there was "no real difference" between the State and CIA reports, but refused to provide figures. Solarz said, "I deplore" that the CIA figures given to the subcommittee in secret were publicly disclosed.