Sum items in form on submit.

I tried something with javascript that totals the fields, but changes the column to a string. I tried converting the result to a number, but it would not work. I have a timesheet application that takes hours from Sun-Sat for multiple activity lines and totals them on the page, but I need to get the total into the database on submit. Below is the process code I have been working on. I am not sure if I can run something like this in APEX. Someone else tried something like this before I inherited the app. Any thoughts on this?
for i in 1..htmldb_application.g_f01.count
loop
update activity
set hours = (
nvl(htmldb_application.g_f07(HTMLDB_APPLICATION.G_F01(i)),0) +
nvl(htmldb_application.g_f08(HTMLDB_APPLICATION.G_F01(i)),0) +
nvl(htmldb_application.g_f09(HTMLDB_APPLICATION.G_F01(i)),0) +
nvl(htmldb_application.g_f10(HTMLDB_APPLICATION.G_F01(i)),0) +
nvl(htmldb_application.g_f11(HTMLDB_APPLICATION.G_F01(i)),0) +
nvl(htmldb_application.g_f12(HTMLDB_APPLICATION.G_F01(i)),0) +
nvl(htmldb_application.g_f13(HTMLDB_APPLICATION.G_F01(i)),0) )
where
activity.id = htmldb_application.g_f02(i);
end loop;
Thanks,
Kevin

Denes,
Since the requirement just changed, I was wondering if there is a way to set the column value of the row. In the earlier referenced process I am setting a item in a database table. I would need the process to through loop and set g_f14 for the row in this case. I tried this earlier with javascript, but even with implicit conversions to number, it changed the field to a string which caused the update to fail.
Thanks
Kevin

Similar Messages

  • How to add multiple records in table thru form via Submit button

    Hi all
    i have small requirement as follows.
    i have a view in which i have 3 UI elements one is webdynpro form,Table UI element and third one is submit button.
    now at runtime when i will enter the details in the form and click on the submit button then those record details has been stored in Table. then next time again when i submit the form with details then the table contains all records of current and existing ...so table has to maintain mutile records thru form via submit form..
    i need sample code on the same.
    points are always rewardable
    Thanks
    Sunil

    Hi,
    Create one context attribute and map it to the Inputfiled and one submit button, create a node with a valueattribute map it to a Table and in onActionsubmit write this code
    public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionsubmit(ServerEvent)
        String str=wdContext.currentContextElement().getInputfiledattribute();
        IPrivateTableformView.ITablenodeNode node=wdContext.nodeTablenode();
       IPrivateTableformView.ITablenodeElement ele=node.createTablenodeElement();
       ele.setNodeattribute(str);
       node.addElement(ele);
        //@@end
    thanx,
    ramani.p

  • How to use one form to submit data to 2 tables on mysql

    Can someone please help me on this,
    I am developing a jsp website and I want to use one form to submit data to 4 tables on mysql database and the tables are related by one foreign key.
    Can someone bail me out of this ....I've hit a hard brick wall!!!!...

    kwesij wrote:
    Can someone please help me on this,
    I am developing a jsp website and I want to use one form to submit data to 4 tables on mysql database and the tables are related by one foreign key.
    Can someone bail me out of this ....I've hit a hard brick wall!!!!...What's the problem? What does a brick wall look like?
    Connect to the database and execute four SQL INSERT/UPDATE statements as a single unit of work. The fact that you have one form shouldn't be an issue.
    I'll bet you're having trouble because you haven't layered the problem either in code or in your mind.
    I'd recommend that you write a POJO to take in some objects and execute the SQL. Once you have that running successfully you can worry about the form. Decouple the two.
    Computer science is all about decomposing large problems into smaller ones.
    %

  • How to add a column in Item Master form with chooselist

    Hi Experts
    I add a column in Item Master Form in Stock Data Tab. In this column I want to add Choose list. For this I use AfterFormLoad event. It gives Error "Matrix Line Exist" . My code is given below
    If pVal.FormType = "150" Then
                    form = B1Connections.theAppl.Forms.GetForm(150, pVal.FormTypeCount)
                    form.PaneLevel = 3
                    oItem = form.Items.Item("28")
                    oMatrix = oItem.Specific
                    Dim chooseObj As ChooseListClass
                    chooseObj = New ChooseListClass
                    chooseObj.AddChooseFromListBinCode(form.UniqueID)
                    oColumns = oMatrix.Columns
                    oColumn = oColumns.Add("BINCODE", BoFormItemTypes.it_EDIT)
                    oColumn.Width = 100
                    oColumn.DataBind.SetBound(True, "OITW", "U_BINCODE")
                    oColumn.TitleObject.Caption = "Def BinCode"
                    oColumn.Editable = True
                    oColumn.ChooseFromListUID = "CFL5"
                    oColumn.ChooseFromListAlias = "U_BinCode"
                    oColumn = oColumns.Item("U_BINCODE")
                    oColumn.Visible = False
                End If
    please give your suggestion
    Regards
    Jitender

    Hi Noor
    Thanks for reply
    I tried your suggestion but problem still there. I am using after form load event. Here matrix has 9 lines (all warehouse). If remove the line then how can I reload warehouse data. Can you suggest in more detail.
    my code is given below
    form = B1Connections.theAppl.Forms.GetForm(150, pVal.FormTypeCount)
                    form.PaneLevel = 3
                    oItem = form.Items.Item("28")
                    oMatrix = oItem.Specific
                    MsgBox(oMatrix.RowCount)
                    oMatrix.DeleteRow(1)
                    Dim chooseObj As ChooseListClass
                    chooseObj = New ChooseListClass
                    chooseObj.AddChooseFromListBinCode(form.UniqueID)
                    oColumns = oMatrix.Columns
                    oColumn = oColumns.Add("BINCODE", BoFormItemTypes.it_EDIT)
                    oColumn.Width = 100
                    oColumn.DataBind.SetBound(True, "OITW", "U_BINCODE")
                    oColumn.TitleObject.Caption = "Def BinCode"
                    oColumn.Editable = True
                    oColumn.ChooseFromListUID = "CFL5"
                    oColumn.ChooseFromListAlias = "U_BinCode"
                    oColumn = oColumns.Item("U_BINCODE")
                    oColumn.Visible = False
                    oMatrix.AddRow(1)
    Thanks
    Waiting for reply
    Regards
    Jitender

  • How to populate the LOV with warehouse item in Item Roles form

    Hi
    Any one please tell me can we populate the list of values for warehouse items in the item roles form, if so please let me know how to do it.
    Navigation
    Go to OPM Inventory Control
    Go to Workflow
    Go to Item Roles
    Opens a window Item Role Relation.
    When I click on the LOV tab of Warehouse Item, it says list of values contains no entries.
    Thanks in Advance
    Prem.

    This applies for Release 11 or before. (Not for R12)
    Warehouse items are the OPM Items. When you define new item there is field warehouse item and by default it gets populated with the same item name. You can manually changed it to previously defined item name.

  • Dynamically create and remove TEXT items in forms

    Hi Guys,
    Is there a way to dynamically create and remove TEXT items in form. For example I have the EMP and DEPT table and when
    I select the EMP table name from the LOV, rows of the EMP table with column name and data should get displayed on the screen and likewise a similar action for DEPT table and
    so on. I have about 90 tables from where data could be required to view and edit. They all have varying number of columns.
    Any suggestions ?
    Thanks
    KMD
    null

    Use OLE concept of developer and map Excel as an object
    Nadeem
    null

  • Header and Item table - Form Design Question

    Hi All,
    I have a header table and Item table. For every record in the header table I have multiple records in the item table. I want to have a adobe form in the following way
    1. A new page starts for every record in the header table and Items in the item table for this header record can span multiple pages with the same header information.
    2. When all the items are displayed for that particular header record, a new page should start for the next header record.
    I created one internal table in the following way
    Header_field1 Header_field2 Item_table(with all the items for this header record)
    Header_field1 Header_field2 Item_table(with all the items for this header record)
    I am not sure how to use a table for this scenario (Should It be a nested table?).
    Please provide me some ideas.
    Thanks,
    Ganesh.

    Hi Balasubramani,
    I made some changes and have the following now. Can you please let me know how I can achieve page break for every BP_NUMBER.
    I have a nested table like the one below.
    Main table u2013 Has header and Items information. Every header record has some header information like BP number, name and all line items for that BP in a nested table .
    IT_HEADER:
    BP_NUMBER     BP_NAME           IT_ITEMS(Items table)
    BP_NUMBER     BP_NAME           IT_ITEMS
    BP_NUMBER     BP_NAME           IT_ITEMS
    To display this information I created the following
    Subform1 u2013 overflow u2013bound to $record.IT_HEADER.DATA[*] u2013 (Repeat sub form for
    |                                             each data item)
    |->Header sub form u2013 Positioned
    |     |
    |     |-> Text Field u2013 bound to BP_NUMBER
    |
    |
    |->Item sub form -
         |     
         |->Item Table u2013 bound to IT_ITEMS
              |
              |->Data u2013 bound to IT_ITEMS.DATA[*] u2013(Repeat row for each data item)
    In the output BP number in the first record of IT_HEADER gets displayed and then all the Item records in IT_ITEMS for that BP get displayed. This is repeated all the records in IT_HEADER which is perfectly fine.
    Please provide me some suggestions to solve the following issues I am having
    1.     I need a page break between records of IT_HEADER. I want the new subform1 for the next header record to start in a new page. I tried conditional break option, on the only field BP number in header sub form. I have two master pages and two body pages. All the above information is in master page 2 and body page 2.  I am also not sure what to select in the TO section of the conditional break screen.
    2.     When there is an overflow in IT_ITEMS I need the Header sub form to be shown in the next page too.
    Thanks,
    Ganesh.

  • UDF in item query form

    Hi,
    How to add a UDF to the ' item query' form.
      (Inventory->Inventory Reports->Item query)
    Thanks,
    Smitha

    Smitha,
    If you are talking about the SELECTION screen where you enter Item Number, ...... it would not be possible.  But if you want to add the UDF to the List of Items screen.
    Click on Form Settings from this screen and in the Field Name drop down select your UDF
    Suda

  • Query about multiple selection of List item in forms 6

    How can I select multiple elements from a list item in Forms 6?

    the very simple strategy to do is to call removeAllItems() method for the 2nd combox box and then insert the contents. this is because the validate() method is not repeatedly called and so the contents are not updated immediately.

  • How to hide a folder in item master form?

    Dear members,
    I have to hide a folder named properties and remarks in item master form?
    I have tried by setting the visible property as false through sdk coding.Its working fine but when i use navigation button these above mentioned tabs appear for a moment and then disappear.
    I want these to not to be visible in any of the events like navigation and find.
    please do help me in this regard.
    Regards,
    Venkatesh.R

    Hi,
    thats a pitty!
    i tried this many times with every item except Folders.
    looks like you can't move 1 Folder alone when they are grouped
    iam sorry - i don't see a other solution than Petr's way now - catch the click / itempressed event and
    set bubbleevent to false
    lg David

  • How to assign NULL value to an ITEM in Forms Personalization?

    Hi,
    how to assign NULL value to an ITEM in Forms Personalization?
    please suggest me.
    Thanks

    I don't know what your form personalization does and maybe I misunderstand you ...
    Try
    :item_name := null;

  • How to Initialize Items on Form

    Hi Everyone,
    I have created a form in screen painter with 2 items as editBox. Form is able to load but I want to initialize one item by current Date and other item from data table i.e. field prid should have a document no and field prdate should display current date OR user should enter '-t' then current date should display.
    How to achieve this functionality. (SBO 2005B)
    Regards
    OP Sharma

    Hi Lakshman / Mongi,
    It is still not working. Maybe I missing something. Here is the code I am using:
            LoadFromXML("Purchase_requistion.srf")  ' Form load successfully
            oForm = SBO_Application.Forms.Item("opsPR")   'Form UID
            'Initialize the Item on the form : uid="reqDt" ,type = it_edit 
            oForm.Items.Item("reqDt").Specific.String = DateTime.Now.Date.ToString()
            oForm.Visible = True
    It is still displaying blank item i.e. Request Date. (I want it exactly as displaying in all SBO form like Sales Order etc, default is today date and format should be mm/dd/yyyy as per format defined in SBO)
    Please help.
    Regards
    OP Sharma

  • Forms Central "Submit" button

    Hello,
    Can anyone tell me if it is possible to add an "action" in the Forms Central "submit enabled" button to close the document after submitting.
    Thanks.
    Eric.

    Sorry this is not something FormsCentral supports. You have to manually close the form yourself.
    Gen

  • I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Cent

    I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Central in order to use this feature. What gives? The Adobe site gave me the impression that I would have this feature after purchasing the new upgrade. I would not have purchased the upgrade, let alone five of them had I know this. Am I missing something?

    Acrobat XI comes with the Fromscentral AIR application and the ability to create PDF forms authored in Formscentral. To have more than the free (1 form with 50 responses) level account you need to sign up for a Formscentral subscription.
    Andrew

  • When-validate-item at form level do not fire

    Hi, I wrote a when-validate-item at form level to do same check in all items of a screen and note that this trigger do not fire when executing the form. does someone know why this form-level when-validate item do not fire. Are there some conditions i probably forgot to have? Thnaks very much.

    Hi, if you also have a validate-item trigger on the item itself, this may be overriding the form-level validate item.
    At the ITEM-LEVEL:
    if a when-validate-item trigger exists and the Execution Hierarchy property of the trigger is set to override then the item-level trigger will fire instead of any trigger by the same name at any higher scope.
    So make sure you do not have validate-item triggers at the item or block level that may be overriding the form-level when-validate-item.
    To see the properties of a trigger, highlight the trigger and press F4
    Hope this helps!

Maybe you are looking for

  • How to differentiate scaling information, condition or ratio info in me31k

    hi, I am working on me31k contract, i am giving some values and saving it. Initially i was using CDPOS table to find whether change or delete is done. Now i have requirement of how to check whether it is scaling information, condition information or

  • Debugging not triggered!!!

    Hi Friends, I have created a BSP application, until last working day the debuging was triggering perfectly for this application, but today its not... I have checked the following: 1)From SE80>UTILITIES>SETTINGS>ABAP EDITOR>DEBUGGING--> enetr the user

  • Report Viewer VS2012

    Hi, I need help, the report viewer stopped working recently. Error message: The base class includes the field 'reportViewer', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.Web

  • Height of webpage

    Is there a way to override the 4000 px max height of a page?

  • Removing cursor from JTable

    I want to use a series of key bindings to perform operations on a JTable. Unfortunately, it seems that as long as the 'cursor' (square box around the current cell) is present on a cell in a JTable, then pressing any key will cause that cell to be ent