When President Jimmy Carter and President Shehu Shagari of Nigeria met publicly last night, the pressing issue of oil politics was left behind colsed doors. Instead, in his toast to the leader of America's second largest suplier of oil, President Carter talked of friendship, the ideals of democracy and the politics of southern Africa.

"To promote majority rule and to promote the end of apartheid, the end of racial discrimination, is a deep commitment of Nigeria which we share," said the American preident.

That was what the Nigerian leader wanted to hear. Since his arrival in the United States last Friday, Shagari has been forceful in his view of the situation in southern Africa as a "holy war" and has hinted that oil could be a weapon in pressing the United States to a more forthright stand on apartheid.

"In our discussions today, President Carter said he saw a great need for action in South Africa," said the Nigerian ambassador to the United Nations, Akporode Clark, referring to U.N. initiatives which Carter apparently has indicated his support for. "This was the first time we heard a commitment to action, not just a commitment of words."

At last night's state dinner in his honor, Shagari delivered a glowing endorsement of Carter, even characterizing the round of meetings in Washington as "a great sacrifice" for Carter in the final weeks of the campaign. Shagari spoke of a broad range of international issues, with a particular emphasis on Pretoria. "It's better for South Africa to heed the voices of reason for a peaceful change than to wait for a violent upheaval," said the Nigerian.

Shagari, 55, a poet, farmer, teacher and businessman as well as an experienced politician, received some good-natured ribbing from Carter. I've got four children, he's got nine. He's got three more years in his term, I only have a few more months. I grow peanuts, he grows groundnuts," said Carter. He didn't mention the similarities The Wall Street Journal found a few weeks ago when it wrote: "Today, after nearly a year in office, Mr. Shagari is widely regarded as somewhat of a Nigerian Jimmy Carter -- a decent, well-meaning man but also weak and indecisive as a leader."

"I've read the press that describes him as noncharismatic but I found him terribly impressive," said Secretary of State Edmund Muskie. "He is low-keyed but he is able to get attention."

But the man who circulated at a diplomatic reception at the Kennedy Center earlier in the evening appeared to be outgoing, thoughtful and witty. He was stopped by David Hofstad, a former Peace Corps teacher who had taught the president's son, Bala. "In fact, Bala was also on the basketball team I coached. And the president asked me if I knew what he was doing now and told me he was a lieutenant in the army and on the army's basketball team," said hofstad.

When President Shagari reached out to shake the hand of Charles T. Williams, he heard congratulations on his speech last weekend in New York. "In fact, I said, 'If I had written the speech myself, I would have written the same one,' and he said that he was interested in having more skilled black technicians come to Nigeria," said Williams, the chairman of the board of the National Business League.

At the Kennedy Center reception, given by Nigerian Ambassador Olujimi Jolaoso, the Nigerian men clearly outshone the women by wearing their native dress. President Shagari wore a flowing white embroidered agbada , and a handwoven cap made in his state of Hausa, now popularly called the Shagari cap.

After President Shagari arrived at the White House and his limousine pulled away, another limousine pulled up with actress Cicely Tyson and choreographer Arthur Mitchell. Guests don't usually arrive at the north portico, but Tyson came that way, according to one White House aide, because that's the way she arrived for the afternoon rehearsal. Last night she read a series of Afro-American and Nigerian poems during the after-dinner entertainment. Tyson also caused some comment with her sable cape of intricate fur pelts and animal heads. The poetry Tyson read added a somewhat lively note to an otherwise subdued evening. Autumn flowers and roast saddle of lamb adorned tables for 180 guests in the State Dining Room and Red Room.

Keeping to the tradition of his other state dinners, President Carter took the opportunity to shore up his support with an ethnic minority. The guest list included four black congressmen, several black business leaders, former U.N. ambassador Andrew Young, author Alex Haley, civil rights activist Coretta King and diplomats Donald McHenry and Carl MdCall.

Secretary of Health and Human Services Patricia Harris, the first cabinet officer to visit Nigeria's new administration last winter, commented on the injection of racism into the presidential campaign.

"I don't understand the press and its insistence that a hard hit is a dirty blow. Reagan was against the Civil Rights Act in 1966," she said. Harris has been quoted as linking Ronald Reagan among the Ku Klux Klan.

Among the guests, the prospects of business and agricultural development in Nigeria was the main issue. Agricultural Secretary Bob Bergland said the development of joint agricultural businesses "all makes sense." By the end of the year, the United States will have a trade deficit in excess of $13 billion with Nigeria, the largest of any country, and Shagari wants to use some of those credits in rebuilding the impoverished parts of his country in what he calls "a green revolution." "It's a great new market," said Atlanta businessman Jesse Hill. "Nigerians have to make progress in agriculture because they import entirely too much food."

But publisher Earl Graves voiced some caution on this kind of American investment trend. "I think it's healthy, but I also think that the opportunities in this country for black Americans are still untapped." Guests at Last Night's Dinner The President & Mrs. Carter. His Excellency Alhaji Shehu Shagari, president of the Federal Republic of Nigeria. His Excellency Dr. Isyaya S. Audu, minister of external affairs of Nigeria. His Excellency Alhji Umaru Dikko, minister of transportation. His Excellency Alhaji Ibrahim Gusau, minister of agriculture. Alhaji Shehu Muss, secretary to the Government of the Federation. His Excellency The Ambassador of Nigeria & and Mrs. Jolaoso. Chief A. M. A. Akinloye, chairman, National Party of Nigeria. Chief Adeniran Ogunsanya, chairman, Nigerian People's Party. The Honorable Dr. Sola Saraki, leader of the Senate. The Honorable Alhaji Y. Kaltungo, leader of House of Representatives. Mr. Bukar Shaib, special adviser. Dr. Chuba Okadgbo, special adviser on political affairs. Professor E. C. Edozien, special adviser on economic affairs. Chief Olu Adebanjo, special adviser on information. Alhaji Y.W. Sada, state chief of protocol. Chief E.U. Okon, Nigerian Newsprint Manufacturing Company, Ltd. Alhaji Isiaku Ibrahim. Chief Akin Olugbade. Chief Jerome Udoji. The Vice President. The Secretary of State & Mrs. Muskie. The Secretary of Agriculture & Mrs. Bergland The Secretary of Health & Human Services and Hon. William B. Harris. The Secretary of Energy & Mrs. Duncan. Hon. Donald F. McHenry, U.S. representative to the United Nations. Senator & Mrs. Carl M. Levin (Mich.) Senator & Mrs. Paul E. Tsongas (Mass.). Rep. & Mrs. Louis Stokes (Ohio). Rep. & Mrs. Charles B. Rangel (N.Y.). Rep. Cardiss Collins (Ill.) & guest Norman B. Houston. Rep. & Mrs. William H. Gray III (Pa.). Hon. & Mrs. Eugene Eidenberg, assistant to the president for intergovernmental affairs. Hon. Frank Press, director, Office of Science and Technology Policy & guest Mr. Paula Press. Hon. & Mrs. Robert S. McNamara, president, International Bank for Reconstruction & Development. Admiral & Mrs. Stansfield Turner, director of Central Intelligence. Hon. & Mrs. Stephen Low, American ambassador to Nigeria. The Chief of Protocol & Mrs. Valdez. Mr. & Mrs. Louis E. Martin, special assistant to the president. Hon. Richard M. Moose, assistant secretary of state for African affairs & guest Ms. Debbie Schwartz. Mr. Gerald Funk, National Security Council staff member. Hon. & Mrs. Donald B. Easum, president, African-American Institute, NYC. Hon. H. Carl McCall, alternate representative of the U.S. to the UN for special political affairs. Hon. Hannah Atkins, U.S. delegate to the 35th Session of the United Nations General Assembly & Dr. Charles Atkins. Mr. & Mrs. Clarence Avant, president, Tabu Recording Co., Beverly Hills, Calif. Dr. & Mrs. Arthur Bagley, West Chester, pa. Mrs. William Barker, Dallas, Tex. Mr. & Mrs. Edward C. Bavaria, vice president for Middle East & Africa, General Electric Corp. Mr. & Mrs. James Blair, St. Louis, Mo. Mrs. Gwendolyn Brooks, author, Chicago, Ill. & guest Mrs. Paula Stroman. Hon. & Mrs. Ronald W. Burris, comptroller, State of Illinois. Dr. & Mrs. James E. Cheek, president, Howard University. Mr. & Mrs. James S. Dawson Jr., Washington D.C. Mr. & Mrs. Lynn Dingler, Portland, Ore. Mr. William Doyle, Minneapolis, Minn. Mr. Robert P. Fitzgerald, vice president, Caroon & Black, Boston, Mass. & guest Ms. Diane Valle. Mr. & Mrs. Lucien Flournoy, Alice, Tex. Hon. & Mrs. Orvill Freeman, president, Business International Corp., NYC. Mr. & Mrs. Earl G. Graves, chairman, Earl G. Graves Ltd., NYC. Mr. Alex P. Haley, author, Culver City, Calif. & guest Mr. Stanley Margulies. Hon. & Mrs. Richard G. Hatcher, mayor of Gary Ind. Dr. Dorothy L. Height, president, National Council of Negro Women Inc. & guest Mrs. Robert A. Hall. Mr. Jake Henderson Jr., Washington, D.C. & guest Mr. Jacob R. Henderson Sr. Mr. & Mrs. Jesse Hill Jr., president, Atlanta Life Insurance Company. Mr. & Mrs. Earl Huddleston, Columbia, Ky. Mrs. Jesse L. Jackson, wife of the national president, Operation PUSH & guest Mr. John Bustamante. Mrs. Maynard Jackson, wife f the mayor of Atlanta, Ga. & guest Ms. Ingrid S. Jones. Mr. & Mrs. George Johnson, president, Johnson Beauty Products Inc., Chicago, Ill. Mr. & Mrs. John H. Johnson, president & publisher, Johnson Publishing Co., Chicago, Ill. Ms. Nellie Stone Johnson, Minneapolis, Minn. & guest Mr. Ronald E. Wills. Mr. & Mrs. Henry H. Kartchner, president, Food Development Corp., Pasco, Wash. Mr. & Mrs. Peter G. Kelly, treasurer, Democratic National Committee. Mrs. Coretta Scott King, president, Martin Luther King Jr. Center for Social Change, Atlanta, Ga. & guest Ms. Carol Hoover. Mr. & Mrs. S. Lee kling, treasurer, Carter/Mondale Reelection Committee Inc. Ms. Mary Mason, Philadelphia, Pa. & guest Ms. Bernita Reeves. Mr. Terence John Moxley, Skaneatelas, N.Y. & guest Ms. Michele Ann Moxley. Mr. & Mrs. Michael Murray, Potomac, Md. Mr. & Mrs. Georg Norford, president, Nigerian-American Friendship Society, NYC. Mr. & Mrs. Christopher O'Neill, Forgoston & Roncalio, Washington D.C. Mr. James R. Pelky, Providence, R.I. Mrs. Garret E. Phillips, national president, Alpha Kappa Alpha, Winston-Salem, N.C. & Mr. Phillips. Mr. & Mrs. Arnold Pinkey, Shaker Heights, Ohio. Mr. & Mrs. Thomas B. Rosenberg, president, Capital Associates, Chicago, Ill. Dr. Mary O. Ross, president, Women's Auxiliary, National Baptist Convention USA Inc., Detroit, Mich. & guest Dr. Myra L. Taylor. Mr. & Mrs. Thomas J. Ryan, president, Pst Dr. Myra L. Taylor. Mr. & Mrs. Thomas J. Ryan, president, Pullman Kellog, Houston Tes. Mr. & Mrs. Lee Saperstein, Detroit, Mich. Ms. Shirley Seymour, St. Louis, Mo. Mr. & Mrs. Daniel N. Silverman Jr., River Ridge, La. Mr. & Mrs. Donald M. Simmons, Muskogee, Okla. Mr. Herbert Simon, Indianapolis, Ind. & guest Ms. Jennifer Simon. Mr. Harold Sims, North Brunswick, N.J. Mr. John Slocum, president, CE Magquire Inc., Providence, R.I. Mr. Jack T. Stephens, chairman, Stephens Inc., Little Rock Ark. & guest Ms. Ann Smith. Miss Cicely Tyson, Pacific & Palisades, Calif. & guest Mr. Arthur Mitchell. Mr. & Mrs. Robert Vickery, Winter Park, Fla. Mr. & Mrs. Robert B. Washington Jr., Danzansky, Dickey, Tydings, Quint & Gordon, Washington, D.C. Mr. & Mrs. George Weissman, chairman, Philip Morris Inc., NYC. The Rev. & Mrs. John R. Wheeler, pastor, Vermont Avenue Baptist Church, Washington, D.C.

Hon. & Mrs. Andrew Young, president, Young Ideas, Washington D.C. Hon. & Mrs. Charles L. Young, state representatives, Meridian, Miss. Hon. Coleman Young, mayor of Detroit, Mich.