A California congressman who for several months last year allowed a D.C. detective to pose as one of his aides said yesterday that investigators looking into drug trafficking on Capitol Hill have told him that half a dozen members of Congress were cocaine users.

Rep. Robert K. Dornan (R-Calif.), a member of the House Select Committee on Narcotics Abuse and Control, refused to identify the members who he said were "both Republicans and Democrats." He said the names were mentioned to him by investigators "in the last ten days."

Dornan said, however, that he believed the congressmen should be called before the federal grand jury investigating a cocaine ring that is alleged to have used congressional employes to distribute drugs on Capitol Hill.

A law enforcement official familiar with the case said yesterday that the grand jury is not investigating any congressman, but instead is concentrating on the alleged leaders of the drug-distributing ring.

As for alleged congressional users, the official said, "We only have the baldest, unsubstantiated allegations."

Dornan's statement backed the view of some investigators in the case who have been attempting to get prosecutors to focus on congressmen who allegedly bought cocaine as well as the activities of the members of the distribution ring.

"Congressional users are consequential," Dornan said, because they are the ones who pass the laws that determine the legal status of drugs such as cocaine.

"It would be shocking," Dornan said, "if this part of the investigation is swept under the rug."

But the official familiar with the grand jury inquiry said yesterday, "Right now the effort is to bust the . . . pushers. That's the way traditional law enforcement works. The next level is who sold to (the pushers)." Federal investigators normally go after major distributors, not users, he said.

"There is a really serious policy question as to whether you go after people in Congress, just because they are in Congress," the official said. "Should they be subjected to different standards than the rest of the citizenry?"

That question has not yet been answered largely because the investigation is concentrating on the cocaine distribution ring, the law enforcement official said.

The cocaine investigation is separate from other probes being conducted by the Justice Department and the House ethics committee into allegations that some congressmen solicited and had sex with teen-age pages in return for possible promotions and job transfers.

In another development in the cocaine investigation, Capitol Police Chief James Powell said yesterday that a grand jury subpoena issued last week for his department's records concerning narcotics use on the Hill had been withdrawn at his request.

Powell instead has agreed to supply the prosecutors with whatever information they want from the Capitol Police files, he said.

"The U.S. attorney's office is welcome to any files we have," Powell said. "We would rather willingly cooperate."

Dornan's involvement with the undercover D.C. police officer began in March 1981, after a member of columnist Jack Anderson's staff gave the police information about the alleged cocaine ring, according to Anderson and Dornan.

When police suggested the need for the cover of a congressional staff position to help penetrate the ring, Anderson said, he suggested Dornan. The columnist and the congressman had worked together before on a story involving alleged campaign financing irregularities in California.

The undercover policeman was permitted to use Dornan's office as his alleged place of employment and two members of Dornan's staff were told they were to confirm his position, if any calls came in asking about him. According to Dornan, only two such calls were received.

Dornan said neither the Capitol Police nor his congressional colleagues were informed of the operation.

Two law enforcement officials familiar with the investigation said yesterday that the activities of the undercover officer posing as a Dornan aide were separate from another investigation that led to the arrest of three alleged members of the ring.

A joint task force of federal and D.C. police investigators made the arrests in April after an undercover agent purchased eight ounces of cocaine for $15,000, according to a police arrest affidavit.

One of those arrested, Robert A. Finkel, 30, began cooperating with authorities and claimed that the ring's customers included some congressmen and their aides.

Arrested with Finkel were Troy M. Todd Jr., 22, and Douglas W. Marshall, 26, a former Capitol Hill employe who police alleged sold the cocaine to the agent.

All charges against the three men have been dropped. The matter is now being presented to the grand jury.