The 25-year-old fell out with Hoffenheim recently when he refused to attend a training camp, but a transfer to Stoke City fell through last weekend when he failed the medical examination.
Ba is now set to join West Ham on a short-term deal, Hoffenheim manager Ernst Tanner confirmed.
"Nothing has been signed, but everything points to the fact that he will go on loan at West Ham," said Tanner.
Ba passed the medical on Saturday and the deal is due to be finalised soon.
Hoffenheim are still hoping to recruit Liverpool's Dutch striker Ryan Babel as a potential replacement
Short link: