Picking up user keyboard interactions in RPG is easy
But as usual there are many ways of doing it. Three main techniques are
(1) Assign a numeric value to the function keys
Probably the most common is to assign an indicator value to a function so that CMD01 sets on *IN01, CMD02 sets on *IN02 and so on.
(2) Leave the internal indicators for function keys
I see this a lot and I still sometimes use it if my program has simple function key handling. Basically, if you do not assign a numeric indicator to the function key, good ole' IBM i will assign a free one for us. Namely CMD01 sets on *INKA, CMD02 sets on *INKB, CMD03 sets on *INKC and so on. But... but... beware of the missing alphabet letters ;)
(3) Indicators smell. Dont use them
Define an information data structre in a /copybook and then you can reuse this simple technique where you like. This is my preferred technique.