Adding costs in cfloop

i am trying to  create a simple invoicing script for a friend. I can get the loop to add another row and save the data. My propblem is when I try to add up the material costs. I keep getting the followinf error: Element cost1 is undefined in a Java object of type class coldfusion.filter.FormScope. (line 121)
<!--- Gets the value of getnumba from above --->
        <input type="hidden" name="numba" value="#getnumba#">
        <!--- Loop Through from 1 to the number above --->
        <cfloop from="1" to="#getnumba#" index="idx">
            <!--- At first, it displays the original one row form --->
            <!--- User enters the data and hits "Add Another" --->
            <!--- The page reloads with the data already entered and creates a new blank row that is ready for data entry --->
            <tr>
                <cfif isdefined ("form.partno#idx#")>
                    <Td><input type="text" name="partno#idx#" value="#evaluate("form.partno#idx#")#" size="62"></TD>
                <cfelse>
                    <Td><cfinput type="text" name="partno#idx#" size="62"></TD>
                </cfif>
                <cfif isdefined ("form.cost#idx#")>
                    <Td><cfinput type="text" name="cost#idx#" value="#evaluate("form.cost#idx#")#" size="6"></TD>
                <cfelse>
                    <Td><cfinput type="text" name="cost#idx#" size="6"></TD>
                </cfif>
            </tr>
        </cfloop>
<tr>
<td align="right">Materials Total </td>
<td>
   <cfset subcost = 0>
     <cfloop from="1" to="#getnumba#" index="idx">
     <cfset subcost = variables.subcost + form["cost" & idx]> (line 121)
     </cfloop>
     #subcost#
</td>
</tr>
What am I doing wrong?

<!--- Gets the value of getnumba from above --->
        <input type="hidden" name="numba" value="#getnumba#">
        <!--- Loop Through from 1 to the number above --->
        <cfloop from="1" to="#getnumba#" index="idx">
            <!--- At first, it displays the original one row form --->
            <!--- User enters the data and hits "Add Another" --->
            <!--- The page reloads with the data already entered and creates a new blank row that is ready for data entry --->
            <tr>
                <cfif isdefined ("form.partno#idx#")>
                    <Td><input type="text" name="partno#idx#" value="#evaluate("form.partno#idx#")#" size="62"></TD>
                <cfelse>
                    <Td><cfinput type="text" name="partno#idx#" size="62"></TD>
                </cfif>
                <cfif isdefined ("form.cost#idx#")>
                    <Td><cfinput type="text" name="cost#idx#" value="#evaluate("form.cost#idx#")#" size="6"></TD>
                <cfelse>
                    <Td><cfinput type="text" name="cost#idx#" size="6"></TD>
                </cfif>
            </tr>
        </cfloop>
<tr>
<td align="right">Materials Total </td>
<td>
   <cfif isdefined ("form.cost#idx#")>
   <cfset subcost = 0>
     <cfloop from="1" to="#getnumba#" index="idx">
     <cfset subcost = variables.subcost + form["cost" & idx]>
     </cfloop>

Similar Messages

  • Adding cost element to a particular hierarchy in RSH1 leads to shortdump.

    Hi,
    I'm facing some issue in production for TCode-RSH1.
    Adding cost element to a particular hierarchy in RSH1 leads to shortdump. (Assign_Type_Illegal_Cast). This problem is causing for some hierarchies only. 
    Steps followed by us for adding cost element:-
    1) RSH1-select hierarchy name.
    2) In change mode, select a paticular node, click on cost element.
    3) Select any of the cost element & click the green button (tick)
    When we are following the above steps, it is leading to short dump and giving the following error message:-
    Assign_Type_Illegal_Cast.
    This issue is causing for some hierarchies & not for all.
    Request to suggest the solution..
    Regards,
    SDN User.

    Hi Venkat,
    That particular hierarchy is not having multiple nodes. Only one node named Rate & efficiency. and the user needs to add cost element to that node. Now how come your ans match here in this case.
    Now is that you are telling that one cost element which is selected is there for that node in some other hierarchy?But it is a different hierarchy , so if it is then it would be a problem?
    Or else I have one more doubt....
    Is that the user might be having some authorization problem for that particular hierarchy or the info object or cube where the hierarchy is? Because he is saying that he is having this problem for some few only not all hierarchies. So its understandable that RSH1 authorization to edit and create he has.

  • Adding cost centers to Comp Codes in BI

    Hello All,
    Could you please let me know the process of adding cost centres to a particular company code in BI 7.0.
    And also the transport process.Is it similar to R/3?
    Thanks

    Hi Tripathi,
    1) Check the documentation of this bapi 2) Show this message your FI consultant.
    Regards,
    Madhu.

  • Adding cost center on OKB9 with cost element company code with valuation ar

    hi ,
    can anybody help me out with the Adding cost center on OKB9 with cost element company code with valuation area configuration.
    i have to do this configuration but do not know the detailed steps for that one.
    Good points will be awarded.

    Hi Prem
    Select the 1 in column acct assignment details column then in the left side in detail per business area/valuation area enter your valuation area.
    Thanks
    Ashok

  • Adding cost center in RABEST_ALV01 from ANLZ node - ADA Logical database

    Hi,
    I am trying to display cost center in output list of RABEST_ALV01 ALV report (Copied it to ZRABEST_ALV01).
    I was able to include fields which are there in ANLAB and ANLAV in FIAA_SALVTAB_RABEST structure - CI_REPRABEST inlcude. And have included cost center field also in the include (KOSTL).
    This ALV report RABEST_ALV01  is reffering to ADA logical database. I included a node explicitly in the program along with other node declaration :
    NODES: anla0,
                 anlav,
                 anlz ,
                 anlb,
                 anek,
                 anepv,                    
                 anlcv.             
    and added a GET statement in the program GET ANLZ before moving the values to final internal table.
    Here, the the issue is that the values of ANLZ is getting displayed as "#".
    Kidnly suggest.
    Thanks and Regards,
    Rashmi

    Hi Rashmi,
    Please make sure the order of the nodes should be same as the order in which they are there in LDB or else they will be overwritten
    Thanks
    Bala Duvvuri

  • Fixed Assets - Adding cost to an asset

    Accounting department needs to add value to an existing asset.  The asset has a capitalization date of 03/15/2006 and the amount to be added is 170K.  Because that year is already closed, we have to post the acquisition costs in the current period.  As a result, when we run depreciation, the catch-up is only using this year, and taking into consideration the actual cap date of the asset. 
    Can anyone tell me how to post the new acquisition costs so that it will depreciate over the entire period?  Or, will the depreciation catch up work so that it fully depreciates by according to the depreciation end date, which is 2016?
    Any help is greatly appreciated.
    Thank you very much.

    Hi
    Please check with Transaction cost ABSO - Miscelleneous transaction. select the transaction type give your asset no
    and select transaction type 140 Enter the amount to be posted in your case . asset valuation date will copied from asset as you capitalzation date.give the narration in additional text.
    I Think it will resolve your issue.
    If the answer is helpful and resolve your problem kindly assign points
    Thanks & Regards
    Mahesh

  • BAPI_COSTCENTERGROUP_CREATE not adding Cost centers to group

    Hello,
    I am using BAPI_COSTCENTERGROUP_CREATE to add/delete Cost Centers from a group by passing Controlling Area, Group name and Cost centers in HIERARCHYVALUES table.
    Though the BAPI successfully deletes existing Cost centers from the group, while adding, it gives error message that 'This function is not allowed in the standard hierarchy'
    If anyone has worked with this BAPI before or faced a similar error, kindly revert.
    Thanks in advance.
    Regards,
    Shubha Tripathi.

    Hi Tripathi,
    1) Check the documentation of this bapi 2) Show this message your FI consultant.
    Regards,
    Madhu.

  • KEDR - Testing Newly added Cost Element to Derivation Rule

    Hi There -
    Background: We have Column in COPA KE30 report - 3BOXID. This field is updated with Blank and the reason we found is cost element is missing in dervation rule and we added the respective cost element to Derivation Rule
    Can you please help me in testing this
    Thanks
    Sri

    Hi,
      Basically i understand that you wish to have HR posting to COPA
      Please take a look at attached note 130344.
      Basically according to the note there are 2 options:
    1. The update of data from the Payroll in Controlling should be carried out in the standard system to the cost center. The actual commissions posted to cost center can then be posted to Profitability Analysis by assessment.
    2. If you assign the relevant account via the automatic account assignment in transaction OKB9 to profitability segment a costing-based CO-PA document should be created for the postings of transaction PCP0. The profitability segment determined should only be filled rather scarcely though as not much information is available in this case.
    regards
    Waman

  • Adding cost center range in KS05

    Hi,
    I want to add range for cost center field and from change Date in KS05. Can anyone
    guide me on this issue.
    Orelse If there is any function module to achieve this keeping select-options in KS05
    by preparing our own report also will be helpful for me.
    Regards
    VEnk@
    Edited by: Venkat Reddy on Nov 18, 2009 12:49 PM

    Hi, Venkat!
    I haven't found any standard transaction for mass handling of changedocs, but i suppose there is something universal tool for this purpose in the system. I think it is not difficult task to realize it yourself. Check this code please:
    program zjdtest.
    tables: RKMAA.
    select-options: so_kostl for RKMAA-KOSTL obligatory.
    parameters    : p_kokrs type RKMAA-KOKRS obligatory.
    data: lt_objclass type CDOBJECTCL_RANGE_TAB,
          lt_objid    type CDOBJECTV_RANGE_TAB,
          ls_objid    type CDOBJECTV_RANGE,
          lt_tabname  type CDTABNAME_RANGE_TAB,
          lt_editpos  type TABLE OF CDRED.
    start-of-selection.
      append 'IEQKOSTL' to lt_objclass.
      append 'IEQCSKSB' to lt_tabname.
      loop at so_kostl.
        ls_objid-sign       = so_kostl-sign.
        ls_objid-option     = so_kostl-option.
        ls_objid-low+4(10)  = so_kostl-low.
        ls_objid-high+4(10) = so_kostl-high.
        ls_objid-low(4) = ls_objid-high(4) = p_kokrs.
        append ls_objid to lt_objid.
      endloop.
       CALL FUNCTION 'CHANGEDOCUMENT_READ_RANGES'
          EXPORTING
            objectclass_tab                  = lt_objclass
            OBJECTID_TAB                     = lt_objid
            TABLENAME_TAB                    = lt_tabname
          tables
            editpos                          = lt_editpos
          EXCEPTIONS
            NO_POSITION_FOUND                = 1
            WRONG_ACCESS_TO_ARCHIVE          = 2
            TIME_ZONE_CONVERSION_ERROR       = 3
            OTHERS                           = 4
        IF sy-subrc <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'CHANGEDOCUMENT_DISPLAY'
          EXPORTING
            i_applicationid                = sy-cprog
          tables
            i_cdred                        = lt_editpos.

  • Adding Cost of Sales for Non-Stock articles to POS Inbound Pricing Schema

    Hi guys
    I'm working on a requirement to derive the Cost of Sales for non-stock items by pulling the current cost for the site and multiplying it by the billed quantity on VBRP. We could create a new condition type using purchase org, article and site in the condition table and manually enter condition records. However it would be more elegant to copy prices from the Purchasing list or deal prices into new condition types in the POS inbound pricing procedure. However SAP standard doesn't seem to allow condition copying from purchasing to sales.
    Regards
    Brett

    Hi ,
    As it happens you need to do this for Non-Stock Articles only.... then you need a routine to do this .
    And then in IS -Retail do  we not use  NETPrice or Final Cost Price to derive the Sales Price ... In that case you get the Cost Price when the Billing doc is getting posted at line level...
    Regards
    Amitava

  • Adding Cost Center to existing account

    We found out that we need to add a cost center to an existing account that has a couple journal entries posted to it. 
    What is the correct way to go about this?

    Hello,
    I'm worried but you can not assign cost center to posted items. There is one way I thought that, If you don't create a cost element for this account yet, please transfer amount to a dummy account without cost center(if cost element created for this account please use DUMMY cost centers) and then you can create a cost element for this account. After that you can transfer amount from dummy account to cost element with correct cost center.
    Regards,
    Burak

  • LIS copied S012 and added cost center as characteristic

    I have copied S012 (Purchasing) and added the characteristic costcenter to it. (S901)
    I can choose the " Invoice verification chars" MCRSEG-KOSTL or own made MCEKKN-KOSTL.
    But i see difference in amount of records when i compare S012 and the new S901.
    S901 has much less records then S012.
    I compare one artikel from S012 and i have 13 records . In S901 i have 1 record.. Only the record who has a costcenter.
    The others i dont see in my table.
    Do i have to make a formule to get result or is it impossible to add Costcenter to characteristics.
    Please help. I can't find the problem.
    Regards Rob

    Hi Steve ,
    Any suggestion or thought on this ?
    Thanks
    kiran

  • MP001500 - adding cost elements

    Hi
    SAP seems to deliver a screen (3450) for MP200000 - which displays Cost Element information in list view for IT2010.  We would like a similar functionality for IT0015.  Would this be done through modifying the element list in MP001500/3000 (or a copy of 3000) - or through PM01?  The required elements are available through strucure PREF.
    Any advice/best practice (also for naming std.) appreciated.
    /Kirsten

    HI
    I think its not possible to create LSMW project For uploading cost elements...
    Even i tried using LSMW bt it not displaying the Cost Element fields to Upload....
    Regards
    Smitha

  • TS1702 After installing iOS6 to my iPhone4, it wouldn't turn on now and is just stuck on the Apple logo. Why iask us to install iOS6 if there are bugs like this? Now my provider is asking me to get a replacement phone for an added cost at my expense.

    Is there still a remedy for my hone that's stuck on the Apple logo every time I reboot. I can no longer get back to installing iOS6 again. Upon checking itunes, it said that there was an error in the download. I need help!

    I have the same problem with iPhone 3GS, it wont connect to cell data after update to iOS 6.
    everytime i want to connect to internet with any apps on my iPhone, i have to connect from a Wifi first.
    this is frustating...
    are there any solution for this?

  • New MBP w/ Retina Display (base model). Upgrading to 16gb worth the added cost?

    I plan to purchase the new MBP w/ RD (base model), but not sure if I should upgrade to 16gb of ram.
    I know this is all based on the user, so here is some info to help with making suggestions:
    In addition to basic computer use, I plan to do some semi-enthusiast level gaming and video editing via iMovie (no hardcore PS or FC Pro).  When I say semi-ethusiast, I mean Diablo 3-type gaming.
    Something tells me 8gb is more than enough to satisfy my needs, however, there is this side of me that's saying "UPGRADE!!"... I mean, 3rd gen i7 processor + SSD (from Samsung?) + latest nvidia GT 650M + 8gb DDR3L @1600mhz working in concert seems like a sweet combination to me...
    I'm sure these Xgb vs. XXgb debate have been ongoing forever now, but if anyone can shed some additional light to help guide me into making the right purchase decision, I would greatly appreciate it.

    Only you can answer that question.
    Myself however, i would go with the MAX on the RAM since it's not user upgradeable.
    You might need it in the future, then again, you might not.
    Rule of thumb, better safe than sorry....
    Spend the extra $$$ for the extra RAM if i were in your shoes.

Maybe you are looking for

  • BUG: Apple Software Update installs 32-bit iTunes 8 on 64-bit Systems

    Hi, all! Jon here. Just wanted to point out that when Apple Software Update updated my iTunes from 7 to 8, it installed the 32-bit version on my 64-bit OS, and so when it finished and I opened up iTunes, I got a message that it wasn't compatible with

  • Multiline text in table cell

    Hi all, I have used the oracle as the database. My tabel consists of some columns. Eg: 3 cols are there for name and father name Iam displaying the data using the Table Model. But I want to have the name and father name in a single cell like: name fa

  • 1600 - can't set font back to black

    Hi, can anyone help.? I have a 1600 that my 11 year old kid seems to have changed colours or theme setting (she doesn't know), leaving the font displayed in white! Can't figure out how to get it set back to black, can't seem to get original colour sc

  • BEA WebLogic 10.3 JMS Jar version

    Hi, Someone knows what specific version of JMS BEA Jar should be used when connecting to a 10.3 JMS BEA Server from a PI 7.0 system? Thanks in advance.

  • Monitoring stored procedure from forms

    I am following up on a form, to reach the line that contains a call to a stored procedure, I find the way to load the stored procedure to follow. The procedure was compiled with debug, thus: ALTER PACKAGE paquete COMPILE DEBUG package; ALTER PACKAGE