cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger a page break for a template for a given condition...

aris_hidalgo
Contributor
0 Kudos

Hello Experts,

In my MAIN window in smartforms, I have defined a template that has 10 line items. Now, what I want

is that if my line items exceeds 10 line items, it will trigger again the same page. Below is the hierarchy

of MAIN window:


-MAIN WINDOW
		-TEMPLATE(HAS 10 ROWS/LINES)
			-LOOP COMMAND
				-PROGRAM LINE(This has a counter that is being incremented for every loop)
				-LINE1(HOLDS 10 TEXT) - only prints if counter = 1
				-LINE2(HOLDS 10 TEXT) - only prints if counter = 2
				-LINE3(HOLDS 10 TEXT) - only prints if counter = 3
				-LINE4(HOLDS 10 TEXT) - only prints if counter = 4
				-LINE5(HOLDS 10 TEXT) - only prints if counter = 5
				-LINE6(HOLDS 10 TEXT) - only prints if counter = 6
				-LINE7(HOLDS 10 TEXT) - only prints if counter = 7
				-LINE8(HOLDS 10 TEXT) - only prints if counter = 8
				-LINE9(HOLDS 10 TEXT) - only prints if counter = 9
				-LINE10(HOLDS 10 TEXT) - only prints if counter = 10

What I want to achieve is that if current loop exceeds 11, then call again MAIN window to serve

the remaining line items. I cannot use a TABLE here since there are frames/boxes that needs to be considered.

I hope you cna help me guys. Thank you and take care!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Keep the loop count in variable say V_COUNT.

Now at the end of loop(inside it only) insert a command node, tick goto new page and direct it to the same page or new page according to ur requirement.

in the conditions tab give the condition as v_count = 10.

кu03B1ятu03B9к

aris_hidalgo
Contributor
0 Kudos

Hi,

I tried putting a command node and ticking the go to page condition but it is still not working.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Viraylab,

First execute the smart form their itself later create the transaction code and execute.

Regards,

Sravanthi

Former Member
0 Kudos

Hi Viraylab,

In the main window
Declare the variable name in the global definitions..
After the loop.

Create the command node 
General attribute : go to new page i.e page 1.
Conditions : s.no = 6 .

Create the text node for the line items to be displayed.

Create the program lines :
serial = serial + 1.
if serial = 6.
serial = 1.
next_page = next_page + 1.
endif.               " if serial = 6.

Regards,

Sravanthi

aris_hidalgo
Contributor
0 Kudos

Hi,

I tried that but when I run the transaction that calls my form nothing happens.I think there is something wrong in my form. But when I checked it, it does not have any errors.