We investigate two different initial boundary-value problems for derivative nonlinear Schrödinger equation. The boundary conditions are Dirichlet or generalized periodic ones. We propose a two-step algorithm for numerical solving of this problem. The method consists of Bäcklund type transformations and difference scheme. We prove the convergence and stability in C and H1 norms of Crank–Nicolson finite difference scheme for the transformed problem. There are no restrictions between space and time grid steps. For the derivative nonlinear Schrödinger equation, the proposed numerical algorithm converges and is stable in C1 norm.