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: 

automatic page break in smartforms

Former Member
0 Kudos
380

Dear Gurus....

I have a report which is to be integrated with smart form. I want each PO should start from a new page. I have tried putting an alternative and command in main window but it doesnot solve my problem. Please help me out as i need the solution very urgently...

please mail me the solution here or to my mail id ajayjha_1@rediffmail.com.

Thanks in advance.

1 ACCEPTED SOLUTION

Vinod_Chandran
Active Contributor
0 Kudos
88

Hi Ajay,

Are you using Table or Loop to display your data?

Page break can be acheived using the 'Command node'. In this you have to select the 'Go to next page' check box and give the next page in the adjusant field.

But this cannot be used inside the Table node. The solution for this could be like;

Hope you are displaying the line items. Then get the unique POs in one internal table. Then use the LOOP node to loop thru these POs. Inside the LOOP, use a TABLE node to loop thru its items. Once the TABLE node is processed (after the table node) call the command option.

Hope this will help you. Should you require more clarifications please let me know.

Thanks

Vinod

4 REPLIES 4

Vinod_Chandran
Active Contributor
0 Kudos
89

Hi Ajay,

Are you using Table or Loop to display your data?

Page break can be acheived using the 'Command node'. In this you have to select the 'Go to next page' check box and give the next page in the adjusant field.

But this cannot be used inside the Table node. The solution for this could be like;

Hope you are displaying the line items. Then get the unique POs in one internal table. Then use the LOOP node to loop thru these POs. Inside the LOOP, use a TABLE node to loop thru its items. Once the TABLE node is processed (after the table node) call the command option.

Hope this will help you. Should you require more clarifications please let me know.

Thanks

Vinod

0 Kudos
88

hi vinod,

thx for the reply.. i m using table control..i hav tried tht option... i hav crewated a mail loop in tht i put the item loop and at end i hav added the alternative it_ekpo-ebeln <> it_ekko-ebeln and in tht i put the checked the move to next page...

it works well but it displays 1 page extra at the end with no data... i wish to knw how shd i get the correct no of pages..

Ajay

0 Kudos
88

Hi Ajay,

This can be done using a variable. Pls follow these steps.

1. Get the number of distinct POs in a variable, say w_pocnt. (type i).

2. Just before the page break add a program line node and in that write a code to subtract one from this variable. (w_pocnt = w_pocnt - 1).

3. In the condition of the page break give, w_pocnt > 0.

For example if there are 3 PO's. First time when the page break happens the value of w_pocnt become 2 (because of step 2). Second time it will become 1 and third time 0. Becuase we have given a condition (step 3) there that w_pocnt must be greater than zero to execute this node, you will not get an extra page.

Thanks

Vinod