In accounting terms, retained earnings refers to the portion of net income retained by a corporation rather than distributing as dividends to its stockholders. Same which true if a corporation has a net loss, the accumulated losses are called retained losses or deficit.
There are two types of retained earnings; unappropriated and appropriated retained earnings. The first could be distributed as dividends to stockholders; whereas, the latter is earmarked for something such as appropriated for capital asset acquisitions, etc. Note that appropriated retained earnings is not available for distribution as dividends to stockholders.
A retained earnings account contains the accumulated earnings/losses of a corporation. All P&L accounts are closed every year-end and their balances are net at the retained earnings account. In an SAP system the purpose of retained earnings account is use as receiver of P&L balances at fiscal year end.
The system carries forward the balance of the P&L accounts to the retained earnings account at every fiscal year end. SAP offers a lot of flexibility to use multiple retained earnings account. You can actually define more than one retained earnings account in your SAP system as you needed.
Here’s a tip on how to define or configure retained earnings account in an SAP system:
Transaction code: OB53
Path: IMG → Financial Accounting (New) → General Ledger Accounting (New) → Master Data → G/L Accounts → Preparations → Defined Retained Earnings Account.
A pop-up screen “Enter Chart of Accounts” appears. Enter the chart of accounts of the retained earnings you want to define then press Enter.
The “Maintain FI Configuration: Automatic Posting – Accounts” appears.

To define retained earnings account, select New Entries button or select Copy button. Enter indicator e.g. ‘Y’ in the P&L statement account type and enter the G/L account of the retained earnings account. Don’t forget to save your work. Select the Save button or press Ctrl+S.
You may also consider reading these: