

Modifying Device Designs › Editing Device Designs › Add SFLFOLD/SFLDROP to a Subfile Function
Add SFLFOLD/SFLDROP to a Subfile Function
You can automatically add Subfile Fold (SFLFOLD) and Subfile Drop (SFLDROP) functionality to your generated subfile functions. SFLFOLD/SFLDROP lets you define a command key for the function so that it can be used to toggle between folded mode and dropped mode. In folded mode, the subfile displays as it does in the screen designer, with each subfile record taking up more than one display line. In dropped mode, the operating system automatically truncates each subfile record so that only the data fields that appear on the first display line are displayed. This means that twice as many subfile records are displayed.
SFLFOLD/SFLDROP functionality is only applicable to multiline subfiles. That is, subfiles where one subfile record extends over more than one line on the screen. It is available for the following function types:
- DSPFIL – Display file
- DSPTRN – Display transactions
- EDTFIL – Edit file
- EDTTRN – Edit transactions
- SELRCD – Select record
Follow these steps:
- Edit the device design for a subfile function.
- Verify that the subfile record extends over more than one display line.

- Press F17 to display the DISPLAY SCREEN FORMATS panel and select option Z (Details) against the Subfile Control format to display the EDIT SCREEN FORMAT DETAILS panel.
- Enter the desired command key to use for SFLFOLD/SFLDROP, toggling in the Command Key for SFLFOLD field.
Valid values are 03, 05–11, or 13–24. All other keys are reserved for other use by CA 2E.
Notes:
- It is your responsibility to ensure that the selected command key does not interfere with a command key that is already in use for this screen. The 05 command key is usually selected for the *CMD key field *Reset list condition. However if 05 is not used in the *Reset list condition, then the 05 command key is available to be used for SFLFOLD/SFLDROP toggling.
- If this field is left blank, SFLFOLD/SFLDROP functionality is not enabled for this function. Because automatic checking is not done to ensure that the selected command key is not used by the function, it is your responsibility to ensure that the specified SFLFOLD/SFLDROP key does not clash with a command key used by the function.
In the following example, 06 has been chosen as the SFLFOLD/SFLDROP command key:

- Return to the main screen design page, move the cursor to the command key text, and press Enter to display the EDIT COMMAND TEXT panel.
- Press F5 to refresh the display. The text for the specified command key is added automatically.
Edit or remove the text: the Fold/Truncate text is retrieved from message identifier Y2F5361 in message file Y2ALCMSG, which can be edited to globally change the default text. Whether this text is displayed or not, the SFLFOLD/SFLDROP functionality is still enabled for the function.

When the function is generated, code is automatically included in the DDS for the display file and in the source for the program to set and check the subfile mode before and after the screen is displayed. The subfile mode is available programmatically through the *Subfile mode field in the PGM context. It has an internal DDS name SFM, and has the following conditions:
*Folded VAL 0 0
*Truncated VAL 1 1
- Within the action diagram, setting the PGM.*Subfile mode field prior to the screen being displayed causes the screen to be displayed in the desired format (folded or dropped). By default, a screen displays in folded mode. Pressing the specified SFLFOLD/SFLDROP command key when the screen is displayed does not return control to the program but simply causes OS/400 to redisplay the screen in the alternate format (folded or dropped). Upon return from the display, because you have pressed another command key or the Enter key, the value of the PGM.*Subfile mode field can be rechecked to see if the mode has been changed since the screen was displayed.
Example SFLFOLD/SFLDROP
In the previous procedure, when the screen is initially displayed, it displays as follows, where only four records are displayed, each showing the full subfile record:

Pressing F6 redisplays the screen, showing only the first line of each subfile record, with up to 12 records partially displayed. The following panel demonstrates this screen:

Copyright © 2014 CA.
All rights reserved.
 
|
|