In your new example above:
@Tony C posted:When you purchase something for business purposes, the amount you incurred should be recorded against/to "X" ledger, instead of "Y" ledger.
I'd use "in" (amounts are recorded in books of account), so that example is different from the original one.
I'd say that an amount can be credited to, or debited from, a loan, or — if you refer to the accounting entry — recorded as credited to/debited from a loan.