Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform table display by nested loop

Former Member
0 Kudos

Hi All,

I am facing a problem on creating smartform for Purchas Order. In that I want display two tables namely ITEM table , DELIVERY SHEDULE table.

for each line item in ITEM table may contain many line item in DELIVERY SHEDULE table. for ex. for line item 10 in ITEM table has ten entries in DELIVERY SHEDULE table.

Now , i want to display first line item on ITEM TABLE and respective entries on DELIVERY SHEDULE table in first page, then second line item on item table and its res. entries in DELIVERY SHEDULE table in 2nd page and so on..

I created the smartform. in Main window I craeted a loop. inside the loop i created ITEM table. I created 2nd loop   inside the first loop with DELIVERY SHEDULE table.   while I executing i am getting  182 pages. item table all enties coming on first page. but delivery table displayed repeatedly in all pages..

Does anyone know what is the problem?

1 ACCEPTED SOLUTION

former_member205763
Active Contributor
0 Kudos

Create a loop node and loop at item table in this and this loop create a table which loops on schedule line, after the inner maintable trigger a page break using command node to navigate to next page for the new item.

PS. A Table itself acts as a loop. so you dont need a loop again

9 REPLIES 9

former_member205763
Active Contributor
0 Kudos

Create a loop node and loop at item table in this and this loop create a table which loops on schedule line, after the inner maintable trigger a page break using command node to navigate to next page for the new item.

PS. A Table itself acts as a loop. so you dont need a loop again

0 Kudos

I changed the SF as you said.    SF output are like this ....

ITEM table has four line item. for this 4 item, totally 18 entries in DELIVERY SHEDULE  table.

In first page i am getting all four entries in ITEM table.  In DELIVERY SHEDULE table all 18 entries are repeated for 4 times..

what i want to display is..

first page i want to display 1st entry of ITEM table and respective DELIVERY SHEDULE entries.

for the 1st entry 4001 has 10 entries in DELIVERY SHEDULE table.  On next page next line item and respective  DELIVERY SHEDULE entries..

one more problem is ..

ITEM table is not displaying on 2nd page.. only DELIVERY SHEDULE entries are coming..

0 Kudos

I got your requirement, the way I told should work, can you send me screenshot of your smartforms nodes

0 Kudos

Now i got the output correctly. initially  I looped the  ITEM table twice.. so i  got all entries in same page.

but the problem not over yet.

as i told earlier,  for line item 7 i hav ten entries in  DELIVERY SHEDULE.  but my first page only hold  3 entries.. so page break automatically triggered.  on next page  remaining  4  entries are shown.

But the ITEM table is not displaying on 2nd page. I also want to display  ITEM table.

check out this,

0 Kudos

Hi Ganesh,

How many pages are used in Smartform Layout ?  is only one page used in the smart form design ?
If only one page is used (e.g. only FIRST page is used to print all the pages in output ), then probably you can try to create a second page in the smartform layout as a copy of FIRST page and trigger the page break .

Regards,

Arulmani

0 Kudos

you know what better try this.you;ll always have single line item for multiple schedule lines and you can match by item number so only have one table on schedule lines.

Now in header use read table to read item table based on item number of the schedule line and  get a work area, display this work area in the header., this will take care of automatic page breaks and also save you nested loops.

0 Kudos

Hello Ganesh,

I think the following should work, although there are multiple solutions possible.

Use a LOOP with the ITEM table as data.

Next, create a TABLE under this LOOP. The data for this TABLE are the DELIVERY SCHEDULE lines.

In the HEADER section of the TABLE, write the header labels AND most importantly, the ITEM line data. Make sure you repeat the header at page break.

In the MAIN section, you can print the SCHEDULE line data.

After the TABLE, but still UNDER the LOOP: create a COMMAND for page break, so that the next ITEM will be printed on a new page.

Visually, it will look like this:

LOOP (items)

     --- TABLE (delivery schedule)

               HEADER: labels + ITEM data

               MAIN     : DELIVERY  SCHEDULE data

               FOOTER

     --- COMMAND (new page)

Have fun!

Best regards,

Zhou

Former Member
0 Kudos

Hi Ganesh,

The repeating of all 18 delivery schedule items for all 4 ITEMS might be due to the 'missing condition' in the second loop (i.e. check the condition in 'delivery schedule' loop  for the corresponding item).

Best Regards

Arulmani

VenkatRamesh_V
Active Contributor
0 Kudos

Hi Ganesh,

Create a  Programming Lines   Add the Condition For Linking Item table and delivery table.

Regards,

Venkat.