WAM010 - Using WEB_MAPs
In this step, you will test the WebRoutine and gain an understanding of how it works.
1. WMdemo should still be open in the Design view, if not, open it.
2. Click the Run button on the toolbar to run the WebRoutine in the browser.'
This will open your default Web Browser and request the URL to execute the WebRoutine WMdemo.
3. What happens when no logic in the WebRoutine is executed?
a. Click on the WMDemo Button.
This will execute the WMdemo WebRoutine. Notice nothing has changed or been lost.
b. Try changing any field except Employee Number. Click the WMDemo button again to see that the data has been preserved. The data on the web page was sent to the WMdemo WebRoutine where the WEB_MAP FOR(*BOTH) accepted the values as input.
The RDML logic will not be executed as EMPNO is not blank and STDRENTRY is not equal R. When the ENDROUTINE is encountered, the field's values are sent out to the web page as the WEB_MAP is designated FOR(*BOTH), that is both input and output.
4. Let us look at the effect when some of the logic in the WebRoutine is executed.
As you have changed some fields, click the Read button. Recall, the read logic, that does a FETCH on the Personnel Master with the Employee Number as the key.
The data on the web page should be refreshed with the values for the key EMPNO. This is because the field STDRENTRY is set to R.
The WEB_MAP accepts the EMPNO and STDRENTRY fields along with other data from the page. The FETCH using the EMPNO field is executed and the data for the other fields on the page is set to the values from the master file PSLMST.
If there is no employee record for the value of EMPNO, the original values are returned to the web page. When the ENDROUTINE is encountered, the field's values are sent out to the web page as the WEB_MAP is designated FOR(*BOTH) that is both input and output.
5. What happens if you change the Employee Number field? Or change Employee Number, as well as some other fields?
a. Now click the WMDemo button? The data is preserved , as it should be, as long as employee number is not blank.
b. Click the Read button. If an employee number that exists on the PSLMST was entered, the details for that employee will be displayed. Suitable employee number values are A0090, A0070 or A1001.
In both cases, when the ENDROUTINE is encountered, the field's values are sent to the web page as the WEB_MAP is designated FOR(*BOTH) meaning the fields are both input and output from the WebRoutine.
6. To force the WebRoutine to select the first employee again, click the WMDemo button with no employee number present.
By this point you should understand what the buttons are doing.
This exercise demonstrated how WEB_MAPS with all fields with a FOR(*BOTH) keyword send and accept data from the web page.