In this paper we develop a technique for avoiding the order reduction caused by nonconstant boundary conditions in the methods called splitting, alternating direction or, more generally, fractional step methods. Such methods can be viewed as the combination of a semidiscrete in time procedure with a special type of additive Runge–Kutta method, which is called the fractional step Runge–Kutta method, and a standard space discretization which can be of type finite differences, finite elements or spectral methods among others. Spectral methods have been chosen here to complete the analysis of convergence of a totally discrete scheme of this type of improved fractionary steps. The numerical experiences performed also show the increase of accuracy that this technique provides.