You can set automatic account assignment through transaction code OKB9 or by using following path;
SPRO > Controlling > Cost Center Accounting > Actual Posting > Manual Actual Postings > Edit Automatic Account Assignment – OKB9
You need to configure automatic account assignment for those cost elements which are not directly entered any cost objects. If you want a particular cost center for a specific general ledger account then you need to set that cost center against the cost elements here in OKB9 transaction.
Click on new entries
Enter your company code and cost elements against which you need to enter the cost center, internal order, profitability segment and profit center to be defaulted.
Save the settings.
If you want to assign default figures for business area and valuation area then you can set in that combination by selecting the selection criteria from the right hand side of the screen.