Introduction/purpose: In this paper, we propose a novel code construction method with the zero cross-correlation property, the Flexible Variable Weight Zero Cross-Correlation (FVWZCC). This method is simple and flexible, using different code weights to support different classes of users according to their transmission distance and the quality of services they require (data, audio, and video) in OCDMA systems. The use of higher code weights enables the support of higher-priority application networks, such as long-haul reach networks. The ZCC code structure does not have overlapping of bit '1' and can efficiently eliminates the MAI interference between users and PIIN noise, thus enhancing the system overall performance. Methods: The shifting element position and the concatenation matrix process of the three basic matrices denoted as the Right vector, the basic matrix, and the Left vector were used for the construction of the proposed FVWZCC code. The mathematical analysis and simulations with Matlab and Optisystem software were used to evaluate the performance of the proposed FVWZCC method in SAC-OCDMA systems using the direct detection. Results: The results show a significant improvement in the presented code compared to other existing codes in terms of simplicity, flexibility, and cost implementation. The method uses either constant or variable weight with the Zero cross-correlation property. For a maximum acceptable BER of 10~9 , the simulation results of the SAC-OCDMA system using direct detection under OptiSystem software show better performance of the proposed code with four users of weight 6 at 10 Gb/s. Moreover, it can support up to 60 users simultaneously and reach a fibre distance of about 67 km. Consequently, the proposed FVWZCC code can be applied to support different Quality of Service (QOS) requirements with low cost and low complexity with a direct detection receiver. Conclusion: The findings of this study highlight the need for the FVWZCC code to support end-user QoS requirements. The new approach to code construction offers low-cost implementation, simplicity, and flexibility.