Yamini,
The query raised is in half measure. If you want to have clear guidelines provide details in full.
1. What is your relationship with ABC, debtors, you mentioned, agreed, but what is the nature of transaction between you and ABC, then
2. What is your relationship with XYZ, creditors, agreed, but what is the nature of transaction between you and XYZ, why you owe XYZ?
3. Why XYZ passed on the TDS money to you what for ?
4. When this transactions happened ?
Ultimately, it appears the TDS thus recovered from XYZ by ABC has not been remitted to IT dept. under 94 J. TDS remittance,If this is already overdue then it has to be remitted to govt. a/c together with interest accrued. The crux of the problem a non-deductee cannot take credit of the so called TDS recovered. Money part is one thing and complying with TDS requirement is another thing. Money part could be easily solved when once if you tell me what you did clearly. I could guess, ABC has no obligation to pay XYZ as there appears no transaction between them excepting that ABC made a payment of Rs.2,70,000 presumably on you instructions. RETAINING Rs.30,000 ON YOUR BEHALF which has been passed on to you. Am I correct? Since ABC has no liability per se to pay XYZ there is no question of XYZ accounting for non-existent TDS in his books. Whereas XYZ should get his TDS Form 16A as his payment received is short by Rs.30,000 which in effect is TDS. But prima facie it's YOU legally liable to make payment to XYZ and thus has to a/c for TDS as well.
***You have not indicated what are the entries already passed by you in your books, unless you reveal it is not correct to advise you what should be the entries to correct the so called errors in your books. In other words when you have not stated what are the errors you committed how I can advise about correction entries. Come out clearly