cancel
Showing results for 
Search instead for 
Did you mean: 

How to find page subtotal in tables in a smartform?

Former Member
0 Kudos

Hi All,

Can anyone please help me how to find the page subtotal of any field thats populated in a table in a smartform?

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

Inside table you will see a tab called calculation use sort of begin and sort of end based on the field and do your calculation.

regards,

SaiRam

Answers (4)

Answers (4)

Former Member
0 Kudos

hi ,

for sub-totals create int.table and work area of type your required db.table and go through the below steps.

1. mention the field in Sort Criteria (you can find in DATA tab inTABLE)based on which you want subtotal for another field.And check the check-boxes Event on SortBegin,Event on SortEnd.

2.then you will get 2 nodes with name of the field u have given.before and after main area. for ex.NTGEW Event on SortBegin

NTGEW Event on SortEnd

( for example you want subtotal based on the weight-wise i.eNTGEW and you want to add cases delivered i.e.LFIMG)

3.pass the data to subtotal internal table from int.table which contains item data or from datadbase. in main area

4.below the NTGEW Event on SortEnd node create one loop and under the loop create programlines there you have to write coding for subtotal like in reports,

loop at it_sub into wa_sub.

at end of <f>

sum.

endloop.

and then create one TEXT and give the variable for ex. &wa_sub-lfimg&(which contains subtotal value)

5.and dont forget you should refresh the int.table of subtotal below the NTGEW Event on SortBegin node.

for totals simply mention in the calculation tab.

regards,

rajkumar.

Former Member
0 Kudos

hi ,

for sub-totals create int.table and work area of type your required db.table and go through the below steps.

1. mention the field in <b>Sort Criteria</b> (you can find in DATA tab inTABLE)based on which you want subtotal for another field.And check the check-boxes Event on SortBegin,Event on SortEnd.

2.then you will get 2 nodes with name of the field u have given.before and after main area. for ex.NTGEW Event on SortBegin

NTGEW Event on SortEnd

( for example you want subtotal based on the weight-wise i.eNTGEW and you want to add cases delivered i.e.LFIMG)

3.pass the data to subtotal internal table from int.table which contains item data or from datadbase. in main area

4.below the <b>NTGEW Event on SortEnd</b> node create one <b>loop</b> and under the loop create <b>programlines</b> there you have to write coding for subtotal like in reports,

loop at it_sub into wa_sub.

at end of <f>

sum.

endloop.

and then create one <b>TEXT</b> and give the variable for ex. &wa_sub-lfimg&(which contains subtotal value)

5.and dont forget you should refresh the int.table of subtotal below the <b>NTGEW Event on SortBegin</b> node.

for <b>totals</b> simply mention in the calculation tab.

regards,

rajkumar.

Message was edited by:

rajkumar

varma_narayana
Active Contributor
0 Kudos

Hi..

You can use the <b>PROGRAM LINES</b> node to calculate the page totals in Table node.

Table Node has three sections:

<b>Header: (</b>Triggered once in the beginning of a page)

Create a Program lines node to reset the value of TOTAL to 0.

<b>Main Area</b> (For each row of internal table)

Create a Program lines node to add the Value to TOTAL

<b>Footer</b> (Triggered once in the End of a page)

Display the TOTAL

Note: 1) You can declare the TOTAL variable in the GLOBAL Definitions under GLOBAL DATA.

2) In the PROGRAM lines always pass the TOTAL in both INPUT and OUTPUT parameters

This will work..

<b>Reward if Helpful</b>

Former Member
0 Kudos

Hi

Subtotals in Smartforms - Check the link...

<b>Reward points for useful Answers</b>

Regards

Anji