Application Development 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: 

total and subtotal in smartform

Former Member
0 Kudos

hi all,

i am vikas saini . i am creating a smartform and i facing the problem in calculating total and subtotal in smart form.

pls tell me how i can do this...

and tell me also the how i can do next page...

setting.

thanks and regards

vikas saini

2 REPLIES 2

Former Member
0 Kudos

Hi Vikas,

Try this one ok..

In smartforms, u declare two fieds in GLOBAL DEFINTIONS like this

subtotal like vbap-netpr

grandtotal like vbap-netpr

After table in ur table window there is a CALCULATION tab is present go to that tab ok and fill the fields like this ok..

sum total : <itab-fieldname> : subtotal :afterloop ok.

And u have to clear the subtotal after every loop.Write clear statement in PROGRAM LINES ok .

Reward points if helpful

Kiran Kumar.G.A

Former Member
0 Kudos

Hi vikas,

Calculate the subtotal by adding the totals and calculate the grand total by adding the subtotals.

Before doing the calculations, declare variables for total, subtotal and grand total in Global definitions.

for example : InputParameters: WA_EKPO-MENGE,WA_EKPO-NETPR & OutputParameters: V_TOTAL,V_SUBTOTAL, V_GRDTOTAL.

Inorder to display the Subtotals we have to Insert a separate Text Under the Table OI_DISPLAY ORDER ITEM DISPLAY” by right clicking the same.

Enter the Name and Description for the Inserted Text (e.x. Text = “SUB_TOTAL_DISPLAY” and Description = “SUB_TOTAL_DISPLAY” and populated the value for subtotal.

the Variable V_SUBTOTAL has to be refreshed, Inorder the clear the subtotal variable we have to insert “Program Lines” by right clicking the “OI_DISPLAY ORDER ITEM DISPLAY”.

Enter Name and Description for the Program Lines (%CODE1 New program lines 1) Inserted (e.x. Program lines = “CLR_VAR” and Description = “CLEAR SUBTOTAL VARIABLE”. Input parameters = “V_SUBTOTAL”. Clear the variable as shown below:

Now, we have to display the Grand Total (i.e. summation of all the subtotals). Insert “Text” under the “PO_LOOP PURCHASE ORDER NUMBER LOOP” by right clicking the same.

Text “%TEXT1 New text1” gets inserted. Now enter the name and description for the same and also populated the value for grand total

Text = “GRD_TOT_DISP”, Description = “GRAND TOTAL DISPLAY” and Variable V_GRDTOTAL has been populated to display the grand total in the form.

Inorder to display the Current Page Number and Total Number of pages in the form we need a separate window and to obtain the same right click the “FIRST First Page” and the insert window.

Window “%WINDOW1 New window 1” get inserted under the first page.

Enter the Window name and description (e.x. Window = “PG_WIN” and Description “PAGE NUMBER WINDOW”)

Set the window co-ordinates for page number window “PG_WIN” as given below:

Inorder to display the page numbers we have to insert a “Text” by right clicking the “PG_WIN PAGE NUMBER WINDOW”.

Text “%TEXT1 New text 1” gets inserted and now enter the text name and description.

Text = “PG_DISP”, Description = “PAGE NUMBER DISPLAY” and Page Number gets displayed from the Transparent Table “SFSY”.

To create the second page right click the “FIRST First Page” in the left sub-tree.

Another page gets inserted with name “%PAGE1 New page 1”.

for further details pls follow the below link..and let me know if any doubts..

pls reward if helps,

thanks.