MOSCOW, AUG. 21 -- The Soviet Union may be willing to discuss a compromise with the United States over the West German-based Pershing IA missiles holding up a possible U.S.-Soviet nuclear arms treaty, Sen. Alan Cranston (D-Calif.) said here today.

Following talks with Central Committee Secretary Anatoliy Dobrynin and other leading Soviet officials, Cranston told journalists that some of his Soviet interlocutors have "indicated that a compromise should be possible" on the Pershing IA missiles, clearing the way for a proposed U.S.-Soviet accord on medium- and shorter-range nuclear missiles and a summit between President Reagan and Soviet leader Mikhail Gorbachev.

The Soviets have proposed that the U.S.-controlled warheads on the Pershings be included in a treaty to scrap all U.S. and Soviet missiles worldwide with medium ranges of between 600 and 3,500 miles and shorter ranges of between 300 and 600 miles.

The Reagan administration has objected to the proposal, saying the Pershings are owned by West Germany and should not be part of a bilateral treaty.

The dispute has slowed down ongoing negotiations in Geneva.

Asked what kind of compromise the Soviet officials had in mind, Cranston said they had mentioned no details but had given him the "clear impression" that a compromise was possible.

But he added that, in talks earlier this week, Army Chief of Staff Sergei Akhromeyev was adamant in insisting that the Pershing warheads be included in an accord.

Cranston also said he warned Soviet officials that the U.S. Senate may not approve the proposed accord on medium- and shorter-range missiles.

Cranston, assistant Democratic leader of the Senate and one of its foreign policy experts, said he told the Soviets that Senate ratification of an arms treaty "could be a difficult battle."

In a news conference here yesterday, Sen. Paul S. Sarbanes (D-Md.) said that "if the president reaches an agreement, chances of ratification are quite good."