Previous Topic: Selector Role

Next Topic: ENPTUI for NPT Implementations

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:

Follow these steps:

  1. Edit the device design for a subfile function.
  2. Verify that the subfile record extends over more than one display line.

    Example screen with subfile record extending over more than one display line.

  3. 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.
  4. 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:

    In the following example, 06 has been chosen as the SFLFOLD/SFLDROP command key:

    Example Edit Screen Format Details screen with 06 as the SFLFOLD/SFLDROP command key.

  5. 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.
  6. 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.

    Example of the Fold/Truncate text being retrieved from a message.

    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
    
  7. 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:

Example 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:

Example of partially displayed records.