Binding program arrays to screen arrays
In order to edit a browsable list of records, the program arrays must be associated
to a screen array in the form when defining the INPUT ARRAY
instruction.
In a model-view-controller paradigm, the INPUT
ARRAY
intruction acts as the controller
, the program array is the
model
, and the screen array with the corresponding TABLE
container
is the view
.
In order to associate the program array to the TABLE
container of the current
form, you must specify the screen array corresponding to the form table, when declaring the
INPUT ARRAY
instruction:
INPUT ARRAY cust_arr WITHOUT DEFAULTS FROM sa_cust.*
ATTRIBUTES (UNBUFFERED)
The example INPUT ARRAY
statement binds the screen array fields in
sa_cust
to the member records of the program array custarr
. The
number of variables in each record of the program array must be the same as the number of fields in
each screen record (that is, in a single row of the screen array). Each mapped variable must have
the same data type or a compatible data type as the corresponding field.
The program array is typically defined as a DYNAMIC ARRAY OF RECORD LIKE
tabname
type, that must match the members of the the screen array used
by the DISPLAY ARRAY
instruction.