NEW YORK, NOV. 17 -- The jury in the criminal trial of two top Beech-Nut executives charged with intentionally shipping phony apple juice today heard a recorded conversation between John F. Lavery, then a vice president of Beech-Nut Nutrition Corp., and a private investigator for the trade association of apple processors.

The investigator, Andrew Rosenzweig, was the first witness for the government in U.S. District Court in Brooklyn in a case expected to last up to three months.

In the opening statement for the prosecution, assistant U.S. attorney Thomas H. Roche said Lavery's "primary concern was with the bad publicity that Beech-Nut would get, rather than {with} the purity of Beech-Nut's product."

Roche asserted that the case, involving millions of jars of counterfeit apple juice for babies, "is a story of corporate greed and irresponsibility." He said the evidence will show that the knowing purchase of fake juice concentrate saved Beech-Nut up to $1.75 a gallon on hundreds of thousands of gallons.

Lavery, Roche said, directed the shipment of hundreds of thousands of cases of adulterated and misbranded juice, knowing there was "no connection between what was in those bottles and apple juice."

On the tape, Rosenzweig told Lavery and other executives at Beech-Nut's main plant in Canajoharie, N.Y., that the Processed Apples Institute had hired him to track down the sale of bogus juice that neither existing tests -- nor taste, smell or appearance -- could distinguish from the real thing.

Rosenzweig, now chief investigator the office of the district attorney in Manhattan, also told Lavery that he had tracked a load of phony juice concentrate from Food Complex Co. in Queens to the Beech-Nut plant.

The date of the taped conversation was June 25, 1982. The indictment alleges that Beech-Nut continued to ship fake apple juice until March 1983, and that 1983 was the fifth year of a conspiracy with suppliers and of a scheme to defraud consumers.

Lavery's lawyer, Steven Kimelman, countered that Lavery took remedial action "on the spot" by refusing to buy more concentrate from Food Complex. Kimelman told the jurors in his opening statement that, based on the tape, "you will see that he {Lavery} is honest."

Lavery's principal codefendant is Niels L. Hoyvald, 54, who was named president and chief executive of Beech-Nut in 1981. He was given the posts by Nestle SA of Switzerland, which acquired Beech-Nut in November 1979. Both are on paid leave of absence from the company.

In cross examination by Hoyvald's attorney, Brendan V. Sullivan Jr. of Washington, Rosenzweig agreed that at the time other apple juice processors were also beset by problems of hard-to-detect phony concentrates.

Sullivan said the evidence will show the government "has not met its burdens" of proving "the 450 crimes" attributed to his client.

He claimed there is "a stunning absence of evidence" to implicate Hoyvald. On learning of the Food Complex shipment, he said, Hoyvald turned at once for advice to lawyers, including Nestle counsel Thomas Ward in Washington. In turn, Sullivan said, the lawyers sought and heeded guidance from the Food and Drug Administration.

Sullivan called Hoyvald "a man with a reputation for concern with quality" who has made "many and stunning" contributions to improving the quality of Beech-Nut food products, including "the addition of vitamins."

Beech-Nut agreed last Friday to pay a $2 million fine after pleading guilty to 215 felony counts of knowingly and intentionally shipping, for five years, purported apple juice that contained little or no apple juice.