Hi SK,
Two points:
1) as you don't seem familiar with tge IF - ENDIF concept of schemas, you should not undetake such a critical change without an experienced colleague. I recommend you take this suggestion and ask a colleague to help you imlementing it. Anybody, who's implemented payroll before will be able to help you.
2) the suggested solution is very basic. In most country versions it would not be guaranteed to work for retro-calculations with a change of company code, because retro processing often calls different parts of a schema (e.g. in UK or Germany) and you would have to make sure they are the same across company codes or add further IF conditions at the right places. That would require a profound understanding of the schema to get it right
3) just to be clear: those 5 company codes are all in the same country, right? Otherwise you can't merge the schemas into one, because a schema is always assigned to a country code.
Kind regards
Sven