Siemens has a policy of a 10-year transition period, after they announce the intention for a major product to be discontinued, it will available for another 10 years. However, during the 10 year period the parts will increase in price.
After the expiration of the 10 years phase-out period, the parts will still be available for purchase as spare parts - but at a much increased price.
Since Siemens hasnt announced the start of the 10-year phase-out period, we can assume that both S7-300 and S7-400 will be available for purchase as new parts for at least 10 years.
My hunch is that Siemens will announce the phase-out of S7-300 very soon. No idea about S7-400.