Adobe Forms Part 6: Tables, Subforms and Repeating Item Data
Print item tables in Adobe Forms: table objects bound to DATA[ ], header rows repeating on each page, flowed parent subforms, page breaks, keeping rows together, group headers and subtotals prepared in ABAP, empty-table handling and common table rendering problems.
Explanation
📌 KEY POINTS
✅ A table row is bound to $.IT_ITEMS.DATA[*] with "Repeat row for each data item" — one row per internal table line.
✅ The table and all its parent subforms must be flowed, and page breaks allowed, for tables to continue on the next page.
✅ Header rows can repeat on each page ("Include header row in subsequent pages").
⚠️ Subtotals and grouping are easier and safer when prepared in ABAP (extra rows or group tables) than with complex layout scripts.
━━━━━━━━━━━━━━━━━━━━
▶ WHERE WE ARE
Part 5 passed item tables. Now we render them correctly over several pages.
━━━━━━━━━━━━━━━━━━━━
▶ 1. TABLE OBJECT
- Insert Table (LiveCycle Designer) or drag the table node from Data View.
- Header row: column titles; body row: fields bound to NETWR, ARKTX etc. relative to the row binding.
- Row binding: $.IT_ITEMS.DATA[*], "Repeat row for each data item".
━━━━━━━━━━━━━━━━━━━━
▶ 2. FLOW AND PAGE BREAKS
- Body page subform: flowed; table's parent subforms: flowed.
- Object → Pagination: "Include header row in initial and overflow pages".
- Row property "Allow page breaks within content" off for rows that must stay together.
━━━━━━━━━━━━━━━━━━━━
▶ 3. GROUPING AND SUBTOTALS
- Option A (recommended): driver builds a table with row types (item, subtotal, group header) and a field indicating the type; layout uses presence conditions per row type.
- Option B: nested tables (groups containing items) — context has a group table with an item sub-table.
- Avoid calculating totals in JavaScript/FormCalc across pages.
━━━━━━━━━━━━━━━━━━━━
▶ 4. EMPTY TABLES
Condition in context (table not empty) or a hidden subform with "no items" text.
━━━━━━━━━━━━━━━━━━━━
▶ 5. COMMON PROBLEMS
- Only one row printed: row not set to repeat, or binding to DATA instead of DATA[*].
- Table cut at page end: positioned parent subform.
- Header missing on page 2: overflow header option off.
- Misaligned columns: cell widths and borders.
━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP
- Build the item table with repeating rows and overflow headers.
- Test with 3 and with 80 items.
- Add a subtotal row type prepared in ABAP (code example).
✅ CHECKPOINT: your Adobe Form tables repeat, break across pages and show subtotals reliably.
Code example
* ===== Driver: build a print table with item and subtotal rows =====* Line type ZAF_INV_ROW: ROWTYPE (I = item, S = subtotal), MATKL, POSNR, ARKTX, NETWRTYPES: BEGIN OF ty_src, matkl TYPE matkl, posnr TYPE posnr, arktx TYPE arktx, netwr TYPE netwr, END OF ty_src. DATA: lt_src TYPE STANDARD TABLE OF ty_src, ls_src TYPE ty_src, lt_rows TYPE ztt_inv_rows, ls_row TYPE zaf_inv_row, lv_sub TYPE netwr. SORT lt_src BY matkl posnr.LOOP AT lt_src INTO ls_src. CLEAR ls_row. ls_row-rowtype = 'I'. ls_row-matkl = ls_src-matkl. ls_row-posnr = ls_src-posnr. ls_row-arktx = ls_src-arktx. ls_row-netwr = ls_src-netwr. APPEND ls_row TO lt_rows. lv_sub = lv_sub + ls_src-netwr. AT END OF matkl. " classic control level CLEAR ls_row. ls_row-rowtype = 'S'. ls_row-matkl = ls_src-matkl. ls_row-netwr = lv_sub. APPEND ls_row TO lt_rows. CLEAR lv_sub. ENDAT.ENDLOOP. * ===== Layout (LiveCycle Designer) =====* Table ITEMS in flowed subform, header row repeats on overflow pages* Row ItemRow binding $.IT_ROWS.DATA[*] presence: visible if ROWTYPE = "I"* Row SubtotalRow binding $.IT_ROWS.DATA[*] presence: visible if ROWTYPE = "S"* (presence set by a small FormCalc script per row, or use two tables via context conditions)Real project scenario
A 25-page statement form printed column headers only on page 1 and calculated subtotals in JavaScript that gave wrong results when groups crossed pages.
The team enabled overflow header rows and moved subtotal calculation into ABAP as special row types. Results were correct on every page, and the JavaScript was removed.
Common mistakes
- Binding rows to DATA instead of DATA[*].
- Positioned parent subforms.
- Overflow header not enabled.
- Totals calculated in layout scripts.
- No handling for empty tables.
Best practices
- Flowed subforms and repeating rows.
- Overflow headers for long tables.
- Prepare groups/subtotals in ABAP.
- Test short and long documents.
- Handle empty tables explicitly.
Interview angle
Questions: "How do you print a table across pages in Adobe Forms?", "How do you create subtotals?", "Why is only one row printed?"
Strong answer: row bound to $.IT_ITEMS.DATA[*] with repeat per data item; table and parent subforms flowed with page breaks; overflow header rows; subtotals prepared in ABAP (row types or nested tables) instead of scripts; one row printed = missing [*]/repeat; empty table handling.
Practice this lesson
Quick check
1. Only the first item appears in an Adobe table. Likely cause?
2. Where are subtotals per group best calculated for an Adobe Form table?
3. What is the main functional difference between defining a Context node as a table type versus a structure in an Adobe Form?
Interview questions
1. A purchase order form must print item texts of varying length under each item. How do you design this in Adobe Forms?
Answer it in your own words first, then compare.
2. A purchase order PDF shows only the first item although the internal table has many lines. What is the cause?
Answer it in your own words first, then compare.
Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.
More lessons in this topic
- Adobe Forms Part 1: What SAP Interactive Forms by Adobe Are
- Adobe Forms Part 10: Migrating Smart Forms to Adobe Forms
- Adobe Forms Part 2: SFP Form Design and Layout Basics
- Adobe Forms Part 3: Print Runs, Interactive Forms and Troubleshooting Overview
- Adobe Forms Part 4: Interface and Context Design
- Adobe Forms Part 5: The Driver Program Pattern
- Adobe Forms Part 7: Texts, Logos, Barcodes and Images
- Adobe Forms Part 8: Output Parameters, PDF Return and Spool Handling