You're setting the variable inside an async function callback. The callback runs after the get action has completed.
Your code will execute in this order:
chrome.storage.local.get("ABC",callback);
then
console.log();
then
callback()
You can verify that by putting a console.log statement in your callback and seeing that it runs after the current one.
Javascript functions run to completion before they run any asynchronous callback calls.
It may make more sense written like this, which is equivalent to what you have right now.
//define the callback
function callbackFunction(result){
global_variable = result; //pass result to global var.
}
//run the get. When it is complete the callback will be added to a queue
//to run next after current operations have completed
chrome.storage.local.get('ABC',callback);
// this will run immediately after the get call
console.log(global_variable);
If you want to work with your variable you will have to put the logic in the callback (or in a separate function called by the callback.