In this work, in terms of suitable superpositions of equal-frequency Bessel beams, we develop a theoretical method to obtain localized stationary wave fields, in absorbing media, capable to assume, approximately, any desired longitudinal intensity pattern within a chosen interval 0 ≤ z ≤ L of the propagation axis z. As a particular case, we obtain new nondiffractive beams that can resist the loss effects for long distances. These new solutions can have different and interesting applications, such as optical tweezers, optical or acoustic bistouries, various important medical apparatuses, etc..