SAN FRANCISCO -- In 1985, Hitachi Ltd. raised more than a few eyebrows when it announced the establishment of a $20 million charitable foundation in the United States.

For one thing, such a large gift from a Japanese company had little precedent. For another, it came at a time when Hitachi's image had been sullied by dumping and industrial espionage scandals.

"It left a sour taste in my mouth," says John C. Gibbons, who in 1983 had supervised the successful prosecution of Hitachi for conspiracy to transport IBM trade secrets to Japan. Hitachi insists it had no ulterior motive in starting the foundation.

Few would argue that Japanese companies have learned the science of selling in America. But as Hitachi's experience with its foundation illustrates, the Japanese still have a long way to go before they master the far more subtle art of "corporate social responsibility."

To be sure, satchels of cash help. But appearances can be equally important. To get it right, a company cannot be seen as blatantly trying to buy good will or curry favor. The key to winning this game is a Western concept called "enlightened self-interest," which remains alien to most Japanese.

"Charity and philanthropy as practiced in America come from the Judeo-Christian tradition of noblesse oblige," noted Hiroshi Kamura, director of the Japan Center for International Exchange, a public policy organization in New York. "Japan is a Buddhist nation. Our concept of charity is quite different."

In some cases, Japanese firms are being helped along by cash-hungry charitable organizations. This year, for example, the United Way of Los Angeles has established a special outreach program to target the Japanese business community.

Working with the local Japan Business Association, United Way plans to print a brochure in Japanese and host a reception for Japanese business leaders. "We want them to have a better understanding of both the United Way and the U.S. concept of a broad, ethnically inclusive community," said Sirel Forster, regional vice president.

There are signs that the Japanese are learning how to play the philanthropic game in the United States. Ten Japanese companies paid $100,000 each to "adopt" cable cars during the 1984 restoration of San Francisco's landmark system, and more and more Japanese companies are setting up corporate giving programs and charitable foundations.