ROBERT CAPA. By Richard Whelan. Knopf. 342 pp. $19.95; ROBERT CAPA: Photographs. Edited by Cornell Capa and Richard Whelan. Knopf. 242 pp. $35.

ROBERT CAPA was the greatest war photographer of his time, probably of any time. His name was his own invention, and much of the legend of his life is his own invention. In a 1949 autobiography, Skillfully Out of Focus, he admittedly exaggerated and embroidered in hopes of a movie sale that would bring sorely needed cash to this perennially broke, wildly amusing, ardently committed, profoundly humane, Hungarian-born Jewish gypsy who never had a home or owned a stick of furniture.

In these two books we see why Capa is credited with setting the standard for committed photojournalism and understand why he captured the hearts of so many who crossed his path. Upon hearing in 1954 that the 41-year-old Capa's legendary luck had finally yielded to a land mine in Indochina, John Steinbeck voiced the affection that Capa drew to himself: "He may have had closer friends, but none who loved him more."

Of the two books, the most vivid is the portfolio of 260 Capa photographs ranging from the Spanish Civil War in the '30s to his last pictures of combat in Vietnam in the '50s. His pictures reveal an earthiness, a humanity and a passion that we may not see again in an electronic age where detachment and objectivity are the reporter's watchwords, where stand-up commentary is more common than the picture worth a thousand words, and where audience-share and cost per thousand are so often the measure of success of photojournalism. Capa said, "To cover a war you must hate somebody or love somebody; you must have a position or you cannot stand what goes on," and he was, despite being classified as an "enemy alien" because of his Hungarian birth, one of 20 American war correspondents awarded the Medal of Freedom by General Eisenhower for coverage of World War II.

Robert Capa is worth reading because it is a carefully assembled chronicle of a remarkable life, but one wishes at times that his biographer had the verve and style to match that of his flamboyant and intrepid subject.

In 1931 Capa left his birthplace in the Jewish section of Budapest for Berlin, where he scrounged and starved before becoming a somewhat unreliable assistant to a photographer, only to be forced to flee the anti-Semitism of the Third Reich for Paris. There he endured several more years of poverty and apprenticeship before taking his 35mm Leica to Spain where he snapped one of history's most famous views of combat, the startling shot of a soldier at the moment he is hit by a bullet, a photograph which Whelan describes as "a haunting symbol of all loyalist soldiers who died in the war, and of Republican Spain itself, flinging itself bravely forward and being struck down." His coverage of the Spanish Civil War started the Capa legend of fearlessly being in the right place to capture what his photographer friend from the Paris days, Henri Cartier Bresson, called "the decisive moment." But Capa was aware that much of the truth of war was "at the edge of things," and his portraits of war were not always of men in battle. Many of his most evocative and heart-wrenching pictures show the faces of war's passive victims, and they mirror Capa's own humanity. "All you could do was to help individuals caught up in war," he said, "try to raise their spirits for a moment, perhaps flirt a little, make them laugh; . . . and you could photograph them, to let them know that somebody cared."

His pictures taken during World War II after the liberation of Naples are particularly haunting. Italian high school boys had stolen guns to fight the Germans during the lst days of the Occupation. Capa photographed black-clad, grief-stricken women mourning beside 20 coffins containing the students'corpses. "Those," said Capa, "were my truest pictures of victory."

Capa covered fighting in Spain, China, Tunisia, Italy, France, Germany, Palestine and Indochina, and concluded that the nature of his trade made unemployment the ideal state of affairs.

War weary in 1948 after nearly being killed by a bullet in Israel, he returned to Paris and told friends, "I am not going to continue to photograph for posterity the men who play this little game."

It was the irony of Capa's existence that what he did best in life was extremely dangerous and dependent upon mankind's penchant for war and the inevitable tragedy that accompanies it. Whelan describes Capa as being "caught in a perpetual crisis of identity after World War II." He tried movies, but directing was not his gift. ("And, besides," he said, "Hollywood and its bright sunshine is a bad place to have a hangover.") He was unsuccessful at writing scripts and at making documentaries for The March of Time ("the pace is too slow.") He established Magnum Photos, a consortium of photojournalists, and was its chief idea man, even managed the agency for a time. (When someone told him he could make millions with all his ideas, he replied, "I'll never make millions. It's the man with one good idea who makes millions. If you have twenty ideas a day you have to give them away.")

His nomadic existence saw him based sometimes in Paris, sometimes in New York, and took him to Hollywood with Bergman, Sun Valley with Hemingway, the Cote d'Azur with Picasso, and Moscow with Steinbeck. But he was, in fact, as he often joked, a permanent resident of his own "state of Cashpoor, of which I will be the treasurer and there will be no money."

IT WAS the need for money which caused him in 1954 to accept a six- week trip to Japan promoting a new magazine, Camera Mainichi. Before going, he spoke of giving up photography, maybe even getting married. He told a lady friend, "It is not a job for a grown up man to click a camera." But Capa was a prisoner of his own legend. While he was in Japan, Life offered him a $25,000 Lloyds of London insurance policy and a $2,000 fee to cover the Indochina War for 30 days, just enough to pay off his debts of the past year. Capa, who compared war to an aging actress, "less and less photogenic, and more and more dangerous," accepted.

Two weeks later, the man who colleagues said "showed an expertness in calculated risk that only a man in his fifth war could know," joined a platoon crossing a field and stepped on a Viet Minh anti-personnel mine. Whelan tells us that Capa "left behind a few unpaid bills, some cameras, a closetful of beautiful clothes, a devastated family, a woman who wanted to marry him, and a couple of hundred people who considered him a friend." He had a remarkable gift for friendship, not friendship in the most conventional sense, but for vigorous and infectious camaraderie. His collection of comrades accumulated in and around half a dozen wars included many of the brightest and most creative people of this time: journalists A. J. Liebling, Ernie Pyle, Charles Collingwood and Quentin Reynolds; photographers Henri Cartier-Bresson, Andr'e Kertesz, Werner Bischoff, and Gjon Mili; film directors John Huston, George Stevens, Howard Hawks and Garson Kanin; writers ranging from Steinbeck to Hemingway, to Malraux, Auden, Isherwood, Hersey, Saroyan and Shaw; and a legion of female admirers and lovers, including Ingrid Bergman before she divorced her first husband. A passage written in the fall of 1947 by Irwin Shaw evokes the spirit that made Robert Capa so fascinating to so many:

"Only in the morning, as he staggers out of bed, does Capa show that the tragedy and sorrow through which he has passed have left their marks on him. His face is gray, his eyes are dull and haunted by the dark dreams of the night; here, at last, is the man whose camera has peered at so much death and so much evil, here is a man despairing and in pain, regretful, not stylish, undebonair. Then Capa drinks down a strong, bubbling draught, shakes himself, experimentally tries on his afternoon smile, discovers that it works, knows once more that he has the strength to climb the glittering hill of the day, dresses, sets out, nonchalant, carefully lighthearted, to the bar of '21,' or the Scribe, or the Dorchester, all places where this homeless man can be at home, where he can find his friends and amuse them and where his friends can help him forget the bitter, lonely, friendless hours of the night behind him and the night ahead."

One reads of Capa's life and is reminded that what counts is not how long you live or how much you earn, for here was a poor man who was rich in friendship and experiences, who will be remembered for setting a standard ofbravery and compassion and for being, simply, the best in his profession. He died, as was noted in a posthumous citation from his colleagues of the American Society of Magazine Photographers, working "in the tradition which he invented, for which there is no other word than his name."