cancel
Showing results for 
Search instead for 
Did you mean: 

REGARDING TABLE FOOTER IN SMARTFORMS

Former Member
0 Kudos

hi

i hav to pritn 6 items in page1 and 13 items in page2 and so on.

but while calculating total for fields

if pages exceed more than one i hav to fill with constant value'total' for corresponing fields in table in all pages except in last page

in last page i hav to total all the values from page1 and so on and i hav to print in the last page in table footer.

how to do this?

and what code i hav to write and where i hav to write it?

wether in code lines for text or in initialization of global definitions?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Another idea is to have a structure declared in the smartform with the same type of the table being displayed.

In the table body section in the end you can insert program lines to add the required fields in another structure or simply some fields ( declared again in global definitions ) passing the table line data just got processed.

Then use the footer at page break option checked and the option footer at the end of table in the events tab of the table node.

And display the totals per page and also at the end of the table.

Hope this solves your problem.

Ram

Former Member
0 Kudos

declar a variable w_total under the table create program lines

in it write w_total = w_total + it_table-field3.

in footer of the table print w_total and for this node in condition tab check page number is eq form pages are not.

see example smartform: SF_TOTALS and driver program for that it SF_TOTALS.

even there is smartform SF_SUBTOTALS and the driver program for this is SF_TOTALS.

Former Member
0 Kudos

Hi,

Maintain a separate folder for totals . After all the data in the main window is displayed then this window will be triggered that way it will be triggered only at the last page every time.

Regards,

Khushbu.

Former Member
0 Kudos

Hi...

If u have the items in an internal table u can manually check before at which page u need to display the grand total. And at the grand total display use the logic:

if &SFSY-PAGE& = <last page determined above>

display total

endif.

Suppose u have 10 records in the itab..that means your last page will be 2.

Former Member
0 Kudos

hi pratik,

where i hav to write the code which u hav given?

Former Member
0 Kudos

hi

i would like to know the following things :

1) in the first page u want 6 line items, in the second page 13item in the 3rd page how many? is it 20? and in the 4th page 27?

2) and at the end of the page u want total of the line items on that page.

so do u want the consolidated total from next pages or individual totals of the consequent pages?

please clarify on this..

Former Member
0 Kudos

hi ravi,

1st page should hav 6 items if the items r more than 6

from 2nd page onwards each page should contain 13 items the last page can hav less than or equal to 13 items.

but i hav to print the grand totals on the last page onli

if the item details r less than 6 means then i hav to print grand totals on 1st page itself.

Former Member
0 Kudos

hi

if u want the grand totals then u have to use the control break statements.

take a variable to for grandtotal declare it in globaldata.

so u can place the condition(sum=sum + vbap-netwr) and write this value at the end of the page.

im still not much clear with ur requirement.

u can just have a look at the following link its a similar requirement.

"http://saptechnical.com/Tutorials/Smartforms/ControlBreak/demo.htm"

let me know if u want anything else.