Previous Topic: Rules for Repeating GroupsNext Topic: Changing to a NonRepeating Field


Creating a Repeating Group

You can make a field a repeating group by changing values in the summary table:

In the following example, the level number of the field or fields to repeat was changed from a 2 to 3 for fields 14 through 18.

=> ------------------------------------------------------------------------------- IDEAL: FIELD SUMMARY TABLE PNL ADRMPNL1 (001) TEST SYS: DOC FILL‑IN ================================== T O P ==================================== ¬ORDER#¬______¬CUSTOMER NUMBER¬____¬ORDER DATE¬________; 1 2 3 4 5 6 ¬EMPLOYEE NAME¬___________________________________; 7 8 ........1.........2.........3.........4.........5.........6.........7......... Seq Lv Field Name Attr T Len In.dp Occ N Comments --- -- --------------- ------ - ---- ----- --- - --------------------- 1 2 PSL X 6 ORDER# 2 2 ORDER-NO UAL X 6 ______ 3 2 PSL X 18 CUSTOMER NUMBER 4 2 CUST-NO UAL X 4 ____

5 2 PSL X 10 ORDER DATE 6 2 ORDER- DATE UAL X 8 ________ 7 2 PSL X 13 EMPLOYEE NAME 8 2 EMP- NAME UAL X 35 _____________________ 9 2 PSL X 10 DEPT. CODE

10 2 DCODE UAL X 7 _______ 11 2 PSL X 7 ADDRESS 12 2 ADDRESS UAL X 40 _____________________ 13 2 PSL X 48 QTY ITEM NO ITEM 14 3 QTY UAL N 3 3 ___ 15 3 ITEM- NO UAL X 7 _______ 16 3 ITEM- DESC UAL X 13 _____________ 17 3 UNIT- PRICE UAL N 7 7 _______ 18 3 AMOUNT UAL N 7 7 _______ 19 2 PSL X 12 PHONE NUMBER 20 2 PHONE-NO UAL X 11 ___ _______

When the Field Summary Table redisplays, notice that a level‑2 entry was inserted in the summary table to define as the group name for the repeating group. As shown in the next example, you can give the new entry (field 14) a name that identifies the repeating group (the repeating group name).

The entry for the group name initially is defined with an asterisk (*) in the Occur column. In the summary table shown in the following example, the fields are resequenced to include the group name.

Elementary fields might be on the same line as a repeating group. When a field is defined before the repeating group, it is on the line with the first occurrence of the repeating group. When the field is defined after the repeating group, it is on the line with the last occurrence of the repeating group.

=> ------------------------------------------------------------------------------- IDEAL: FIELD SUMMARY TABLE PNL ADRMPNL1 (001) TEST SYS: DOC FILL‑IN ================================== T O P ==================================== ¬ORDER#¬______¬CUSTOMER NUMBER¬____¬ORDER DATE¬________; 1 2 3 4 5 6 ¬EMPLOYEE NAME¬___________________________________; 7 8 ........1.........2.........3.........4.........5.........6.........7......... Seq Lv Field Name Attr T Len In.dp Occ N Comments --- -- ------------------ ----- - ---- ----- --- - ------------------- 1 2 PSL X 6 ORDER# 2 2 ORDER-NO UAL X 6 ______ 3 2 PSL X 18 CUSTOMER NUMBER 4 2 CUST-NO UAL X 4 ____ 5 2 PSL X 10 ORDER DATE 6 2 ORDER-DATE UAL X 8 ________ 7 2 PSL X 13 EMPLOYEE NAME 8 2 EMP-NAME UAL X 35 _____________________ 9 2 PSL X 10 DEPT. CODE 10 2 DCODE UAL X 7 _______ 11 2 PSL X 7 ADDRESS 12 2 ADDRESS UAL X 40 _____________________ 13 2 PSL X 48 QTY ITEM NO ITEM

14 2 ORDER-INFO G * 15 3 QTY UAL N 3 3 ___ 16 3 ITEM-NO UAL X 7 _______ 17 3 ITEM-DESC UAL X 13 _____________ 18 3 UNIT-PRICE UAL N 7 7 _______ 19 3 AMOUNT UAL N 7 7 _______ 20 2 PSL X 12 PHONE NUMBER 21 2 PHONE-NO UAL X 11 ___ _______

The asterisk in the Occ column indicates that the field or fields are to repeat until the available lines in the region (at execution time) are filled. You can replace the asterisk with a number that indicates the exact number of times for the field or fields to repeat. A panel with fields that repeat a specific number of times is called a fixed‑size panel. If a fixed‑size panel does not fit in the region, the message PARTIALLY SHOWN appears in the right side of the separator line. You can use scrolling commands to view the undisplayed portion of the panel.

The following example shows the layout of the panel after the summary table was edited to define repeating fields. As shown, the start‑field symbol is changed to a repeat field symbol (an at sign (@) in this example) for each field that was defined as a repeating field.

=> ---------------------------------------------------------------------------------- IDEAL: PANEL LAYOUT NULL PNL ADRMPNL1 (001) TEST SYS: DOC FILL‑IN Start ¬ End ; New + Rep @ Del * Move > Copy ¢ Dest ! Width 80 ........1........2........3........4........5........6........7........ ================================== T O P ==================================== ¬ORDER#¬______¬CUSTOMER NUMBER¬____¬ORDER DATE¬________; ¬EMPLOYEE NAME¬___________________________________; ¬DEPT. CODE¬_______; ¬ADDRESS¬________________________________________; ¬QTY; ¬ITEM NO; ¬ITEM DESC; ¬PRICE; ¬AMOUNT; @___; @_______; @_____________; @_______; @_______; ¬PHONE NUMBER¬___¬ _______; =============================== B O T T O M =================================

A repeating group can extend over more than one line; however, you can only include complete lines in the group and they must be contiguous. Individual fields must be complete on one line.

You can include fields in a repeating group on the summary table. The fields to include must be consecutive. To include the fields in a repeating group, change the level from 2 to 3.