How do I limit 'pop up' options for one parameter based on entry of another parameter

My end goal is to get a plant and storage location to pass to a program. In looking for what tables to link to the parameter fields, I went into SE16 and went to table T001L

On the selection screen for doing this, it just so happens it does exactly what i need my program to do. When I select the very first option for plant (WERKS), it brings up a list of plants. If I select a plant, the very next parameter (Storage Locations - LGORT) brings up a limited list. It is limited to the storage locations available to the plant that was selected in the first field. This is perfect for me!

Furthermore, if I were to go to the second field first, it will give me a large selection of all of the storage locations. The first column is plant followed by the storage locations. If I select the storage location, it automatically fills in the first parameter for me with the matching plant. Even nicer!

How do I do this? How are these two parameters tied to each other for this functionality to work that if I select one, it will populate the other. I want my report/program to do the exact same thing.

All help appreciated!