Two LM317 Based Voltage and Constant Current Regulator Circuit
This really isn't a good solution. You have two regulators, each with their own voltage drop and power loss, full load current running through a potentiometer and inability to reduce output voltage to zero. It would be much better to get a proper design using one output stage with voltage and current limiting.



Figure 1. A two LM317 solution for those who insist. Source: ON-Semi datasheet.

See Smartest way to use current limit using LM317? for a full description of a working solution to some of these problems if you wish to continue with LM317s for this application. I give a detailed explanation of the circuit operation in that answer.