Tutorial: Map Screen Fields

Use Online Express to map screen fields from the BLDRCU screen to working-storage fields in the BLDRUPD program.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

In this session, you map screen fields to database and working-storage fields using Online Express, a menu-driven painter with a graphical user interface. Online Express is for any type of online application. It references the information that you have specified, and prompts you to define the processing logic for those specifications.

Map BLDRCU Screen Fields

Complete the following procedures to map the BLDRCU screen fields to the BLDRUPD program.

Start Online Express
  1. From the Project Explorer tab, expand c:\amb_tutorials\BLDRAPPL\dev1 > BLDRAPPL.
  2. Double-click the BLDRUPD program entry. This starts Online Express. Online Express and its Action/Event Browser appear. The Action/Event Browser shows the names of all fields you defined when you painted the BLDRCU screen.
    Note: If a validation message appears, click OK to clear the message.
Access the Field Mapping dialog box
  • From Online Express, click File > Field Mapping. The Field Mapping dialog box appears, listing the screen fields you defined in the Screen Painter.
Create working-storage fields
Because the BLDRAPPL application uses a VSAM database, Online Express provides only the key field in the Field list box of the Field Mapping dialog box. Therefore, you must add working-storage items for the remaining fields on the PART-MASTER-REC record.
  1. Click Field Mapping > Add User Variable. The Create Working Storage Field dialog box appears.
  2. In the Name field, type ws-base-price.
  3. Click OK.
  4. Repeat steps 2 and 3 one time for each of the following fields:
    • ws-dimensions
    • ws-short-desc
    • ws-units-instock
    • ws-inventory-value
  5. Click Cancel. This returns you to the Field Mapping window.
Map screen fields to working-storage fields
Map the BASE-PRICE field
  1. On the Control list, place the mouse over the BASE-PRICE control.
  2. Click and hold the mouse button. The pointer changes to a plug.
  3. Drag the plug to the WS-BASE-PRICE field, and release the mouse. AMB creates a two-way map between the BASE-PRICE control and the WS-BASE-PRICE field.
Map remaining controls
  • Repeat the steps presented in Map the BASE-PRICE field one time for each of the controls listed in the following table.

    Control Name

    Field Name

    DIMENSIONS

    WS-DIMENSIONS

    PRT-NBR

    PM-PRT-NBR

    SHORT-DESC

    WS-SHORT-DESC

    UNITS-INSTOCK

    WS-UNITS-INSTOCK

Change mapping direction
By default, Online Express draws a connecting line with an arrow at each end, indicating that the mapping is two-way. That is, the program moves data from the working-storage field or database record to the screen field, and vice versa. We want our mappings to be one-way instead of two-way.
  1. To create a one-way mapping from the WS-INVENTORY-VALUE working-storage field and the INV-VALUE screen field, click WS-INVENTORY-VALUE, drag the mouse plug to the INV-VALUE field, and drop.
  2. For all other controls, click the control; then click Field Mapping > Mapping Direction > One-way.
  3. Click Apply.
Save your work
  1. Close the Field Mapping dialog box. This returns you to the Action/Event Browser.
  2. Click File > Save.
  3. Click OK to clear any validation messages.

This completes the tutorial. Next, please complete Tutorial: Define Program Actions.