Three companies yesterday announced sales of parts of their business, while a fourth said a pending sale had been canceled.

Union Carbide Corp. of Danbury, Conn., said it had acquired STP Corp. from Beatrice Cos. Inc. of Chicago for $87 million. STP is a leading supplier of automotive products and is based in Boca Raton, Fla. Sales in 1984 were $97 million.

Dallas-based LTV Corp. announced it has decided to seek a buyer for its LTV Steel Specialty Products Co. as part of its restructuring plan to generate $500 million. The division, the nation's second-largest producer of stainless steel sheet, strip and plate, operates plants in Pennsylvania, Detroit, and Louisville, Ohio.

Bausch & Lomb of Rochester, N.Y., said it would acquire Dow Corning Corp.'s aphakic contact lens product line and technology (used after the removal of cataracts). The financial terms of the transaction were not disclosed.

Finally, Textron Inc. of Providence, R.I., stung by recent allegations of overcharging the federal government for defense work, scrapped plans to sell its Bell Helicopter subsidiary. The decision is directly related to the Army's decision to suspend portions of its payments to Bell Helicopter for defense work in the wake of the allegations, said John Carberg, a company spokesman. Carberg refused to rule out the possibility of a future sale.