cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding printing page-wise totals in smartforms

Former Member
0 Kudos

I have a requirement that while printing line items in Smartform I want to print page-wise totals i.e, I want to print total of the line items displayed in first page and second page should contain the totals of that page and the first page and last page should contain the grand total.

How to achieve it in the smartform?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To print the pagewise totals:

write program lines after the end of the body section of the table to pass the table row just got processed and add the relevant field/fields.

then in the event tab of the table node check box footer at page break and also the box at end of main window.

in the footer section print the totals captured in the end of the body section.

This prints pagewise totals on each page and also at the end of table.

create another window positioning it correctly to print the grand total and make this window as Final window.

Print the total captured in the end of the body section previously

and with the conditions as below

SFSY-PAGE = 1

OR

SFSY-PAGE = SFSY-FORMPAGES.

This would print the grand total on first page and last page.

The final window is important as the final total will be processed at the end and the final window gets processed for each page in the end again.

This should surely solve your problem.

Regards,

Ram

Answers (7)

Answers (7)

Former Member
0 Kudos

hi,

use this function module RZL_READ_DIR_LOCAL

Rgds

siva

Former Member
0 Kudos

Hi

Try to use given code :

var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
var total = 0;
for (var i=0; i <= fields.length-1; i++) {
if (fields.item(i).name == "PRICE") {
total = total + fields.item(i).rawValue;
}
}
this.rawValue = total;

With Regards

Nikunj Shah

Former Member
0 Kudos

hi naveen,

it is possible in smartform

1. create the main window.

2. create the table.

3.loop at itab into wa_item at data level.

4. maintain the header data.

5. at the end of main area.

mantain a flowlogic .

here mantain logic as follows:

data: lv_pageno type sfsy-pagno.

6. create row type before the main area varible .

which mention the total text and the variables which hold for the total.

but main thing is put condition:

sfsy-pagno. ne lv_pageno.

sure it will work fine.

thanks

AM

Former Member
0 Kudos

Small change before 6th step assign that

lv_pageno = sfsy-pagno.

lv_pageno should bu global.

thanks

AM

bpawanchand
Active Contributor
0 Kudos

Hi

Regards

pavan

Former Member
0 Kudos

Hi,

You can do this:

1> Create a variable for summing the amount field.

2> At each loop pass you go on adding the amount.

3>At end of each page you just display the variable(where ever you are displaying it)

Reward points if helpful

Former Member
0 Kudos

Hi,

Wherever you are printing the total value, in that particualr text element try the following :

In Conditions Tab of the same text element check the check box only after the end of main window.

Hope this will work.

Thanks.

Swati

Former Member
0 Kudos

hi,

In the saptechnical.com there is an example of creating the PO using smartforms.

www.saptechnical.com/Tutorials/Smartforms/PO/page1.htm - 40k

if you go through that example u can find the solution.

please reward me if helpful.

gupta

Edited by: gupta pullipudi on Jul 9, 2008 10:41 AM