cancel
Showing results for 
Search instead for 
Did you mean: 

Loop Table for layout

Former Member
0 Kudos

Dear Friends

I need some help how to accomplish below requirement.

1) I have only one master page and currently data is displayed from work area and lay out looks perfect.

2) Now i have same data available in internal table not in work area . I would like to know if i can write

some routine logic or events where i populate the already existing work area by looping around the new internal table .

3) For each record in the new internal table i want a new page to be triggered too.

Would appreciate few ideas as am new to Adobe forms.

Thanks

Lavanya

Accepted Solutions (1)

Accepted Solutions (1)

pavan_prabhu
Active Participant
0 Kudos

It totally depends on how you want to display the data. Please read carefully below.

Do you want to display the data just as a single row in each page???.

Or do you want to display the data in separate fields spread randomly in each page???

Lets discuss both the cases.

If you were using only the work area till now, let me consider 2 cases.

1st case:  You might have done the binding directly in Master page itself  for separate fields referring to the structure you created earlier. This case is if you are displaying elements randomly according to requirement in different positions.

2nd case: If you are displaying as a single row, then you might have done the binding in design view or master page.

But from now on, your design should only move from master page to design view(body page).

What I am trying to tell is, when you use tables, the sub form linked to this table should always be flowed.

And design view is built for that(especially dynamic data like table data).

Anyways if you have decided to use a table then the sub form has to be flowed. So I assume there is least chance of displaying the fields scattered in all places in a page.  .  Even if there is a chance we will get into it.

Follow the steps below.

For the table sub form-----> let the name of sub form be table_sub

Step 1) Drag the Internal table from the import into the context node in the Adobe form.

Step 2) In layout editor you will be able to see this internal table in data view tab.

Step 3) Don't drag the whole table. Instead, drag only the data part of this table in the content area sub form in the design view tab. If you don't have the sub form, it is will be created automatically for you after dragging the data part.

Step 4) Select this sub form and in the object palette give content as flowed and in place give Following previous.

Step 5) And in Binding section, select the internal table.

Finally,

For the data sub form----> let the name of sub form be data itself

Step 1) Select this sub form and in the object palette give content as flowed and Uncheck "Allow Page breaks within content".

Step 2) In Flow direction you can either give Western text or Top to bottom only. This is what I was speaking about earlier.

  • a) If in case you want to display as a single row, select Western Text.


  • b) If in case you want to show in positioned way (in random places), the data sub form should be positioned and not flowed because you cannot position when it is flowed. So what you should do is, wrap this data sub form in another parent sub form ----> let the name of sub form be data_par of type flowed and now change the data sub form to type positioned.
    • Remember that in this case, data sub form should be wrapped inside data_par and data_par should be wrapped inside table_sub as shown below.
    • table_sub-->flowed
      • data_par--->flowed
        • data------->positioned


Step 3) Data Binding

  • a) If you have followed step 2(a), In Pagination tab of data sub form, give in place "Top of content area <your content area name>".

In binding of data sub form check "Repeat sub form for each data item" and  min count as 1.

  • b) If you have followed step 2(b), even then In Pagination tab of data sub form give in place "Top of content area <your content area name>". But In binding of data sub form check "Repeat sub form for each data item" and  min count as 1. Don't check repeat in data_par sub form because there will be no data binding here. Let the new page trigger from the positioned data sub form itself.

This last step 3 is very important. For each record in the internal table a new page will be triggered.

If for example, you have 3 records in the internal table, then

  • 1st page  - data of 1st record will be displayed.
  • 2nd page - data of 2nd record will be displayed.
  • 3rd page - data of 3rd record will be displayed.
0 Kudos

Hi pavan.prabhu,

Thanks for the explanation.
But I have one small problem, is always creates a empty page at the top !

Do you have any idea why ?


Best regards,

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Lavanya,

I assume you have already pass in the internal table to the form.

You may follow above instruction to modify from existing but it might not work if any of single step missed.

I would advice just build the table no form from new.

http://saptechnical.com/Tutorials/AdobeForms/Table/Create.htm

For the new page setting, just ensure you check Allow Page Breaks within Content under Object Palettes > SubForm Palettes.

Hope this helps.

regards,

Xiang Li

Former Member
0 Kudos

Hi Lavanya,

2) Now i have same data available in internal table not in work area . I would like to know if i can write

some routine logic or events where i populate the already existing work area by looping around the new internal table .

Printing of data in internal table can be done using 2 different methods.

The one that I am explaining is using the subform, where we need not loop the internal table but print all the data in the internal table.

I hope you have designed your form layout using subforms to hold the fields of your work area. If not, wrap the fields in a subform that has the property 'flowed' let's refer it as subform_in from now. Wrap the same in another subform with property 'flowed' let this be subform_out.

Now, go to the binding tab of the subform_out, in the default binding field, bind with the internal table name. this should show you something like $record.LT_ITAB in that field. Once this is done, select the subform_in which is holding your workarea fields and bind this with the data of your internal table. this should show you value like DATA[*].

Just below this default binding field, Select the check box that reads 'Repeat Subform for Each Data Item'. This will repeat your subform for each entry with the consecutive entries of the internal table lt_itab. This will resolve your point number 2.

3) For each record in the new internal table i want a new page to be triggered too.

This can be achieved by re-sizing your content area in the Master Page such that it holds only the data for one entry. So that the next entry goes to the next available content area(i.e. next page).   I am not sure whether this is the right way to do it. But this should work.

Hope this helps.

Cheers,

Vivek.

pavan_prabhu
Active Participant
0 Kudos

For Point no 3, In pagination tab of data sub form, we can use the Top of content area <name of content area>) or In content area in place tab. So whenever each data record is triggered, it will be triggered in new page.