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

Subtotaling Issue in Smartforms

Former Member
0 Likes
1,271

Hello All ,

I have an issue with smartforms Subtotal.

I had browsed through SDN many with this particular case but I was not able to get the solution.

I had done the required in Calculations tab of Tables in Main Window as shown below ,

Now this thing is working fine for first page , but for second page and later pages it is not calculating properly.

Suppose there are 7 lines in each page then for second and later pages the first line item it is considering is of that of first page and this thing is making subtotal amount wrong for second and all later pages.

There are many thread related to this issue but majority threads are open and I am not able to figure out the solution.

I would be very grateful for helpful suggestions regarding this issue.

First Page ( this is fine )

Second Page ( this is faulty )

Thanks ,

Vipul.

1 ACCEPTED SOLUTION
Read only

Abhijit74
Active Contributor
0 Likes
1,245

Hello Vipul,

Instead of doing it in calculation tab (as described in your picture)  what you can do is take another window for subtotal and inside the window perform your calculation in a program lines.

Take two variables of total and subtotal in Global definition .

Inside program lines write like below:

V_total = Your value.

v_subtotal = v_subtotal + V_total.

Then display this subtotal in a text element.

Thanks,

Abhijit

Hello Vipul,

Instead of doing it in calculation tab (as described in your picture)  what you can do is take another window for subtotal and inside the window perform your calculation in a program lines.

Take two variables of total and subtotal in Global definition .

Inside program lines write like below:

V_total = Your value.

v_subtotal = v_subtotal + V_total.

Then display this subtotal in a text element.

Thanks,

Abhijit

5 REPLIES 5
Read only

Abhijit74
Active Contributor
0 Likes
1,246

Hello Vipul,

Instead of doing it in calculation tab (as described in your picture)  what you can do is take another window for subtotal and inside the window perform your calculation in a program lines.

Take two variables of total and subtotal in Global definition .

Inside program lines write like below:

V_total = Your value.

v_subtotal = v_subtotal + V_total.

Then display this subtotal in a text element.

Thanks,

Abhijit

Read only

Former Member
0 Likes
1,245

Hello Abhijit ,

Very thanks for your prompt reply.

Actually I want this thing in footer part of TABLE . So how can I achieve this thing with your solution.

And one more thing ,

Why system is behaving in such a strange manner i.e it is calculating perfectly for first page but for second page its considering the first line item of first page as first line item of second one.

Read only

Abhijit74
Active Contributor
0 Likes
1,245

Hello Vipul,

In footer you can also create a program line inside the table lines. Even another window after the table which i have stated is also possible to show your desire output.

Your second question .. It's difficult to say from here.

Thanks,

Abhijit

Read only

Former Member
0 Likes
1,245

Hello Abhijit ,

I did the coding using logic on sy-tabix ( Each page consists of 7 lines ). And I appended subtotals in an Internal table.

But I want a more Logical solution to this , the above solution is making the code  more complex .

And I didn't get solution to my below problem :

Why system is behaving in such a strange manner i.e it is calculating perfectly for first page but for second page its considering the first line item of first page as first line item of second one.

For that reason only I am keeping this thread open.

Read only

Abhijit74
Active Contributor
0 Likes
1,245

Hello,


Frankly, I've never done the way your doing the calculation so, it's very hard to say. Anyway just one request could you please check by any chance in the condition tab "Only on First Page" is checked?

Have you created the next page same as first page ?

Thanks,

Abhijit