cancel
Showing results for 
Search instead for 
Did you mean: 

How to do page break in nested table based on inside internal table ?

manusnghl
Explorer
0 Kudos

Hello Experts,

I have one nested table in which I have to do a page break based on the value of the inside table. I am able to do page break for the value of outter table using condition break. But I am not able to page break based on inside table value...

I have data like this

One Page

Header

1

item    B

1         0

2         0

3         1

So my output should be like this

Page 1

Header

1

Item  B

1       0

2       0

Page 2

Header

1

item   B

3        1

So data should be split into 2 pages as at item level value of B is changing .

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

another solution is create a structure in SE11.

ZSTRUCTURE: with fields: row          type i,

                                         table_type type ZTT_TABLETYPE.

where ZTT_TABLETYPE is the table type with structure ZST_TABLETYPE with fields item and B.

now declare an internal table in driver program. ITAB type standard table of ZSTRUCTURE. write the logic to fill this internal table as shown in below image and pass it to adobe layout interface. and now do the same steps which I have told in first reply with condition 'row' as page break point.

now the data of row 1  comes in first page

            data of row 2  comes in second page

            data of row 3  comes in third page

this will definitely gives you the expected output.

Regards,

Satish

manusnghl
Explorer
0 Kudos

Hi Satish,

Thanks for quick solution but in this case how I will handle my header data is also dynamic.

If you see my data is like this :

Header data you can consider deliveries and item in deliveries item and B is HU unit. so they need all HU data together in one page for that particular delivery.

One Page

Header

1   

item   B

1       0

2       0

3       1

Page 2

Header

2

item    B

1       0

So my output should be
like this

Page 1

Header

1

 

Item   B

1       0

2       0

Page 2

Header

1

Item   B
3       1

Page 3

Header

2

item   B

1      0

0 Kudos

Hi,

I have given the explanation based on your initial post example, now as you are saying that even header also varies you have to expand your structure based on the requirement i.e add new field vbeln after row. you can represent your structure as below image. write the logic in driver program and see that your internal table in de-bugging mode looks like below image. once you achieved it simply do the binding and provide the condition break as explained in above post. In the below example you will get 4 pages as output.

base rule is each row no indicates one page, you play accordingly with your data. and do the binding with the respective field names. Hope you got the solution.. please try once.

Thanks,

Satish

manusnghl
Explorer
0 Kudos

Hi Satish,

This worked for me  Thanks a lot. .But only one thing left when my data flow to second page suppose Row value 1 has more item and it cannot accomodate in 1 page then when my data is going on second page then header data is blank . How can I get the same header value that was on last page.

0 Kudos

Hi Manu,

Please try by shifting the Header field to table type, and make sure that you declare header field as 'Text field', and not as table. do the binding.

Satish

manusnghl
Explorer
0 Kudos

Hi Satish ,

I do the same by making the delivery as part of table type . But i kept the value once for 1 row beacause header was reapting with every item so i did java script to hide blank one. But because i have 1 header value so it is coming blank.And if i do text field then how will it get current delivery number.

0 Kudos

Hi Manu,

how is your header field designed? is it designed as a 'table' or 'text field' in the layout? See that it is designed as a 'Text Field'. and do the binding. if you feel that header is repeating wrap the text field in subform and set the property in binding i.e repeat sub form for each data item as Max 1. 

manusnghl
Explorer
0 Kudos

Hi Satish,

My header field is part for table and it is in hearder row, it will repeat .

So header data is in Cell1 for example delivery.

0 Kudos

Hi Manu,

For the header row in pagination tab select the option 'Include header row in Subsequent Pages', before you do this remove the delivery no field from table type and put back along with field row as like before in your internal table.

if still it is not working then,

my suggestion is delete the Header row completely and let your table contain only item values,

now design the header as a text field explicitly above table1 and do the binding with structure header value.

Just try this when keeping header value in table type as I shown in the recent image in driver program, and also try by keeping header value outside the table type in driver program

manusnghl
Explorer
0 Kudos

Hi Satish ,

Finally I achieved my output. I did now another way.

I created one table only in which I have header data and item data like this .

Delivey and Adrnr is my Header data that I have repeated in table , Now in layout Design page, I created one table with body row only and do the binding. Delivery and Adrnr I have kepy hiddden excluede from layout..I used conditional break to have page break based on Delivery or on HU.

Now to get header data .I created header on master page . I read and set  the value of particular delivery and Adrnr on that particular page from the table in Design page .I used below java script on layout ready of the header field for example delivery

// Get the current page

var currpage = xfa.layout.page(this);

// variable to store number of fields in that page.

var fields = 0;      

// Get the number of fields


        fields = xfa.layout.pageContent(currpage-1, "field", 0);

// Loop on each field on the page


        for ( i=0; i<= fields.length-1; i++ )

        {

// Check if the field is in the item table column (it will be actually header data column in your item table)

            if ( fields.item(i).name == "TL" ) 

            {

// Fetch that value and store in your header field.


                       this.rawValue = fields.item(i).rawValue;

            }

        }

Regards ,

Manu

Answers (1)

Answers (1)

0 Kudos

Hi,

At the adobe layout under 'Hierarchy Tab' choose the parent sub form (ex: Page1) of design view which contains your header and item sub forms.

Go to pagination tab of the sub form Page 1 click 'edit'  button at 'Conditional breaks:' Now choose '+' icon and select language as 'Form Calc' and click the icon that is at below 'When' and from the path select the field 'B' of your requirement which is the condition to break pages.

some code gets generated by the system.

Now set the settings as Break--> Before

                                            To --> Top of next page.

execute and see the results.

Satish                                                                

manusnghl
Explorer
0 Kudos

Hi Satish,

This I have alredy tried and not working for item but for header it is working.

Is there any other way ?

Thanks and regards,

Manu