I was asked how to do this by someone who said that no-one in his department knew how to: have a second record appear in a subfile when a function key is pressed, and disappear when the function key was pressed again.
Fortunately this is a simple thing to do with just three keywords in the display file's DDS:
- SFLDROP
- SFLFOLD
- SFLMODE
And there is not much we have to do in the RPG program that uses the subfile.
I have deliberately stripped down the display file and RPG code to what I consider a minimum to, in my opinion, makes it easier to understand.
Let me jump right in and show you the display file I will be using in this example:




