Transit Johannesburg Airport

We go to Johannesburg departing Vienna with Lufthansa Arriving At Terminal A. Then we want to go Livingstone in Zambia departing from Terminal B. We would like to check our luggage though. Do we need to go though Immigration? How much Time is requirier to change the Terminals? Thanks a lot for any advice!