your question is partial ambiguous, especially I don´t know what you mean with a seven years protection. In addition to this the question how to terminate openended leases is complex and depends on the individual case, which I don´t know entirely.For this reason and because of the low price offered I can give you only a first orientation.
I suppose you want to know which tenants are most easy to dismiss, though they have openended leases.
If you acquire a rented apartment you are automatically party of the lease (as lessor). To finish the lease, you have to terminate it.
Openended leases can be terminated ordinary or extraordinarily. The period for an ordinary cancellation depends on the duration of the contract and is lenghtened according to the duration of the contract .For an ordinary termination there is further a reason necessary following the catalogue written in § 573 BGB. One of these reasons is the personal need of the lessor, another the economic interests of the lessor. But the wish to gain a higher rent is not sufficient for a cancellation, also not the sale of the apartment after the formation of an ownership of residential apartments. In the individual contract can be fixed further possibilities.
In the case of an ordinary termination the tenant has the right to contradict if the cancellation is a hardship for him or his family. This for example is the case if there is a lack of adequate alternative housing spaces or in the case of pregnancy or a family with many children.In general this is also a matter of the particular case.
The other possibility is an extraordinary termination without a period. Precondition therefore is always a breach of duty of the tenant.
In every case you should frequent a lawyer to clarify the judicial details of your case.
I hope these informations are useful for your first evaluation.