Calculate line total in SO

Dear all,
i created in the Sales Order a new Userdefined field and called it ADDPrice.
and now i wonna totalize this field and the Unit Price field as new Line Total (Total LC).
ADDPrice + Unit Price + Quantitiy = Line Total
can anybody help me to create this query??
Thank you and best regards
Serkan
Edited by: Serkan Er on Nov 11, 2008 7:37 AM

I had a similar problem, you need considerate the document's type that is in the invoice header (OINV), 'I' Item or 'S' Service, and the Discount percent DiscPrcnt in the header too.
WHEN T1.DiscPrcnt >  0 THEN T0.LineTotal - (T0.LineTotal * (T1.DiscPrcnt/100)) AS 'LineTotal'
if not  T0.LineTotal
this is the net value.
Oscar

Similar Messages

  • [no replies since 2days] problem when doing line total in matrix?

    hi everyone...
    i have a user form in which ihave a matrix with few columns and for a particular column there is CFL...when i select a CFL my matrix is feeding with data in other columns as well.....
    in my form there is a edit box called Tax...in to which iam supposed to calculate the line total of a column in my matrix... as soon as when i enter CFL....
    here is the code which i have written in item event
    oMatrix2.FlushToDataSource()
    oDBDataSource6.SetValue("U_Tax", pVal.Row - 1, oCFLEvent.SelectedObjects.GetValue(0, 0))
    oDBDataSource6.SetValue("U_Tax_Amount", pVal.Row - 1, oCFLEvent.SelectedObjects.GetValue(2, 0))
    oMatrix2.LoadFromDataSource()
                                                oMatrix2.Columns.Item("V_7").Cells.Item(pVal.Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular)
    ''for Tax
    taxTotal = oForm.Items.Item("33").Specific.value
    taxAmount = oMatrix2.Columns.Item("V_7").Cells.Item(pVal.Row).Specific.value
    tax = taxTotal + taxAmount
    oForm.Items.Item("33").Specific.value = tax
    '' end for Tax
    the above is code is working perfect...but,
    there are 2 problems....
    1. if i remove "oMatrix2.Columns.Item("V_7").Cells.Item(pVal.Row).Click(SAPbouiCOM.BoCellClickType.ct_Regular)" line from my code there is an error called
    " Application has a problem. Diagnostic file C:
    some path..dump was created...plz attach the file...etc etc..."
    2. in my matrix column if i re-enter any other CFL data...my Tax is adding again with same value again...i.e i'm not getting the correct line total...
    plz provide me the solution for both the questions...
    thanks in advance
    Edited by: Shenaz Sultana on Jan 7, 2010 12:29 PM

    Hi,
    For your 1st question, y should you remove that line?  If it works fine with that line, leave it as it is.  Its afterall placing the focus in that column right?
    w.r.t your 2nd question, the reason why the same value is being considered for tax calculation is that, the same old datasource is not cleared.  So you clear the datasource manually and this problem will be solved.
    Eg: Try to clear the data source as below.
    oForm.DataSources.DBDataSources.Item("@Table_Name").Clear();
    Hope this helps.
    Regards,
    Satish.

  • Formula in Crosstab to calculate group totals

    Hi,
    I want to do a cross tab as following:
    ......................January.................. February.................................->up to current month.......... total per year
    ................. 2010.....2011............2010.....2011............................................................................2010.....2011
    Brian:...........15 .....13....................11..... 17...................................................................................26 .....28
    Peter:...........10 ..... 20...................33.....44.................................................................................... 43.....64
    Lars............xx.....and so on
    I couldn't find a way to calculate the yearly totals. The years are groups. Is there an easy solution which I oversaw? Automatically CR is just calculating a grouplevel 1 total, no seperated group level 2 totals...
    I tried to insert a calculated field and to make  the "static" formula (which works):
    GridValueAt(GetRowPathIndexOf(2, 2010.00), CurrentColumnIndex, CurrentSummaryIndex) +
    //GridValueAt(GetRowPathIndexOf(3, 2010.00), CurrentColumnIndex, CurrentSummaryIndex) +
    //GridValueAt(GetRowPathIndexOf(4, 2010.00), CurrentColumnIndex, CurrentSummaryIndex) +
    //GridValueAt(GetRowPathIndexOf(5, 2010.00), CurrentColumnIndex, CurrentSummaryIndex) +
    //GridValueAt(GetRowPathIndexOf(6, 2010.00), CurrentColumnIndex, CurrentSummaryIndex);
    dynamic:
    local numbervar jahr;
    local numbervar i:=0;
    for i:= 1 to maximum({@Monat}) do
    jahr + GridValueAt(getrowpathindexof(i,2010.00), CurrentColumnIndex, CurrentSummaryIndex);
    jahr;
    But it the formula is not working. The formula is accepted, but the result is always zero. "0"..
    So in case there is an easy way, I am keen to know. But anyway, if there is a mistake in my formula it would be good to know as well.
    Thank you and best regards from Berlin
    Bernd

    Hi Aljun,
    thanx for your fast answer. But this is the problem, that CR is not doing the totals out of the box. I want to compare the months results of two or more years.
    The out of the box solution  is a total per line per group (in this example per January, february, etc.)
    I included in the table now how the cross tab is editing it.
    I couldn't manage to
    ......................January..........Total..Jan............. February...........Total Feb.................->up to current month.......... total overall
    ................. 2010.....2011................................ 2010.....2011..........................................................................................
    Brian:...........15 .....13................28.....................11..... 17................28   ...........................................................................54
    Peter:...........10 ..... 20...............30......................33.....44................77............................................................................ 107
    Lars............xx.....and so on
    I want to have a seperated  total overall per 2010 and per 2011, not a line total. Probably there exists an very easy solution, but although I tried several hours the only solution I found was the formula which is not working properly. Probably I can calculate the yearly results through a formula, not through grouping?
    Anyway I am asking myself why my formula is not working as there are other needs for such a dynamic calculation.
    For example:
    .............2010...................................................................................................................2011
    ............January...................February......subtotal....March.to.December.............january........february..........total 2011so far
    Ger.......150............................200...................350.........150.......................................120..............180...................300
    I want to compare the results of two years and want to calculate a subtotal in the previous according to the current month to be able to compare the current result with the previous' year result.
    Do you have a solution?
    Thank you and best regards
    Bernd

  • How can I calculate the total time in java?

    Hello!
    I need to calculate the total time!
    For example I have start time:
              Format formatter1;
              Date date1 = new Date();
              formatter1 = new SimpleDateFormat("hh:mm:ss");
              String startTime = formatter1.format(date1);
              //startTime = "14:20:40";
    And I have finish time:
              Format formatter2;
              Date date2 = new Date();
              formatter2 = new SimpleDateFormat("hh:mm:ss");
              String finishTime = formatter2.format(date2);
              //finishTime = "08:30:55";
    So, after manually calculating, I get total time: "18:10:15"
    How can I calculate the total time in java? (Using formatter1 and formatter2 I suppose)
    What I need is to print "total 18:10:15"
    Thanks!

    800512 wrote:
    I did the following but, I think something is wrong here:
    I defined before: Date date1 = new Date(); Date date2 = new Date();
    And it should be exactly 5 seconds between them.
    I found delta between date1 and date2:
    Format formatter = new SimpleDateFormat("HH:mm:ss");
              long timeInMilliFromStart = date1.getTime() - date2.getTime() ;
              Date date3 = new Date(timeInMilliFromStart);
              String timeInSecFromStart = formatter.format(date3);
    and I get always
    //timeInSecFromStart = 02:00:05
    But it should be exactly 00:00:05.
    What can be a problem?Because, like I said, a Date measure an instant in time, not a duration. So when you have 5000 ms, and you turn that into a Date, that means 5 sec. after the epoch, which works out to 1/1/1970 00:00:05.000 GMT.
    As I mentioned, if you're not currently in GMT, then you have to set the TZ of the DateFormat to GMT. Right now, it's showing you the time in your TZ. If you included the date in your SimpleDateFormat, you'd see either 1/1/1970 or 12/31/1969, depending on which TZ you're in.
    Bottom line: You're trying to use these classes in a way they're not meant for, and while you can get the results you want for a limited set of inputs if you understand what these classes do and how to work with that, it's a brittle approach and comes with all kinds of caveats.

  • How to calculate the total of bytes transferred when I submit a PDF Form in A. Reader

    Hello,
    I need to know some way for calculate the total of bytes transferred when I submit a PDF form using JavaScript, hereby:
    b ******************************************************************
    i var service_url = http://some_webservice/;
    i var send_type = "PDF";
    i var doc = event.target;
    i doc.submitForm( { cURL: service_url, cSubmitAs: send_type } );
    b ******************************************************************
    b The reason:
    I need to indicate the percentage of bytes sent to the server, in real time. Adobe Acrobat shows a progress bar and the transferred quantity in bytes, but Adobe Reader doesn't. Is in this case, when I need to find a way in order to make something similar.
    b Than you for your time.

    You can use SharePoint Designer and calculate the total in xslt view. Refer to the following post for more information
    http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2009/04/24/how-to-total-calculated-columns-in-a-sharepoint-list.aspx
    http://blog.metrostarsystems.com/2012/12/03/jennys-sharepoint-tip-sum-calculated-columns/
    Cheers,

  • How to calculate the total of a calculated column in a list view at the end of the view?

    I have a view with the following columns ProductName, Quantity, Price, Total The total column is a calculated column which is the product of quantity and price. I want to place the sum of the total column by the end of the list view. I can do this with
    the price and quantity but not with the total column. how do I do this?

    You can use SharePoint Designer and calculate the total in xslt view. Refer to the following post for more information
    http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2009/04/24/how-to-total-calculated-columns-in-a-sharepoint-list.aspx
    http://blog.metrostarsystems.com/2012/12/03/jennys-sharepoint-tip-sum-calculated-columns/
    Cheers,

  • How do I calculate the total size of selected folders?

    Hello
    My question is:
    How do I calculate the total size of selected folders?
    Thank you

    It does show the aggregate size.
    Command-Option-I opens the Inspector window. (Or open the File menu and hold the Option key. Get Info turns into Show Inspector.) The Inspector is similar to the Get Info window but it shows aggregate info for multiple selections. It is also dynamic — if you change the selection while the Inspector is open, the info changes to reflect the current selection.

  • Max.cond.base value - wrong line totals in Sales Order and Invoice

    Dear Experts,
        In my pricing procedure, I have set the field Max.cond.base value as 1 in VK12 (in additional data) for one of my condition type ZR16 . If Max.cond.base value is set as 1 for ZR16 condition type, the value for ZR16 will be considered only for the 1st quantity for that item. All subsequent quantities for that item will not be considered. This works fine in Sales Order and when I enter the same material in 2 line items with qty 1 each, only the first line item considers ZR16 value in total net value and the second line item does not consider the value of ZR16 in the total, which is correct.
        Problem arises when I create individual deliveries and individual invoices for each line item. Although the ZR16 value is not considered in the total for the second line item in the sales order the value is being considered in the invoice which is wrong. I tried various scenarios and found this issue arises only with domestic customer and not with overseas customer. Issue is that the line total value value calculated correctly in sales order is reflecting wrongly in Invoice when I use Max.cond.base value. I am confused if this is a pricing procedure related issue or copy control related. Please share your valuable inputs.
    Regards,
    Madhavan

    I tried various scenarios and found this issue arises only with domestic customer and not with overseas customer
    Compare the access sequence combination and condition record in both the above cases and check which one is differing and creating issue.
    the line total value value calculated correctly in sales order is reflecting wrongly in Invoice
    Again here also, compare the Analysis tab which should be self explanatory to find out the root cause of the issue.
    G. Lakshmipathi

  • Hi frinds ,how to calculate the  totals in smartforms

    1)how to calculate the  totals in smartforms .

    Hi,
        To calculate totals and sub totals in sap scripts you can use subroutines.
    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 /: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.
    regards..

  • How to calculate the total from users input in switch?

    I dont know how to hold the input from user. But here is part of my coding :
    System.out.println ("Type 1 for buying Ruler"+
    "\nType 2 for buying Pencil");
    stationaries = console.nextInt();
    switch (stationaries)
    case 1 : System.out.println("Ruler per unit : MYR1");
    System.out.println("How much does you want? : ")
    wantRuler = console.nextInt();
    sum = wantRuler * 1;
    break;
    case 2 : System.out.println("Pencil per unit : MYR2");
    System.out.println("How much does you want? : ")
    wantPencil = console.nextInt();
    sum = wantPencil * 2;
    break;
    How can I calculate the total for both of the stationaries if user wants 5 for ruler and 6 for pencil?

    Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.

  • Is there a way I can have my form calculate a total time from beginning and ending time?

    Is there a way I can have my form calculate a total time from beginning and ending time?

    Sorry, but Formscentral doesn't support either a timer function or any kind of calculation. You might be able to do this if created your form in PDF. For help with PDF form creation in Acrobat I suggest you repost your question to the Acrobat Forum.
    Andrew

  • I just want to calculate a total

    Hi,
    I'd like to calculate automatically total of 2 inputValues. For sure i need to set the autoSubmit="true" on both of my inputValues + partialTriggers on the TOTAL one. What I'd like to know is what is the best practise on how to hanlde the result :
    1/ using a backing bean with a valueChangeListener ?
    2/ implementing code (set in the EntityObjectImpl.java ? ( public void setVal1(Number value) {
    setAttributeInternal(VAL1, value);
    setTotal(getVal1().add(getVal2()));
    3/ something else ?
    Thank you for your support.
    Max.

    Hi,
    option 1: use a transient attribute in the VO to show the calculation. If the two values come from the same record then this is easy to do
    option 2: Use a managed bean that gets the values form the binding and write them to a variable referenced by the calculation field using EL
    Best practice is to use the transient attribute assuming that the calculation need to become available on other pages as well
    Frank

  • Is there any way to set up a system in Numbers where numbers from individual spreadsheet can get funneled into a Master Spreadsheet to calculate the total of all of the individual spreadsheets automatically?

    I use Numbers for my business and I currently use it to create individual invoices and then (manually) enter the totals from the invoices into a Master Spreadsheet where I can see the sum of the individual totals.  Is there anyway to set up a formula or a system that automatically funnels the numbers from the Individual Spreadsheets into the Master Spreadsheet to calculate a total?

    Marni,
    If you can tolerate all the data and the summary being in a single document, this can be done. Any cell in a document can reference any other cell in the same document for the purpose of making a summary or other calculations.
    Jerry

  • Urgent : how to calculate sub total and grand total in smart forms

    Hi Friens..how to calculate sub total and grand total in smart forms..How to print them in smart forms...Also kindly explain how to handle events in smart forms..Thanks in advance

    Re: Subtotal with Table Node in smartforms

  • FOX: how to calculate weeks totals?

    All, I need to calculate the suggested order order quantity (KF = ZPOSUGQTY) for a vendor/material combination. For this I need to calculate,
    the total sales quantity (KF 0QUANTITY) of the last 4 weeks (so 'current week - 1' till 'current week - 4')
    the total sales quantity of week 5 till 9 (so 'current week - 5' till 'current week - 9')
    In my fields to be changed I have 0MATERIAL and 0VENDOR. 0CALWEEK is in the aggregation level. My plan is to get current week via the VARV/VARC statement from a Bex variable.
    I am not sure how to get the 4 week total and the 5-9 week total though. I start off with FOREACH MATERIAL VENDOR. But what would the code look after that?
    Any help appreciated! Cheers.

    Thanks Cornelia. I used the code below. It is not working though. I tried to debug it, there are a couple of problems
    - the IF statement on CALWEEK is not working, the program does not seem to be able to calculate lower/higher compared to eg
    CURWEEK1
    - I think the program is calculating the formula per week. What I need is calulate the total sales figures for the last 4 weeks, then total sales of week 5-9. When this is done execute the formula to calculate ZPOSUGQTY. So the formula should only be calculated once for a material. For this I should not have 0CALWEEK in my fields to be changed? How would a DO statement fit below? FYI I have omaterial and 0calweek in my fields to be changed.
    DATA MATERIAL TYPE 0MATERIAL.
    DATA CALWEEK TYPE 0CALWEEK.
    DATA TOT_SALES_1TO4 TYPE F.
    DATA TOT_SALES_5TO9 TYPE F.
    DATA CURWEEK TYPE 0CALWEEK.
    DATA CURWEEK1 TYPE 0CALWEEK.
    DATA CURWEEK4 TYPE 0CALWEEK.
    DATA CURWEEK5 TYPE 0CALWEEK.
    DATA CURWEEK9 TYPE 0CALWEEK.
    BRING IN CURRENT WEEK PLUS DERIVED WEEKS
    CURWEEK = VARV ('0CWEEK').
    CURWEEK1 = TMVL(CURWEEK, -1).
    CURWEEK4 = TMVL(CURWEEK, -4).
    CURWEEK5 = TMVL(CURWEEK, -5).
    CURWEEK9 = TMVL(CURWEEK, -9).
    *INITIALIZE THE LOCAL KEY FIGURES
    TOT_SALES_1TO4 = 0.
    TOT_SALES_5TO9 = 0.
    FOREACH MATERIAL, CALWEEK.
      IF CALWEEK <= CURWEEK1 AND CALWEEK >= CURWEEK4.
          TOT_SALES_1TO4 = TOT_SALES_1TO4 + {0ACT_DL_QTY, CALWEEK, MATERIAL}.
      ELSEIF CALWEEK <= CURWEEK5 AND CALWEEK >= CURWEEK9.
             TOT_SALES_5TO9 = TOT_SALES_5TO9 + {0ACT_DL_QTY, CALWEEK, MATERIAL}.
      ENDIF.
    ENDFOR.
    {ZPOSUGQTY, CALWEEK, MATERIAL} = (2 * TOT_SALES_1TO4 + TOT_SALES_5TO9 )/ 13.

Maybe you are looking for

  • Best way to distribute configuration values to subVIs

    I have a main VI with ~10 subVIs, all of which have a number of default constants embedded. I want to change my architecture so that all the constants are moved to a single ASCII text file which is not changed during program execution. I'm trying to

  • Safari Page Won't Load When Connected to Plasma TV as Monitor

    I am a new Mac user and was hoping someone could help me with this issue. I have a MacBook Pro 13" laptop running Mac OS X (10.6.2) and the latest version of Safari (4.0.4) and when I connect it to my Plasma TV using the displayport to DVI adaptor, S

  • Page size and rulers

    How do I give a page size in the new numbers? I like to see my page as an A4 when I fill in (or design) an invoice. The rulers are in points instead of centimeters. How to change that? Any advice?

  • How can I combine advanced actions with the branching view?

    I am creating a branching scenario in Captivate 7. It's fairly involved and I'd like to keep track of it with the branching view. But, I understand that if I use an Advanced Action, it won't show up in the view. My slides track a conversation that go

  • Image sent from LR4 to edit in CS5 crashes Photoshop

    Running Windows 7 Pro, 64bit on Intel i5, 2.80GHx, 12GB RAM, with ATI Radon 5770.  All drivers are current.  PS will crash after only one or two applications.