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

subtotal in smartforms

Former Member
0 Likes
741

hi friend,

how to get subtotal in smartforms.

regards,

kathir.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
699

In table node, we have calculatio tab.

For example: you are looping at interal table itab, one of the field in the table is NETWR, you need print the subtotal of NETWR on each page.

Declare a global varaiable <b>v_subtotal type netwr.</b>

Create a <b>table node</b>, under the data tab loop at the itab intenal table.

Under the same table node you have the <b>calculation</b> tab.

Mention the following data:

<b>Operation : Total

Field value: itab-netwr

Target field name:v_subtotal

Time:After loop.</b>

You will have subtotal value in the field v_subtotal.

hi friend,

how to get subtotal in smartforms.

regards,

kathir.

3 REPLIES 3
Read only

Former Member
0 Likes
699

hi krishna!

the only best way is to read sap help if u have sap help with you.

sap library>my sap technology comp>sap web application server>basis services>sap smart forms>using sap smartforms>printing data in a table>printing tables>calculations>examples>calculating subtotals

u can find here grand totals,subtotals,numbering table items.

telling how to do subtotals is not possible by simply typing here.so i gave u this navigation in sap help.

award points if helpful

Read only

Former Member
0 Likes
700

In table node, we have calculatio tab.

For example: you are looping at interal table itab, one of the field in the table is NETWR, you need print the subtotal of NETWR on each page.

Declare a global varaiable <b>v_subtotal type netwr.</b>

Create a <b>table node</b>, under the data tab loop at the itab intenal table.

Under the same table node you have the <b>calculation</b> tab.

Mention the following data:

<b>Operation : Total

Field value: itab-netwr

Target field name:v_subtotal

Time:After loop.</b>

You will have subtotal value in the field v_subtotal.

Read only

Former Member
0 Likes
699

Hi,

What you should do is add a new edit mask after the items loop, and have the totals prepared in advance in the print program of your smartform. Pass the totals to the form though another structure.

The other thing you could do, is add abap code in the items loop, summing data as you go in a separate global field defined in the smartform, and display the result in a separate structure after the loop.

Regards,

Shalini