There cases where you have to do intercompany postings. This will happen in cases where one company is receiving the invoice, but it is applicable for two or more. For that reason you will just do debit first company code to credit second company code, but the system will require clearing accounts to which the opposite site will go.
IMG Path: Financial Accounting (New) -> Financial Accounting Global Settings (New) -> Ledgers -> Real-Time Integration of Controlling with Financial accounting -> Define Account Determination for Real-Time Integration -> Define Intercompany Clearing Accounts
When you initially start the transaction you will be prompted for the combination of company codes for which you will define clearing accounts.
Fill the clearing accounts and the posting keys according to your requirements.