SAP S/4 HANA is a simplification of SAP ERP. The product is not a complete replacement of ERP yet. It began with simplification of finance code of ECC, with Simple Finance. In other terms SAP has replaced the code meant for the finance piece in ECC with a code that takes advantages of the technical capabilities of HANA and ignores other databases. This means that that code will only work on SAP HANA database.
SAP is slowly simplifying other modules. Slowly the ECC part is being replaced by S4 Core.
Now that S/4 HANA is not a complete replacement of ECC, it will have the other modules using the same old code, written on ECC, compatible with all the DBs. This way S/4 HANA stays as a compete product as ECC is.
Does this mean that everything is being replaced? Apparently not. SAP has Succesfactors as its strategic HCM solution. So it will continue to develop HCM part in the compatible way (that works on AnyDB and HANA)
With the evolution of S/4 HANA, the other SAP products are also evolving. Some of the features will be implemented in S/4 HANA and for the parts not implemented, there is a target product.
The following diagram from SAP Teched depicts how the future SAP landscape is likely to change.