RAMP TS014 Step 2 Modifying the SETVALUE Statement

RAMP-TS

RAMP-TS014 Step 2. Modifying the SETVALUE Statement

In this step you will examine the filter of the HR Demo Application and modify the script associated with the FindEmployee screen so that it can be used in multiple locations in the Framework.

1.   Display the properties of the Resources business object.

2.   Select the Filters tab and then the Filter Snap-in Settings tab. Notice that the filter is DF_FILT9. The filter determines the Akey values used to fill the instance list.

 

3.   Close the properties of Resources.

4.   Close the Framework.

5.   Switch to the Visual LANSA editor and locate and open reusable part DF_FILT9.

6.   Search for the AddtoList method in the filter source:

 

7.   Examine the Akey values in the method. Notice that the Empno field is Akey3.

Remember that the script associated with the FindEmployee screen uses the Akey1 value to get the employee number from the instance list (because it is the Akey value used in the By Name filter).

8.   Close DF_FILT9.

9.   Start the Framework.

10.   Start the RAMP Tools.

11.   Locate the script associated with the FindEmployee screen in the screens and scripts list.

11.   Change the SETVALUE statement to:

var wBusinessObject = objBusinessObject.uUserObjectType;
           if (wBusinessObject == 'EMPLOYEES')        SETVALUE("txtEmpno",objListManager.AKey1[0]);
           if (wBusinessObject == 'DEM_ORG_SEC_EMP')  SETVALUE("txtEmpno",objListManager.AKey3[0]); 

 

This statement sets the AKey value according to the name of the business object that is invoking the screen.

12.   Commit changes and do a partial save.

13.   Display the Framework.

14.   Select Resources in the HR Demo Application and fill the instance list.

15.   Display the Details RAMP-TS command handler:

 

The HR Demo Application now consists of a mix of modernized 5250 screens and Framework components.

16.   Verify that the Details command tab on the Employees business object is also still functional.