Auto-sum a multiline field

I am working on an invoice for my organization. I have a multiline field that will list a coupel fo amounts for services - each amount on a separate row - and I would like to auto-sum these amounts in a different field called "TOTAL$". What do I need to do? What properties should both fields have?

I think that will take quite a bit of scripting. A Multiline text field can not have the "Number" format, so you are going to have to write script to split the text into words and make sure you do not split at the "," or the "." for the words. You may also need to adjust for currency symbols.

Similar Messages

  • Auto Population of a field

    Hi,
    I need a text field to be auto populated as the sum of 2 fields when the user enters them.How can this be done?
    Regards,
    Vignesh

    Hi Vignesh,
    Given your two items to sum are P1_FIELD_1 and P1_FIELD_2, and the item to hold the sum is P1_SUM.
    Place the following in the HTML Header of the page (if your running ApEx 4, it goes in the Function and Global Variable Declaration and don't include the script and HTML comment tags):
    <script type="text/javascript">
    <!--
    function getSum(val1, val2) {
       if (val1 === '' || isNaN(val1))
          val1 = '0';
       if (val2 === '' || isNaN(val2))
          val2 = '0';
       return parseFloat(val1) + parseFloat(val2);
    //-->
    </script>Place the following in the HTML Form Element Attributes for both P1_FIELD_1 and P1_FIELD_2:
    onchange="$s('P1_SUM', getSum($v('P1_FIELD_1'), $v('P1_FIELD_2')));"$s is an ApEx built-in JS function for setting the value of an item. $v is an ApEx built-in JS function for getting the value of an item.
    Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

  • Sum of a field in ALV List

    Hello Guys,
    I'm using 'REUSE_ALV_GRID_DISPLAY' in my prog.
    There is a field in output table which is of type P(8) Decimals 3.
    When I'm trying to get the sum of this field in ALV Display it gives the message " Desired operation cannot be performed for column 'Converted Quantity' ".
    I have also tried do_sum = 'X'.
    But it is not working. Please help guys.
    Regards,
    Abhinav

    Thanks a lot guys for your inputs.
    The program is working now.
    Now I'm using :
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'QUAN'.
    *  wa_fieldcat-ref_tabname = 'I_OUT2'.
    *  wa_fieldcat-tabname = 'I_OUT2'.
      wa_fieldcat-qfieldname = 'MEAS'.
      wa_fieldcat-qtabname = 'I_OUT2'.
      wa_fieldcat-outputlen = '15'.
      wa_fieldcat-seltext_l = text-052.
      APPEND wa_fieldcat TO i_fieldcat.
    The program is working fine now.
    I have commented tabname and -ref_tabname , and the program is working fine now.
    Thanks a lot.

  • Dump when summing up CURR field in ALV GRID display

    Hi All,
    I am getting dump when I try to sum the CURR field in my ALV Grid Display. The field is of CURR 23.  I am using classes and methods to display alv grid.
    I tried passing <fs_fieldcat>-do_sum = 'X'. When I did this, it is dumping without even displaying the alv grid.
    Here is the part it is throwing dump:
            ls_lvc_data-value = space.
            clear ls_lvc_data-style.
            loop at it_fcat_local assigning <ls_fcat>
                    where tech ne 'X' and no_out ne 'X'.
              if l_invisible eq 'X'.
                clear l_invisible.
                if <ls_fcat>-do_sum is initial.
                  continue.
                else.
                  clear ls_lvc_data-col_pos.
                endif.
              endif.
              add 1 to ls_lvc_data-col_pos.
              assign component <ls_fcat>-fieldname
                               of structure <ls_data> to <l_field_value>.
              _if sy-subrc ne 0.
                message x000(0k).
              endif._
    Regards,
    Guru

    Thomas,
    Here is the dump:
    Runtime Errors         MESSAGE_TYPE_X
    Date and Time          10/22/2010 23:30:53
    Short text
    The current application triggered a termination with a short dump.
    What happened?
    The current application program detected a situation which really
    should not occur. Therefore, a termination with a short dump was
    triggered on purpose by the key word MESSAGE (type X).
    Error analysis
    Short text of error message:
    Long text of error message:
    Technical information about the message:
    Message class....... "0K"
    Number.............. 000
    Variable 1.......... " "
    Variable 2.......... " "
    Variable 3.......... " "
    Variable 4.......... " "
    How to correct the error
    Probably the only way to eliminate the error is to correct the program.
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "MESSAGE_TYPE_X" " "
    "SAPLSLVC" or "LSLVCF36"
    "FILL_DATA_TABLE"
    If you cannot solve the problem yourself and want to send an error
    notification to SAP, include the following information:
    1. The description of the current problem (short dump)
    To save the description, choose "System->List->Save->Local File
    (Unconverted)".
    2. Corresponding system log
    Display the system log by calling transaction SM21.
    Restrict the time interval to 10 minutes before and five minutes
    after the short dump. Then choose "System->List->Save->Local File
    (Unconverted)".
    3. If the problem occurs in a problem of your own or a modified SAP
    program: The source code of the program
    In the editor, choose "Utilities->More
    Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.
    Source Code Extract
    Line
    SourceCde
    2708
    is_subtottxt_info = ls_subtot_info
    2709
    ip_subtot_line    = lr_data
    2710
    changing
    2711
    c_subtottxt       = l_subtottxt.
    2712
    ls_lvc_data-value = l_subtottxt.
    2713
    2714
    append ls_lvc_data to ct_lvc_data.
    2715
    endif.
    2716
    2717
    2718
    Column per Fieldcat Entry
    2719
    2720
    ls_lvc_data-value = space.
    2721
    clear ls_lvc_data-style.
    2722
    loop at it_fcat_local assigning <ls_fcat>
    2723
    where tech ne 'X' and no_out ne 'X'.
    2724
    if l_invisible eq 'X'.
    2725
    clear l_invisible.
    2726
    if <ls_fcat>-do_sum is initial.
    2727
    continue.
    2728
    else.
    2729
    clear ls_lvc_data-col_pos.
    2730
    endif.
    2731
    endif.
    2732
    2733
    add 1 to ls_lvc_data-col_pos.
    2734
    2735
    assign component <ls_fcat>-fieldname
    2736
    of structure <ls_data> to <l_field_value>.
    2737
    if sy-subrc ne 0.
    >>>>>
    message x000(0k).
    2739
    endif.
    2740
    2741
    *... work on average
    2742
    if <ls_fcat>-do_sum eq 'C'.
    2743
              Initialize average result and entries
    2744
    <l_field_value> = 0.
    2745
    clear l_entries.
    2746
    2747
              retrive unit from fieldcatalog
    2748
    assign space to <l_unit>.
    2749
    if not <ls_fcat>-cfieldname is initial.
    2750
    assign component <ls_fcat>-cfieldname
    2751
    of structure <ls_data> to <l_unit>.
    2752
    endif.
    2753
    if not <ls_fcat>-qfieldname is initial.
    2754
    assign component <ls_fcat>-qfieldname
    2755
    of structure <ls_data> to <l_unit>.
    2756
    endif.
    2757

  • SUM for a field in ALV

    Hello Guys,
    CAn any one tell me how to do the SUM for a particular column in ALV.It should display at the End of the records.The column field is TYPE N(4).
    My CODE is like this:
    CLEAR fc_tmp.
      fc_tmp-col_pos         =  5.
      fc_tmp-reptext_ddic    = 'POINTS'.
      fc_tmp-fieldname       = 'POINTS'.
      fc_tmp-tabname         = 'ITAB'.
      fc_tmp-outputlen       = 15.
      fc_tmp-key             = 'X'.
      fc_tmp-do_sum          = 'X'.
      APPEND fc_tmp TO fieldcat.
    This is not working.
    Thanks in Advance,
    Take care

    Hi,
    populate the IT_SORT internal table of REUSE_ALV_GRID_DISPLAY provided in the importing parameters.
    fieldname = Company Code
    append fieldname to it_sort.
    fieldname = division.
    append fieldname to it_sort.
    If you explicitly need subtotals then add the following line
    subtot = 'X'
    For obtaining sum you have an attribute "do_sum" in fieldcatalog , set it to 'X' and you should be able to do sum on that field.
    <b>Ensure that these should be numeric / currency or quantity datatypes only.</b>
    wa_fieldcat-datatype = 'CURR'.   or
    wa_fieldcat-datatype = 'QUAN'.
    Hope this solves your problem
    Cheers,
    Simha.
    PS : Please reward points if solution is helpful

  • Multiline field in ALV row

    Hello.
    Is it possible to have  a multiline field in an ALV control (cl_gui_alv_grid or cl_salv_table). I already searched the documentation but I could not find anything about multiline fields in a single row.
    Thanks in advance.

    No, you can not wrap text within the cell.
    Regards,
    RIch Heilman

  • Material description filled automatically as the sum of two fields

    Hello to all
    We can automate the process of the creation a new material doing that the field material description(MAKT-MAKTX) can be filled by the system before saving(not by the user) as the sum of two fields in the MARA table that the users will be filled manually.
    Is it possible using a user exit, field exit,....?
    Thanks in advance.
    Regards

    Hello to all
    We can automate the process of the creation a new material doing that the field material description(MAKT-MAKTX) can be filled by the system before saving(not by the user) as the sum of two fields in the MARA table that the users will be filled manually.
    Is it possible using a user exit, field exit,....?
    Thanks in advance.
    Regards

  • [CR integrated in VS 2005] - sum of string fields

    Hello,
    i am discovering CR,
    and i am trying to do the sum of a field (number) but declared as string. the declaration of the field cannot be changed (string in the database).
    so i want to do the sum of this field.
    i wonder if it is possible, and if yes, how.
    maybe something like a formula.
    I saw the functions: ToNumber () and Cdbl() for conversion, and Sum().
    If someone has an idea, i will be very interested.
    PS: sorry if my question is not understandable, i'm french. If you don't understand it, i would rewrite it.
    thank you!

    thank you.
    I could convert, but the problem is to make the sum of the conversion.
    i would like to do something like:
    Sum(ToNumber ()) but CR does not accept it.
    Maybe by using a variable in a formula (but i don't know where):
    shared numbervar total;
    total = total+ToNumber({MyField});
    and when printing a formula field at the bottom of the report to show the total:
    shared numbervar total;
    ToText (total);

  • Digital Signature - Auto-Populate Multiple Signature Fields

    Hello,
    I am in the process of testing digital signatures with PDFs.  I have a Topaz Signature Pad working in conjunction with Acrobat 9 and Reader 9 so that I can insert digital signatures with no problems.
    We are wanting to take this a step further and streamline a particular business process.  Does anyone know of a way to have a digital signature auto-populate multiple designated signature fields?  We have about 15 documents that require an employee signature in multiple places and rather than having someone sign a document over and over again, we'd like the option for a single signature that auto-fills in all the required signature fields.
    This doesn't necessarily have to work with Topaz Signature Pads.  I am completely open to other suggestions, products or methodologies for making this work as long as something can be automated to auto-fill multiple signature fields.
    Many thanks to the forum!
    Regards,
    Geoff

    Hi Geoff,
    Maybe there is no need to re-inent the wheel. Auto-population of forms is a feature of SignDoc - se http://www.signplus.com/en/products/signdoc/features.php#Form_Preparation
    Auto-filling of forms is requirement which can be achieved through various processes.
    In combination with Adobe LiveCycle this is executed in the case study of Adobe/SOFTPRO.
    http://blogs.adobe.com/security/2010/01/adobe_secured_customer_showcas_8.html
    http://www.adobe.com/cfusion/showcase/index.cfm?event=casestudydetail&casestudyid=762388&l oc=en_us
    However there are also other ways to move forward depending on the envrionment you are using.
    If you are based in the US you may want to get in touch with Rod Vesling SOFTPROs E-Signature Specialist, based in CA near LA, for a chat. His office phone is 805 435 1214. His email is [email protected]
    Depoending on the deice of Topaz you are usinfg you may start right away as quite a decent number of Topaz tablets are supported by SignDoc. However the best idea might be to give Rod a ring and idscus your business requirements in detail.
    Kind regards
    Joerg

  • Auto scrolling dynamic text field(news ticker)

    > This message is in MIME format. Since your mail reader
    does not understand
    this format, some or all of this message may not be legible.
    --B_3272625483_2679871
    Content-type: text/plain;
    charset="US-ASCII"
    Content-transfer-encoding: 7bit
    Does anyone know how to make a scrollable dynamic text field
    scroll on its
    own and also with user interaction?
    Thanks in advance for your help.
    Bill
    --B_3272625483_2679871
    Content-type: text/html;
    charset="US-ASCII"
    Content-transfer-encoding: quoted-printable
    <HTML>
    <HEAD>
    <TITLE>Auto scrolling dynamic text field(news
    ticker)</TITLE>
    </HEAD>
    <BODY>
    <FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN
    STYLE=3D'font-size:12.0px'>Does =
    anyone know how to make a scrollable dynamic text field
    scroll on its own an=
    d also with user interaction?<BR>
    <BR>
    Thanks in advance for your help.<BR>
    <BR>
    Bill</SPAN></FONT>
    </BODY>
    </HTML>
    --B_3272625483_2679871--

    I found this:
    http://www.kirupa.com/developer/mx/dynamic_scroller.htm
    I copied the actual scroller and put it in my .fla and it
    worked! Now if I can only figure out links in XML...

  • Auto populate Infopath 2013 fields after selecting a specific dropdown option.

    Auto populate Infopath 2013 fields after selecting a specific dropdown option.
    Hi.
    I have a Sharepoint 2013 list with three fields. Code, Section and Sub Section.
    I would like to be able to have the form autopopulate the Section and Sub Section fields when a value for code is entered.
    How would I go about this please?
    Thanks
    Jon

    Hi JonMorgan,
    Based on your description, my understanding is that you want to achieve that the second dropdown gets populated depending on what the first dropdown is set to.
    To achieve your requirement, creating cascading dropdown fields with InfoPath.
    Please refer to the following links about cascade drop down in InfoPath form:
    http://msreddysharepoint.blogspot.in/2012/12/infopath-2013-web-browser-creating.html
    http://www.pointbeyond.com/2011/11/20/cascading-dropdowns-in-infopath-2010/
    Best Regards,
    Lisa Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Lisa Chen
    TechNet Community Support

  • MultiLine fields not overflowing correctly on PDF

    Hi all. I have an issue where the sections that i'm appending into a multiple multiline field section overlay each other.
    So imagine three sections. One small .5" dummy section to start. One large 10" section with three multiline fields in it. There's a .5" footer. I append two sections into EACH multiline field in that large section. Depending on the fields in the sections, the last multiline will _have to_ overflow and it's two sections _should be_ on the 2nd page.
    The large section has 'can grow' and 'can split image' marked at the forms level. Position is rel/max+0. The footer is copy on overflow. The multiline fields have can grow and can span marked in their properties.
    _Results_ : When the last multiLine overflows, the text of the two sections in that last MultiLine field overlays each other on the 2nd page.
    Thoughts? ideas?
    I've tried adding "PaginateBeforeThisImage" section rule to a section in the last MultiLine field. No luck.

    Hi,
    Would it be possible for you to break the large 10" section into 2 smaller sections say 5" each. Size of the 2 smaller sections does not matter and need not be equal also; only thing is can you break them into smaller ones instead on large section having 3 multi-line fields in it?
    P.S: "PaginateBeforeThisImage" section rule is not required for this situation.
    Thanks.

  • How to calculate sum of the fields in adobeforms

    Hello Experts
    can  i know how to calculate sum of fields in the adobe form.  I have few fields to be summed in total field.
    Regards

    Hello Surendra,
         Suppose you are having 4 fields and the 4th field is the TOTAL field.
         Write the below Javascript on the Initialize event of TOTAL field as shown below.
    Remember that if you use just "+" sign without Number() or ParseInt() function it acts like String Concatenation.
    this.rawvalue = Number( this.parent.field1.rawvalue ) +
                          Number( this.parent.field2.rawvalue ) +
                          Number( this.parent.field3.rawvalue ) ;
    You can also write is as shown below.
    this.rawvalue = parseInt( this.parent.field1.rawvalue ) +
                             parseInt( this.parent.field2.rawvalue ) +
                             parseInt( this.parent.field3.rawvalue ) ;

  • Auto sum Column accumulated value in gridview

    The principle seems simple but I'm in trouble. Did anyone have an example or script to auto sum of a column in the gridview. Explain, I have a gridview with the columns:
    amount, unitary value, total value and accumulated value. I need the accumulated value column add the previous value
    to the current value. For example:
    quantity unitary_value total_value accumulated_value
    10 10,00 100,00 100,00
    20 50,00 1.000,00 1.100,00
    5 500,00 2.500,00 3.600,00
    Basically it would be up. The column value (accumulated value) takes the value of the previous line and adds to the current value.
    If you can help !!
    Thank you for your attention.
    Thank you for your attention.

    No you're right with the calculation of the first post, I got it wrong. Now check the below solution, you need to use RowDataBound event of the gridview to do the calculation and print in the cell:
    //This is just a method to fill the datatable with dummy data(you can ignore in your code)static DataTable GetTable()
    // Here we create a DataTable with four columns.
    DataTable table = new DataTable();
    table.Columns.Add("quantity", typeof(double));
    table.Columns.Add("unitary_value", typeof(double));
    table.Columns.Add("total_value", typeof(double));
    table.Columns.Add("accumulated_value", typeof(double));
    // Here we add five DataRows.
    table.Rows.Add(10, 10, 0, 0);
    table.Rows.Add(20, 50, 0, 0);
    table.Rows.Add(30, 40, 0, 0);
    return table;
    protected void Page_Load(object sender, EventArgs e)
    //Bind the gridview to the datatable
    GridView1.DataSource = GetTable();
    GridView1.DataBind();
    //Global var to keep accumulated value of each rowo
    double _accumulatedvalue = 0;
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    if (e.Row.RowType == DataControlRowType.DataRow)
    //Create total value column by multiplying cells 1 and 2(maybe you don't need this)
    Double val = Convert.ToDouble(e.Row.Cells[0].Text) * Convert.ToDouble(e.Row.Cells[1].Text);
    e.Row.Cells[2].Text = val.ToString();
    //Accumualated value and fill the cell related (you can replace val below with Convert.ToDouble(e.Row.Cells[2].Text)
    _accumulatedvalue = _accumulatedvalue + val;
    e.Row.Cells[3].Text = _accumulatedvalue.ToString();
    Fouad Roumieh

  • Writing into Multilines fields

    Hello all,
    I've a problem in importing data into multiline fields like "free_text" for BusinessPartners (SQL server 2000 : data type : ntext).
    How can i délimited differents lines into my data line value ?
    thanks for helping me
    Julien

    In the sdk both \r and \n works.. I will quess it also works in DTW
    Sample:
    Line1nLine2nLine3
    =
    Line1
    Line2
    Line3

Maybe you are looking for

  • HP Envy 6-1110ET Audio Problem

    Hello everyone , I'm having trouble with my ultrabook's audio sometimes.For examle , I'm watching a video on Youtube.When I stop the video for a while (let's say 1 min or 30 sec) and play again , I can't hear any sound.I'm sure that this is not a Fla

  • Not able to create an account!

    Hello, I have made purchase of $800 in store yesterday and online $200. I got the rewards card yesterday but when i try to add to the account it says phone number does not match with the ID! Please help me out as this is irritating! 1000 points it se

  • How to Format Line in UML

    Hi All, Please see the screenshot below, I insert an association line between Student class and Classroom class, I want to change the line style. Such as begin arrow type or dash line. I set them via Format Shape TaskPane. But no working. Why? If my

  • "Enter Password" prompt won't go away without Force Quitting Mail

    Hi, I've been having this problem for a few weeks now. I have Mail at work set to always ask me for my password for a POP account (the only account setup in Mail). The problem is that if I don't type in the password correctly the first time, then I'm

  • IP Name of the server !

    Guys, I have a question on IP number: When the SAP GUI is not installed in our desk top and while I am in office, I go to start>run>type''SAPGUI IPNumber" and enter. It takes me to SAP login screen.Then I am able to login. What I want to understand i