If GL accounts are defined as cost elements, then a CO object (Cost center, IO) becomes mandatory. When posting in FI, user can always enter the cost center. However when data is populated from cross module say MM/SD automatically, then there is no scope for user to enter the cost center even though it is mandatory. In such cases system will derive the same from OKB9 or default it from Cost element master (KA01) here also you can store the default cost center for each GL/Cost element. In OKB9 the cost centers can be maintained against Cost elements, valuation area wise also
OKB9 is used for making default settings to the GL accounts.
You can assign either a cost center, order or profit center to the cost elements. Whenever the system is not able to find a cost center entered for this expense account it will default from this OKB9 settings.
OKB9 is Automatic Account assignment. This comes into picture when there are postings in external accounting & if you do not enter a CO account assignment. For Eg. Exchange Rate differences, price diffrences, discounts etc asrising should be assigned to relevant object (Cost center or prof segemnt).
This is not necessary for all the primary cost Elements but limited to above circumstances where you think certain cost elements can be defaulted to a Cost Object.
You can assign a cost element to Company code/Val Area/Business area /Cost Center based on flexibility & business requirement.
you need to create the primary Cost element before assigning it in OKB9.