Subtotal on Smartforms
Hi all,
Can you tell me pl. how subtotal will come on the smartforms.
Rajneesh Gupta.
hi,
welcome to SDN
Check
subtotal in smartforms
Reagards,
Santosh
Similar Messages
-
Hi,
I am facing problem in calculating subtoal of all the line items on separate pages.My Requirement is i have to calculate subtotal of line item on the first page at the first page end after that on the second page i need subtotal of all the amount(NETWR) present on all the line items on the second page subsequently.No of line items are not fixed on all the pages.It may be 4 on 1st page and 5 on second page.
Regards,
Mukesh Kumarhi ,
try this code
<b>In scripts and smartforms how to calculate totals and subtotals?</b>
Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
/: DEFINE &TOT_PRICE&
/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
Then write the variable where ever you want it to be printed (mostly it will be in footer window)
Then create subroutine pool program and you have to write the code.
FORM F_GET_PRICE tables int_cond structure itcsy
outt_cond structure itcsy. data : value type kbert.
statics value1 type kbert.
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
if this helps u ,reward the points,
shan -
Hi,
I have an alv report and a button to make this report to print with smartform. the report has the fields like;
uniqueID
name
age int1
category char25
i want to print subtotals of age for each category and the final total. i finished total but cannot do the subtotal.
Thanks for ur attention.
uniqueID name age category
1 aa 22 football
2 bb 33 football
football total 55
3 cc 44 cinema
cinema total 44Hi,
You have to do subtotal on category, so write create first loop node and pass itab1(wa1 is workarea, which u will give in loop), create second loop node (which will be under firstloop) and pass itab2(same like itab1). Write condition in secondloop that category = wa1-catergory.
write logic subtotal = subtotal + amount. This subtotal should kept in footer of table node(under second loop node).
after second loop node, create program lines. write logic to delete category records(Delete itab1 where category = wa1-catergory).
If u require any more information, revert me.
Thanks,
Thilotham. -
how to calculate sub total in smartforms
give step by step
makCheck out the below related thread .... Hope it helps
total and subtotal in smartform
HI SUBTOTAL IN SMARTFORM
Hi can any one help subtotal in SMARTFORM with sample steps&code
Regards,
Santosh -
How to carry forward subtotal to other page in smartforms
Hi all,
My requirement is to calculate the subtotal of a particular page and to print that subtotal
at the end of each page.And this subtotal has to be carry forwarded as the first item of the next page(say page2).
And again at the end of this page(page2) I have to print the subtotal and needs to carry forward this subtotal again on to
the first item of the page3..
My problem is I am doing it in a table.I am calculating the subtotal and displaying the subtotal at the footer of the table..
In the footer again I am redefining table work area values with the text 'Subtotal' and subtotal Amount so that thinking
that it would print as first line item on the next new page....
But the problem is I am getting subtotal as 2'nd line item on each new page instead of first line item of each page.........
Can anyone resolve this issue.........
I dont want this subtotal to be printed on the last page since I am getting Total of all these subtotals.....
Below is my required structure
Page 1.
Desc Amount
x 100
y 200
Subtotal 300
Page2.(Required page2)
Desc Amount
a 100
b 200
Subtotal 600
Page2.(But getting as below,which I dont require )
Desc Amount
a 100
Subtotal 300
b 200
Subtotal 600
Page3.(Required page3)( I dont require Subtotal here on the last page)
Desc Amount
a 100
b 200
Total 900
Any suggestions pls
This is in Smartform
Thanks,
ChinnuHi ,
First define the global variable for subtotal & grand total
In the first page display the table data normally and if you dont want to print the headers of the table check the condition in the header AT START OF TABLE
calculate the grand totals (Ex. g_tot = g_tot + wa_vbap-kwmeng)
Ex. page1 layout (Note : next page as page2)
Header window
main window
final window
In the final window create an alternative node (in flow logic )
for alternative node put the condition as
sfsy-page = sfsy-formpages
if true
print the data as TOTAL &g_tot&
else (False node)
print the data as SUBTOTAL &g_tot&
Out put will be
page1 o/p
sales order material orderqty
1 M10 10
2 M11 20
3 M12 30
sub total 60 (g_tot value )
page2 onwards o/p
4 M13 30
5 M14 20
6 M15 15
Total 125 (g_tot value )
Let me know if any concerns ......... -
Reg: Subtotal and final total in smartform?
Hi Experts,
I'm working on a smartform where i need to display the line items from lips table.
This is my final internal table.
TYPES : BEGIN OF it_final,
matnr TYPE lips-matnr, "Article
vbeln TYPE likp-vbeln, "Delivery Number
arktx TYPE lips-arktx, "Article Description
vrkme TYPE lips-vrkme, "Unit of Measure
lfimg TYPE lips-lfimg, "Delivery Quantity
kunag TYPE kunag, " Sold To
name TYPE name1, " Name
charg TYPE lips-charg, "Batch Number
vfdat TYPE lips-vfdat, "Expiry Date
lgort TYPE lips-lgort, "Storage Location
matkl TYPE lips-matkl, "Merchandise Category
wgbez TYPE t023t-wgbez, "Merchandise Category Desc
lgpbe TYPE lips-lgpbe, "BIN Number
pikmg(20) TYPE c, "Picking Quantity
route TYPE likp-route, "Route
END OF it_final,
For one material number, there will be many line items, I need to have a subtotal for a particular material and at the end i need afinal total for all the material number.
I have sorted my internal table as sort it_final ascending by matnr vbeln.
Then this internal table is moved to smartform.
In smartform i'm using table to display the complete data. Here i need to segregate into subtotal and total.
Please help me to display the data in below format.
For Ex:
MATNR DESC QTY VBELN
1000001 tea 12 3500000012
1000001 tea 02 3500000013
subtotal 14
1000006 salt 01 3500000013
subtotal 01
1000008 sugar 02 3500000015
1000008 sugar 02 3500000012
1000008 sugar 02 3500000013
1000008 sugar 02 3500000016
subtotal 08
Total 23
Thanks in advance.
Guys, The data is not getting displayed in Preview properly. Please edit and read it or copy in the notepad and read it.
Regards,
Abdur Rafique
Edited by: abdur rafique on Aug 8, 2009 3:38 PMHI,
for the total it is easy.
Just calculate the total in a variable just before the table in the smartforms.
Display the total variable in the FOOTER section of the table.
To display the subtotal you will have to do i bit of workaround.
In the table create 2 LINE TYPES.
The 1st line type will have the four columns to display MATNR DESC QTY VBELN.
The 2nd line type will be of single column which will be used to display the subtotal.
In the main section of the table create 2 rows of the above line types.
In the 1st row display the MATNR DESC QTY VBELN as normal.
In the 2nd row display the subtotal.
This should be done as follows:-
Add one more column in your internal table as follows:-
MATNR DESC QTY VBELN SUBTOTAL.
Now you have to do some coding to create your internal table as follows:-
MATNR DESC QTY VBELN SUBTOTAL.
1 test 10 100001
1 test 10 100002
1 test 20 100003 40
2 test2 10 100006 10
3 test3 50 100009
3 test3 60 100010 110
This internal table should be created before displaying the table in the smartforms.
Then this internal table should be used in the smartforms.
The subtotal column should be shown in the 2nd row of the main area of the TABLES.
Also add a condition to it that it should be shown only when the column SUBTOTAL of the table contains any value.
So in this way you will be able to achieve your required output.
i hope you understand my idea.
regards,
Ankur Parab -
How to find page subtotal in tables in a smartform?
Hi All,
Can anyone please help me how to find the page subtotal of any field thats populated in a table in a smartform?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 -
Smartforms Subtotal alignment in various pages
Hi all ,
I have a requirement in smartforms as follows.
There are subtotals to be printed on all the pages , and subtotals and totals to be printed on the last page. However , the location of the subtotal box in the middle pages and in the last page is not same. In the last page it is a bit above the middle page subtotal box level.
I have created two pages with the layouts as desired , but the condition to trigger them is not sure , as we dont know when the main window item details are going to end.
How can the requirement that the subtotal be printed at a lower level on all the pages except on the last page where it has to be printed at a higher level.
Thank you very much.
santhosh.Hi,
Create a Window and maintain the logic to print the Subtotal, and place the window below the Main Window. And also under new window... "Conditons" Tab... under output conditions..... Flag...Only after End of Main Window".. This will solve.
Regards
GK. -
How to code subtotal of itemlines for page-break in SmartForms in 4.6C?
Hi,
There's no functionality in SmartForm 4.6C in order to make a subtotal at a page-break.
Can you please tell me how to code in the SmartForm to catch the page-break and put the subtotal?
Please help me its very urgent! Points assured!!
Tarick.Hi,
in the events tab of table u can find the event at page break for both header and footer.
i think u can try with this.
reward points if useful.
Regards,
Pavani. -
Subtotal in Table Footer Appears in Body on the Next Page - Smartform
Hi experts,
I have a subtotal row in my table footer. It works find (appears correctly for each page). But when I check the body of the table, in page 2, there is a line with the subtotal amount from page 1, appearing in line 2. Do you guys know why does this happen and how to solve it?
Thanks,
SamHi Sam,
1. Can you cross check whether you have coded anything which will modify the internal table content with the subtotal value?
2. Did you keep any condition like printing the sub total at each new value for a particular field
(Eg: If there is a field f1 in your internal table with values a, a, a, b, b, b, d, d, d - is there any condition to print sub total when f1value changes from a to b or b to d ? )
Regards,
Swarna Munkoti. -
Smartform - Subtotal on each page - Reset on new page
Hi Experts,
I am using table calculation tab to calculate my subtotal.
I want to rest this subtotal to zero for every new page. I want page wise subtotal.
Can anyone suggest how do I go about it. I have included a program lines and checked for a change in the page number and tried to clear the subtotal. But it does not work.
if page ne sfsy-page.
clear: subdebit, subcredit.
page = sfsy-page.
endif.
The first line of the second page is getting missed out in the subtotal.
Regards,
AbdullahHi,
Calculate subtotal by placing program lines node in Table after displaying the Line items. Display the subtotal field in Footer Node of table. It automatically reset for every new page.
If it is not working then try with Sort of Begin and Sort of end events which are available in Table node.
Clear Subtotal field value in Sort of begin node and display the Subtotal in Sort of End node. It is working just like Control break statement in Reports. -
Need to create a a line after each subtotal-Smartform
Hi I need to create a uline after each of the sub totals in my smartform.Like if theer are 7 items in the form and for each of the item there are 2-3 sub-items under it , I have calculated the sub totals for each of the item and to distingusih tjem separately i want to create a line after each of my sub totals for the items . How do i create the line after each of the items ?
Thanks
AaravHi Aarav
Read this wiki.In the 8th step given there,GOTO the text element and give a ULINE there if needed.
I think since this example is of tabular display you might not need a ULINE there.
[https://wiki.sdn.sap.com/wiki/display/ABAP/SUBTOTALINSAP+SMARTFORMS]
This defnitly will solve your problem.
Regards
Hareesh -
Can we use control events in smartforms
Hi all,
I am srinivas. can we use control events in smartforms, I mean at new, at end of ..... if these are not used can you suggest me any alternative....
Actually my requirement is like a classical report, for which I need to display subtotal and grand totals based on two fields....
Please help me out in this issue as it is very urgent.
<b><REMOVED BY MODERATOR></b>
Thanks in advance....
Regards,
Sri...
Message was edited by:
Alvaro Tejada GalindoHi Nick,
Thanks for the reply... it is really very useful for me.
As I discussed in my earlier mail regarding the output sequence, which should be in the below format.
number quantity uom unitprice amount curr
plant
material
date
x y z A
e f g h
p q r s
subtotal date..... 1 2 3 4
subtotal material.5 6 7 8
As you said when I using <b>event of Begin</b> its working fine. but while using the <b>event of end</b>, I am specifying date and then matnr (sort) its taking(nodes are created mean first matnr and then date) in the reverse order and when I am taking matnr and date it is placing the events(nodes) in the right order but the order date is not triggering.
can please tell me how to proceed here..
waiting for your reply..
Regards,
Srinivas -
How to calculate the subtotals in smartform
hi all
can any body tell me how can i display teh subtotals in smartform, please tell me the steps how to do that and aslo is there any special events in smartforms that are helpfull in getting and displaying the subtotals in smartforms
thanks in advanceHi,
For doing subtotal calculation in SMARTFORMS, do like this.
Create one "Program Lines" to your main window table row.
Already you are maintaing "Internal table" for you table in main window.
Before that, sort the particular internal table with key fields through which you want to find out the sub total, now within the program lines code, first identify how many quantity and currency fields are there.
Declare respective temporary variables for each and every quantity and currency field.
then write logic like this.
at new matnr.
v_menge = wa_out-menge + v_menge.
v_netwr = wa_out-netwr + v_netwr
end at.
Also dont forget to declare character variables for quantity and currency fields. We cannot directly display them in smartforms. we need to pass them to the respective quantity and currency fields.
After end at statement write like this,
write: / v_menge decimals 2 to v_mengetext,
v_netwr decimals 2 to v_netwrtext.
after this dont forget to clear,
clear: v_menge, v_netwr.
no populate v_mengetext and v_netwrtext in your text elements.
Regards,
Santosh Kumar M. -
HTML scrollbar issue in Smartforms
Hi,
I have a requirement to generate smartform output in HTML format and send it via email to internet users.
We are able to successfully generate the HTML output of smartform and send it via mail.
But when smartform HTML output is displayed in the mail content (i.e. in the body of the mail), it is generating vertical and horizontal scroll bar in the main window although I have defined next page with main window in smartform.
The main window has 2 tables. One for item details and second for subtotal and footer.
Current page setting is portrait and I tried to change it landscape but still it is generating scrollbars.
Is there a way to remove these scroll bars from the HTML output.
Thanks-what is the page size that u set in form attributes?
it shud be equal to size of mail body of the mail client u are using
Maybe you are looking for
-
External Drive won't init over 128GB, Not FW firmware issue
This one is killing me: I got a Maxtor 6L 300R0 drive the other day and hooked it up to my Dual 1GHZ MDD via a FW enclosure to init it - I am planning on migrating all my data from 3 internals over to 1 drive. The enclosure can handle drives over 128
-
I purchased a movie from those online "movies to ipod" sites (buyimovies.com) and put it on my 80g video ipod. the movie worked fine as i would watch about a half hour each night before bed. one night, the screen went dark and the ipod froze. i tried
-
hello experts, There is a situation where in one user has to process a consignment fill up order. let us go by an example, if the consignment fill up is for 100 units. the user has processed the first consignment issue for 25 units. at the time of t
-
i downloaded and installed ios 5 and put it on my iphone. i backed it up and then installed ios 5 and restored from backup. now i can't see any of my apps that i had on both my phone and pc. anybody know if i can get them back somehow?
-
HT204266 can i return a purchse from the app store
I bought an app throught app store is tgere a way that i can retur The purchase as well as in app purchase