I have tab 2 7.0 that will only charge when switched off and even then that's only sometimes, other times I get the battery boot loop.
When device is on it says not charging in battery settings and has a red x through battery icon. It also does the same when connected to a PC but windows does not detect any connection.
I have two of these, both my sons and both do the same. It's an original cable and wall charger. So I'm guessing it could be the cable as I factory reset one of them and still the same problem. It seems obvious but I'm just looking for any advise before I go buying another cable.