The men, ages 44 and 48, were in the area of Fitzgerald Avenue and Jennings Street at about 7:50 p.m. when two suspects pulled up in a gold Honda sedan and stopped, police said.
One suspect got out of the car and fired about 10 rounds of ammunition, police said.
One victim was hit in the ankle and the other was hit in the back.
A resident took them to San Francisco General Hospital for treatment, police said. Both are expected to survive.
The suspects are only described as two men about 25 years old. No arrests have been made in the case.