Step 1 Create RDMLX function iiiFN12

LANSA Integrator

Step 1. Create RDMLX function iiiFN12

INT011 - Create Excel Document

This is an advanced exercise and less detailed instructions have been provided.

1.  Create a new process iiiPRO09 – Excel Example. Create an RDMLX function iiiFN12 – Create Employee Excel, using template JSMXSKEL for the service ExcelReadService.

2.  As you have seen in an earlier exercise, this template uses a subroutine KEYWRD to construct the field JSMXCMD. Using RDMLX coding techniques this approach is not really needed, since one statement (ASSIGN command) can create the complicated string needed for each JSM command (JSMXCMD).

3.  Delete the KEYWRD subroutine. Change the SERVICE_LOAD logic to create the command using an ASSIGN command. e.g.

* BUILD THE SERVICE LOAD COMMAND

#jsmxcmd := 'SERVICE_LOAD SERVICE(ExcelReadService)'

USE BUILTIN(jsmx_command) WITH_ARGS(#jsmxhdle1 #jsmxcmd) TO_GET(#jsmsts #jsmmsg)

EXECUTE SUBROUTINE(CHECK_STS)

Remove unnecessary code. Each of your JSMX_command built-in function executions should use this structure.

4.  Define a working list named EMPLOYS, for employee data containing EMPNO, GIVENAME, SURNAME, STARTDTER, PHONEHME, and SALARY. Allow up to 100 entries.

5.  Refer to the LANSA Integrator guide / Java Services Manager Services / ExcelReadService.  Having read these notes you should know that once your function has built a list of employees, it needs to do the following:

  • Open the Excel file using the OPEN command with FILE and MODE parameters.
  • Write to the Excel file using the WRITE command with SHEET and R1C1 parameters. The working list name is passed on the JSMX_COMMAND. Note: SHEET(Sheet1) and R1C1(1,1) are defaults.
  • Close the Excel file using the CLOSE command.