
312 So.2d 382 (1975)
Granville Madison McCARROLL
v.
STATE of Alabama.
SC 1155.
Supreme Court of Alabama.
April 17, 1975.
Rehearing Denied May 22, 1975.
Melvin W. Brunson, Mobile, for appellant.
William J. Baxley, Atty. Gen., and Brent Thornley, Asst. Atty. Gen., for the State.
FAULKNER, Justice.
Granville Madison McCarroll was convicted in the Circuit Court of Mobile County of selling heroin. He was sentenced to 20 years imprisonment in the penitentiary. He filed an appeal in forma pauperis with the Court of Criminal Appeals of Alabama. On February 26, 1975, the case was transferred to this court.
On April 19, 1974, a State agent was introduced to McCarroll by King John Stanley, an alleged police informer. After the introduction Stanley left. McCarroll entered the agent's automobile where McCarroll showed the agent a match box containing three capsulesone empty and one containing a substance identified by the State toxicologist as heroin. McCarroll offered to sell the agent 9 capsules *383 for $100. The agent paid McCarroll $100 and took possession of the two capsules. McCarroll said he would supply the remaining 7 capsules at the Mardi Gras Lounge and left with the money paid by the agent. McCarroll never rendezvoused with the agent at the Mardi Gras Lounge.
McCarroll pleaded not guilty and relied on the defense of entrapment. He denied selling heroin to the agent but admitted selling capsules which he said contained nothing more than whole wheat flour. He offered no proof that the capsules contained whole wheat flour, and the toxicologist testified that he found no evidence of whole wheat flour in his examination of them.
During the trial the court sustained objections to efforts by McCarroll to ascertain that King John Stanley was a police informer.
At the conclusion of the trial the court denied a request by McCarroll to charge the jury on entrapment in his oral charge to them. He filed no such written requested charge.
The questions raised on appeal are whether entrapment was a defense whether the trial judge erred in sustaining objections to questions by McCarroll seeking to ascertain that Stanley was an agent of the Mobile Police Department; and, whether the court erred in refusing to charge the jury on the law of entrapment.
The defense of entrapment is not available to a defendant who denies that he committed the offense charged. Rodriquez v. United States, 227 F.2d 912 (1955, CA 5th Cir., Texas). The defense rests on the defendant's admitting the deed but disclaiming the thought. Lindsay v. State, 41 Ala.App. 85, 125 So.2d 716 (1960).
Here McCarroll denied he sold heroin, the offense with which he was charged, to the State agent. He admitted he sold capsules to the agent, which he contends contained whole wheat flour. While we have not been cited a case involving a similar factual situation decided by this court, we find that in State v. Varnon, 174 S.W.2d 146 (1943, Mo.) the defendant admitted selling "Coke" when the State asserted he sold whiskey without a license, to a decoy. The defendant denied making any illegal sale of intoxicating liquor. Admitting selling "Coke" while charged with selling whiskey illegally was not consistent with the defense of entrapment declared the court. This doctrine was affirmed in State v. Egan, 272 S.W.2d 719 (1954, Mo.). In Egan the defendant placed groceries and whiskey in the same bag. The defendant admitted selling groceries, but denied the charge of selling whiskey illegally.
While the defense of entrapment may be raised when a defendant pleads not guilty, the assumption is that the act charged was committed. Rodriquez. In this case, one of the bases of the defense of entrapmentadmission of the sale of heroinwas absent. Therefore, entrapment was not available to McCarroll as a defense. And, the trial judge did not err in refusing to charge the jury on entrapment. Moreover, since the defense of entrapment was not available to McCarroll, the trial judge did not err in sustaining objections to questions seeking the identity of Stanley as a police agent. In Kilgore v. State, 50 Ala.App. 501, 280 So.2d 206 (1973) the Court of Criminal Appeals dealt with virtually the same question as presented here. The court stated:
"The primary purpose for the disclosure of an informer's name or identity is to prevent a miscarriage of justice in cases where an accused might have been entrapped into committing the offense for which he is prosecuted. The fundamental requirements of fairness compels disclosure in such cases where the informer plays a major and active part in bringing about the sale of narcotics and continues an active participant therein.... The defense of entrapment was not available to appellant under these circumstances and disclosure of the female's name could not be compelled." (Emphasis added.)
*384 The record shows that King John Stanley played no part in the purchase and sale of the heroin other than introducing McCarroll to the State agent. Consequently, the disclosure of the informer's status was not required under the facts of this case.
We have searched the record and find no error.
Affirmed.
HEFLIN, C. J., and BLOODWORTH, ALMON and EMBRY, JJ., concur.
