RAMP TSAD07 Step 4 Enable Function Keys Buttons and Add Required Scripting

RAMP-TS

RAMP-TSAD07 Step 4.  Enable Function Keys/Buttons and Add Required Scripting  

In this step you will enable Next and Previous buttons on the screens to allow the end-user to navigate between the screens in the function. You will also make some changes to the scripts.

1.   Review the properties of screens UFRTS03_D1, UFRTS03_D2 and UFRTS03_D3 and enable buttons/function keys as previously planned.  

UFRTS03_D1 should look like this:

UFRTS03_D2 should look like this:

UFRTS03_D3 should look like this:

2.   Save your changes and restart the Framework. 

Next, review and alter the vHandle_BUTTONCLICK scripts of each of these screens to correctly handle the button navigations.

3.   First, refer to the 5250 navigation picture in RAMP-TSAD06 Step 1.  A Multiple 5250 Screen Scenario .

4.   From this navigation picture you can see pretty easily what needs to be done:

Screen Button/Function Key What screen should result? What vHandle_BUTTONCLICK needs to do

UFRTS03_D1

Next/Enter 

UFRTS03_D2

Send enter key.

The default button script should handle this.

UFRTS03_D2

Next/Enter

UFRTS03_D3

Send enter key.

The default button script should handle this.

UFRTS03_D2

(see note)

Previous/F12

UFRTS03_D1

Send F12 to get to UFRTS03_R1 (junction).

Send Enter to advance to UFRTS03_D1.

The default button script will not handle this.

UFRTS03_D3

(see note)

Previous/F12

UFRTS03_D2

Send F12 to get to UFRTS03_R1 (junction).

Send Enter to advance to UFRTS03_D1.

Send Enter to advance to UFRTS03_D2.

The default button script will not handle this.

 

 

Note the addition of the Previous/F12 operations to UFRTS03_D2 and to UFRTS03_D3. In the underlying 5250 application no such direct navigations exist (ie: you cannot actually go from UFRTS03_D2 to UFRTS03_D1 in one operation).

However, with some simple scripting you can make it appear to the user as if this feature actually exists. This is another simple example of adding value to an existing 5250 application.

5.   Change your vHandle_BUTTONCLICK functions. No changes is required to the UFRTS03_D1 script.

In UFRTS03_D2 use a button click switch construct like this:

 

        switch (sButton)

        {

           case KeyEnter: /* Enter-Next means move forward to UFRTSD03_03 */

                 SENDKEY(KeyEnter);

                 break;

           case KeyF12:   /* F12-Previous means go back to UFRTSD03_01 */

                 Q_SENDKEY("",KeyEnter);

                 SENDKEY(KeyF12);

                 break;

           default:

                 ALERT_MESSAGE("Invalid function key used");

                 break;

        } 

 

In UFRTS03_D3 use a button click switch construct like this:

 

        switch (sButton)

        {

           case KeyF12:  /* F12-Previous means go back to UFRTSD03_02 */

                 Q_SENDKEY("",KeyEnter);

                 Q_SENDKEY("",KeyEnter);

                 SENDKEY(KeyF12);

                 break;

            default:

                 ALERT_MESSAGE("Invalid function key used");

                 break;

        }

Note:

  • These RAMP scripts have been changed to reinterpret what using F12 actually means. On a RAMP tab showing the 5250 screen UFRTS03_D3, the F12 function key now means send F12, Enter, Enter to the 5250 server. This reinterpretation has added value to the underpinning 5250 application because it has enabled the user to move directly to the previous screen from this screen. A lot of quite valuable business process improvement is underpinned by very simple strategies like this.        
  • All invalid function keys now result in an alert message. This is a fail safe only. RAMP should prevent the keys from being used anyway.
  • The use of the Q_SENDKEY() functions. RAMP-TS SENDKEY() operations are asynchronous, so only the first SENDKEY() request can be sent immediately. The subsequent requests need to be queued up and handled when the resulting screen(s) arrive back asynchronously.

7.   Save your script changes and do a partial save of the RAMP definition.

Don’t test your changes until you complete the next step. Without them your application’s navigation may become "stuck", requiring you to cancel the application.