First of all, to post a document relating to a previous year, say 2006 when you are in 2007, the relevant posting period should be ‘open’ in the system. When such a posting is done, the system makes some adjustments in the background:
One: the carry-forward balances of the current year, already done, are updated in case the posting affects balance sheet items.
Two: if the posting is going to affect the Profit & Loss accounts, then the system adjusts the carried forward profit or loss balances to the Retained Earnings account(s)