on 12-20-2010 12:52 PM
Hi,
I need to develop a form with a dynamic table that calculate a subtotal by company
Eg:
Reference Cash disc. Withh.tax Net loc. curr. CoCd
0 0 10 Z001
TESTE 1 0 0 20 Z001
TESTE 1 0 0 20 Z001
Subtotal 40
CNRWaeoitftsCh ehldhor e.cdtn.ai sccxce u.rr.
TESTE 3 0 0 30 Z002
TESTE 3 0 0 30 Z002
TESTE 3 0 0 30 Z002
90
I can set the conditional break by company but i can calculate the subtotal.
Thank you in advance.
Miguel
Edited by: miglsilva on Dec 20, 2010 1:52 PM
Hi,
I didn't get what you mean..
Can you please explain your requirement...?
Cheers,
Sai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sai,
Thank you very much for the reply,
I have to implement something like a dynamic table:
Imagine
I have one table with the purchase items of all the companies, like that:
XBLNR NETTO Company Code
TESTE 20 Z001
TESTE 20 Z001
TESTE 30 Z002
TESTE 30 Z002
TESTE 30 Z002
TESTE 60 Z003
TESTE 30 Z003
So i have to display that by company, and when finish the las item i have to add a line with the subtotal like that:
XBLNR NETTO Company Code
TESTE 20 Z001
TESTE 20 Z001
Subtotal 40
TESTE 30 Z002
TESTE 30 Z002
TESTE 30 Z002
Subtotal 90
TESTE 60 Z003
TESTE 30 Z003
subtotal 90
I had already the conditional break for break when the data[-1].bukrs ne data.bukrs but when i put the script for calculate the value the result it is all the items.
Thank you in advance.
Miguel
Hi Miguel,
I have done exactly the same to generate customer statements as output forms. using standard ABAP approach not any web dynpro or so.
What I did for this.
I managed to generate 3 tables from your source table.
Table 1 has list of Customer Name/Number
Table 2 has list of documents (date, amount, gst etc) having a reference field customer number here.
Table 3 has list of customer numbers with totals.
In the form context i will have table 1 first, with in this will have table 2 & table 3 with where condition on this field.
On the form I will have nested tables. (since the context filters the table 2 and 3 based on the customer number of table 1) at runtime you can see the list grouped.
Let me know did you get what I mean..? more than happy to provide further info.
Cheers,
Sai
What i would do:
a) NEVER do the counting in the form,
b) I would create extra rows in the backend with the SUMs (with some kind of a flag to understand which of the lines I process in the form are the SUM ones)
c) If needed I would script a test if this is the SUM line on every line and change the background color or change font to bold or something to make it more fancy.
Otto
Hi Otto,
I got you..
I would try that with a xml data source.
but I have one doubt, lets say the data is not grouped/sequenced by customer number then is it possible to sort it based on customer number on the form (just in case I have no chance to sort it in the interface or the source program.)
Thanks & Regards,
Sai
In my opinion you can always do things in backend. Even if it is about a SAP standard form, you can change the printing program, repair it or something, use form interface. The fact you can achieve this through scripting does not mean you should do it (or it was meant to be done this way). I only offer suggestions, you don´t have to do it my way...
Otto
Hi,
Now i'm trying to use one script in javascript for calculate the sub-total value from the table.
I use this code but i can't obtain the reference for the fields
var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
var total = 0;
for (var i=0; i <= fields.length-1; i++) {
if (fields.item(i).name == "PRICE") {
total = total + fields.item(i).rawValue;
}
}
this.rawValue = total;
In the hierarchy i use subform with the role of a table.
Anyone can help, what i did wrong ?
Thank you in advance.
Edited by: miglsilva on Dec 27, 2010 4:01 PM
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.