Step 1. Create the Weekly Command Handler
VFW052 – Build a Working List of Selected Items
1. Create a new :
iiiVFW07
Select Items from List
2. Change the Ancestor to VF_AC010.
3. Select the ribbon. Click on the button to add an attachment manager to the reusable part.
4. Drag and drop a component at the bottom of the form.
5. Drag and drop a List View component into the center of the top area.
6. From the ribbon, open the tab from the Views dialog. Select your component iiiVFW07, for example click on the reusable part's title bar. On the , select the tab and ensure that PANL_1 is defined as Bottom and LTVW_1 is defined as Center.
7. Save your component.
8. On the tab, find the file PSLMST and drag and drop fields EMPNO, SURNAME, GIVENAME and SALARY into the List View.
9. On the tab, expand and drag and drop field STD_TEXTS into the .
10. Click on the column heading for STD_TEXTS and use the tab to change the to Selected, and the to Caption.
11. Select the list view and use the tab to ensure the is Multiple.
12. Save your changes. Your design should look like the following.
13. In the create a field TOTSALARY (it may already exist). The field should be Packed, 15.2 with an edit code which shows a negative sign (for example, edit code L).
a. Add the field TOTSALARY onto PANL_1 at the bottom of the main panel.
b. Change TOTSALARY property to 100. Adjust the property as required.
14. Create an Initialize event handling routine for the List View. Add code to:
- Clear the list view
- Change STD_TEXTS to blanks
- Select the required fields from file PSLMST
- Add and entry to the list view
- End Select.
Your code should look like the following:
Evtroutine Handling(#LTVW_1.Initialize) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Clr_List Named(#LTVW_1)
#std_texts := *blanks
Select Fields(#LTVW_1) From_File(pslmst)
Add_Entry To_List(#LTVW_1)
Endselect
Endroutine
15. Save your changes.