Obama's visit to Africa's biggest economy is part of a three-nation trip that started in Senegal and will end in Tanzania next week.
Asked about his father's native Kenya, where some are disappointed at Obama's decision not to visit, the U.S. president said the timing was not right but that the United States would continue to work with "one of our oldest partners in Africa."
Obama said he had decided to visit other African nations in part because he had been to Kenya "multiple times."
He said it didn't seem the "optimal time" to go because Kenya had just had a presidential election, which he was pleased to see happen peacefully.
The new administration also has to manage issues around the International Criminal Court, he said.
The ICC has indicted Kenyan President Uhuru Kenyatta, accusing him of funding a local militia that conducted reprisal attacks in the last election in 2007. His deputy, William Ruto, also faces charges of crimes against humanity at the ICC. Both deny wrongdoing.
"If in 3½ years, if I'm not there, you can fault me on my promise," Obama added to his questioners, who were connected to the Soweto meeting via a remote hookup from Nairobi, Kenya.
Mandela critical but stable
Zuma said Mandela remained in critical condition following his hospitalization three weeks ago, but he is stable.
The South African president voiced hope the 94-year-old's condition would improve and that he'd be able to leave the hospital, where he has been since June 8 with a recurring lung infection.
Former South African President F. W. de Klerk and his wife, Elita, have suspended their visit in Europe due to Nelson Mandela's medical condition, the F. W. de Klerk Foundation said Saturday.
The de Klerks will arrive back in Cape Town on Sunday, and "their thoughts are with the Mandela family during this difficult time and they join in their prayers for an improvement in Mr. Mandela's health," the foundation said.
A meeting between the U.S. president and Mandela would have had historic significance.
Like Obama, Mandela broke through racial barriers to become the first black president of South Africa. The two have met before when Obama was a U.S. senator.
As Mandela's condition has deteriorated, South Africans have gathered outside the hospital, praying, lighting candles and leaving notes for the man they refer to as "tata," the Xhosa word for father.
Mandela became an international figure while enduring 27 years in prison for fighting apartheid, South Africa's system of racial segregation. He was elected the nation's first black president in 1994, four years after he was freed.
Mandela remains popular worldwide as an icon of peaceful reconciliation.
"If and when he passes from this place, one thing I think we'll all know is that his legacy is one that will linger on throughout the ages," Obama said.
In addition to a series of events planned for the weekend, Obama will also visit Robben Island, where Mandela spent a majority of his decades in prison.