Upvote:1
You are allowed to do this if you meet certain conditions.
1- Your Chinese visa allows multiple entry
2- You have a Japanese visitor visa, as Japan requires South African citizens to have a visa to visit.
Wikipedia reference
Timatic reference
VisaHQ reference
By the way, a transit visa works if you are on your way somewhere else, what you're looking for is a proper visitor visa in this case