Following is the Guideline for creating New IDs for any Organization Unit in a system:
Irrespective of the localization for which the org unit was created, there can be only one org unit of a particular type with a particular ID. This means that if there is already an ID used for a particular type of org unit, it cannot be used again to create another org unit of same type even for a different localization in the system.
For first country say XX
There can be a Company Code created with ID 2020.
There can be a Plant created with ID 2020.
There can be a Company created with ID 2020 and so on.
For second Country say XY
There can be a Company Code with ID 3030.
But there cannot be a new Company Code created with ID 2020 again.
Similarly, there can be a new Plant created with ID 3030.
and there cannot be a new Plant created with ID 2020 again.
Also same for Company, ID 3030 can be created but not 2020 again and so on.
Regarding Trading Partner, for example:
Company Code 1010
If the trading partner (Company) 1010 is already present in system, then the Company Code with ID 1010 can be created as long as there is no Company Code with ID 1010 already existing in system for any localization.
Refer to following KBA