On June 22, three weeks before he was sworn in as comptroller of the currency, John G. Heimann, 48, lunched with a reported-friend at the Federal City Club. "What," Heimann wanted to know, "is going on in Washington?"

Not once did the affairs of Bert Lance, director of the Office of Management and Budget, come up. But the day after Heimann became comptroller - the regulator of all national banks - he knew that he would have to deal with the hottest political issue of the young Carter administration.

Yesterday, a nearly exhausted Heimann, his report on Lance finally out, refused all requests for interviews on the ground that it would be "improper" for him to talk.

But it was clear that what surely will become known as "the Heimann Report" is playing a crucial role in the eventual fate of Bert Lance, close friend of the President. Although Heimann exonerated Lance of any charged warranting criminal prosecution, the language of the report raised repeated questions about the essential morality of Lance's go-go banking.

Curiously, Heimann came to the Carter administration's attention not as a potential banking regulator, but as a candidate for chairman of the Federal Home Loan Board, which regulates the national savings and loan associations.

As a former consultant to the Department of Housing and Urban Developement, and New York state commissioner of housing since November, 1976, Heimann was a logical choice for the FHLBB. But consumer groups blocked that appointment, charging that he had, as New York state supervisor of banks, protected banks that had followed "red-line" practices in the ghettos.

The fact was, as forthcoming New York state report showed, that Heimann had taken an anti-red-line attitude. But Heimann refused to release the report prematurely, and the job went to Carter's naval Academy classmate. Robert H. McKinney, despite opposition by consumer groups who found McKinney insensitive to intercity needs.

Heimann, who was on a top White House list of potential office-holders, then came to the attention of Treasury W. Michael Blumenthal. He was attracted by Heimann's tough attitude on "red-lining" and his experienced both as a bank regulator in New York and in private investment banking.

The two men had never met prior to an interview in Blementhal's office some time last May, but they hit it off well immediately. Heimann has said he believes that the Rube Goldberg structure of banking regulation needs reform, and theat the state banking systems need great strenthening. He is known to think the country is too big for a single, monolithic regulatory agency, as recommended by some, which would combine functions now divided among three federal agencies.

Heimann has had a lifetime commitment to public service, although he did not become at full-time government official until August. 1, 1975, when he became New York state supervisor of banks.

But for nearly 10 years before that, Heimann moved in and out of the investment firm of E.M. Warburg, Pincus & Co., on leave for different government consulting roles. He was in great demand because of his special expertise in capital financing.

Heimann first came to Washington in 1966 to do a study on mortgage credit for HUD Secretary Robert Weaver. This led to the creation of the Government National Mortgage Association (Ginne mae) and a new statues for the Federal National Mortgage Association (Fannie Mae).

Although a registered Democrat, Heimann went back to HUD for a period in 1969 at the request of Nixon's HUD Secretary, George Romney. He returned to Warburg, Pincus until New York Gov. Hugh L. Carey brought him into the state banking system in 1975. Heimann came to Carey's attention for his work in exposing thee financial mess of the Nelson Rockefeller-inspired Urban Development Corp., one of the preliminary episodes in the New York City financial crisis.

Heimann is personable, political astute, a brilliant assembler of facts, and an articulate debater. It is known that he expected, and got, a totally free hand in conducting the Lance investigation.

A key section of his report says that Lance's "recurring pattern of shifting bank relationships and personal borrowing raises unresolved questions as to what constitutes acceptable banking practice."

At his news conference yesterday, Lance denied that this suggested he might not be meeting the high standards of morality demanded by Carter.

There seemed to be a clear implication, in the report, however, that Lance's highly leveraged operations could later lead to Heimann-recommended changes in the law which might make them difficult to report.