Application Development and Automation 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: 
Read only

Sap Smartform Using Template Two Pages

0 Kudos
2,516

Hi friends ,

I want to  use template in the LOOP. İf I print a single page , I get the correct output but If I print  some lines of the table inside the loop another pages , its not correct. The data in the last 2 lines is getting wrong. I don't understand What the problem.  I have added some pictures. Thank you in advance for your help

Table : the data I want to print to the screen.

Correct : the screen its correct.

Wrong1 :The first page of the incorrect output

Wrong2 : The second page of the incorrect output

12 REPLIES 12
Read only

sriram_ramesh
Participant
0 Kudos
1,947

why do you want to use template inside loop?

Read only

Former Member
0 Kudos
1,947

A template can only be used for fixed number of data , means fixed number of row and column . You will have to use Table if you want to implement your logic for multiple pages .

Read only

0 Kudos
1,947

Hi ramesh,

Because there are codes running in loop before pressing the screen so I want to use template in loop. I have used  a lot like this but just gettiing this error.

Read only

0 Kudos
1,947

can you attach a screenshot of your smartform loop?

Read only

0 Kudos
1,947

Read only

0 Kudos
1,947

I'm not finding anything from these screenshots..

did you try debugging the form? - keeping breakpoint in %code3 and check what values comes for sfsy-formpages = 2?

or you can execute your smartform from "smartforms" and display function module->source code and keep a break-point and check

Read only

0 Kudos
1,947

Manish ,

Normally I use table in this cases but I need to do some calculations based on case so I used template.

Read only

0 Kudos
1,947

Ramesh ,

I try debugging  ,  No problem until the second page of rows in the table but three rows. if three rows of the first page and two rows of the second page get output , its incorrect.


if I'll want to display two table in the different page , only I must use the table ?

Should I not use template?

Read only

0 Kudos
1,947

Hi,

Yes. If your rows are to be extended to next page, you must use table not template.

Regards,

Sriram

Read only

0 Kudos
1,947

Is not there another possibility? Because frequently used template. If I could find a way to be excellent .

Read only

0 Kudos
1,947

Hello,

In your case I think its better go without template. Design the same line type for table and use it without any template.

If you want to do some calculations on any field in loop process you may use "Calculations" tab of loop or explicitly add a code in program lines.

Thanks,

Srikanth.

Read only

0 Kudos
1,947

Thanks everyone , I 'll change template.