Let $L$ be a Lie algebra. It is known that $L$ admits a Levi decomposition (possibly non unique):


$L=S\oplus rad(L) $,


where $rad(L)$ is the solvable radical and $S$ is a semisimple subalgebra.


If $L$ is reductive, this is, if 


$rad(L)=Z(L)$,


where $Z(L)$ is the center, then $S$ is an ideal.


Is the converse true? Or is it possible to exhibit a non reductive Lie algebra that admits a Levi decomposition such that $S$ is an ideal?


(edited) Is there any method to determine whether is possible to have $S$ as an ideal or not?


Remarks: $L$ is finite dimensional and the underlying field is algebraically closed of characteristic $0$ . The direct sum sign means direct sum of vector subspaces. 



When is the Levi subalgebra an ideal?
To answer the original question: Certainly it's possible for $L$ to be non-reductive (and non-solvable) while a Levi subalgebra $S$ is an ideal. Just form the direct sum as Lie algebras of your favorite semisimple Lie algebra and a nonabelian solvable Lie algebra. I think the additional edited question about when $S$ can be an ideal is more interesting. Throughout the discussion it's important to work just with finite dimensional Lie algebras over a field of characteristic 0, since otherwise the classical results break down.


What's involved here is usually called the *Levi-Mal'cev Theorem*, given thorough treatments in older books such as Jacobson *Lie Algebras* (III.9) and Bourbaki
*Groupes et algebres de Lie* (Chapter I, Section 6.8). (The brief online treatment in the Springer math encyclopedia isn't quite correct, but there may be other online sources.) 


Both parts of the theorem are relevant here: the existence in $L$ of a semisimple subalgebra $S$ complementary (in the vector space sense) to the solvable radical; the conjugacy of all such subalgebras $S$ under the subgroup of automorphisms of $L$ generated by all exp(ad x) with x in the nilradical. Bourbaki states as Corollary 4 of the theorem that every ideal in $L$ is the direct sum of its intersections with $S$ and with $rad(L)$ (the former being a Levi subalgebra in the given ideal). In particular, when $S$ itself is an ideal of $L$ it must be the unique Levi subalgebra. All of this follows easily from the Levi-Mal'cev Theorem, though the proof of the theorem itself is nontrivial. The conjugacy of Levi factors is really essential here, not just the existence. 


To return to the header of the original question, it should be clear by now that $S$ is an ideal precisely when $L$ is a Lie algebra direct sum of a semisimple Lie algebra and a solvable Lie algebra. 


