INSERT
INSERT ( <table>[<row index>] ).
INSERT ( <table>[<row index>] , <work area> ).
The INSERT command inserts a row into a table parameter. After the INSERT command has been executed, &TFILL contains the current number of rows.
You specify the index of the row to be inserted. If a row already has this index, it and rows with higher indexes have their indexes increased by 1. If the index of the row to be inserted is higher than any currently in the table, the row is inserted at the specified index and empty rows are inserted between it and the existing rows.
The first argument must be a row in a table.
If no work area is specified, an empty row is inserted in the table.
A row is inserted in the table. If the structure of the work area differs from that of the table, fields with the same name are filled. If no fields with the same name are found, an error message is displayed.
Here, we use a table parameter with parameter reference SPFLI[] and a structure parameter with parameter reference SPFLI.
INSERT ( SPFLI_TAB[2] ).
LOG ( &TFILL ).
LOG ( SPFLI_TAB ).
INSERT ( SPFLI_TAB[2] , SPFLI_WA ).
LOG ( &TFILL ).
LOG ( SPFLI_TAB ).