High-power laser plays an important role in many fields, such as directed energy weapon, optoelectronic contermeasures, inertial confinement fusion, industrial processing and scientific research. The uniform nearfield and wavefront are the important part of the beam quality for high power lasers, which is conducive to maintaining the high spatial beam quality in propagation. We demonstrate experimentally that the spatial intensity and wavefront distribution at the output is well compensated simultaneously in the complex high-power solid-state laser system by using the small-aperture spatial light modulator (SLM) and deformable mirror (DM) in the front stage. The experimental setup is a hundred-Joule-level Nd:glass laser system operating at three wavelengths at 1053 nm (1ω), 527 nm (2ω) and 351 nm (3ω) with 3 ns pulse duration with the final output beam aperture of 60 mm. While the clear arperture of the electrically addressable SLM is less than 20 mm and the effective diameter of the 52-actuators DM is about 15 mm. In the beam shaping system, the key point is that the two front-stage beam shaping devices needs to precompensate the gain nonuniform and wavefront distortion of the laser system. The details of the iterative algorithm for improving the beam quality and the strategy of achiving high beam quality on spatial intensity and wavefront simultaneously are presented. Experimental results show that the output wavefront RMS value is 0.06, and simultaneously the output near-field modulation is 1.38:1 and the fluence contrast is 10.5% at 3 ns at 1053nm with 40-Joule-level energy.