SAPB12005

Hi,
i created one addon, in that i wrote code for generating runtime grid.
and i put one button with Unique id =1
when i run the application,
griddata and Add button displaying propelry.
but if i edit grid rows data, after i press the button, i got "Operation completed successfully" message. but
in database, i did not get updated.
i tried somany times but no result.
how to change the modes of the button as update?
plz help me asap
REGARDS,
NAGABABU.

nagababu
If you declare the button with a Unique id =1, SAP considers that button as the OK/Find/Update one.  Which means SAP manages that button and changes it's caption as the mode in the form changes.
In order to work properly, if you are using a User Defined Form that you've created with an UDO, and the controls (matrix or Grid for instance) are bound properly, then it should save data.  In either case, if you press the Update button , and no code is behind the form, SAP B1 will always display the "Operation completed successfully" will display even if no data is affected.
I personally prefer a Matrix object.  You can bound the Matrix directly to a table or through code to a DBDataSource or UserDataSource.

Similar Messages

  • SP01: DI error -5002 Invalid Total ORDR.DocTotal

    Hi All,
    i'm getting a strange error.
    i'm adding a sales order via DI.
    when the code is executed via the .net debugger it works great.
    when i create an installer and install the Addon i receive the error:
    -5002 Invalid Total [ORDR.DocTotal]
    do someone ever had this kind of error?
    btw i'm using SAPB12005A SP1 PL2
    thanks
    Moty Moshin

    Here is the code:
    oNewOrder = B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
                        'B1Connections.diCompany.StartTransaction()
                        Dim LinesAdded As Integer = 0
                        For i = 1 To intDupAmount
                            Try
                                ' this loop adds the different items to the Delivery object
                                oNewOrder.CardCode = strBPCode
                                oNewOrder.Series = strSeriesCode
                                oNewOrder.NumAtCard = strVendorRefNo
                                oNewOrder.Project = strProjectCode
                                oNewOrder.ShipToCode = strShipToCode
                                oNewOrder.DocDueDate = strDocDueDate
                                oNewOrder.Comments = strComments
                                oNewOrder.PaymentGroupCode = strPaymentTerms
                                oNewOrder.PaymentMethod = strPaymentMethod
                                'Currently not available thru the DI/UI
                                'oNewOrder.header = OQUTHeader
                                'oNewOrder.Footer = OQUTFooter
                            Catch ex As Exception
                                B1Connections.theAppl.MessageBox("In For Step 1")
                            End Try
                            Try
                                oNewOrder.Lines.SetCurrentLine(0)
                                'Line item fields that are visible on the sales order form
                                oNewOrder.Lines.ItemCode = currSalesFormLines.ItemCode 'As String '1     'ItemCode
                                oNewOrder.Lines.ItemDescription = currSalesFormLines.ItemDesc 'As String '1     'ItemDesc
                                oNewOrder.Lines.WarehouseCode = currSalesFormLines.WhsCode 'As String '24     'WhsCode
                                oNewOrder.Lines.UnitPrice = currSalesFormLines.UnitPrice 'As Double '14     'UnitPrc
                                oNewOrder.Lines.DiscountPercent = currSalesFormLines.DiscPct 'As Double '14     'DiscPct
                                oNewOrder.Lines.Price = currSalesFormLines.Price 'As Double '17     'Price
                                oNewOrder.Lines.Quantity = currSalesFormLines.Quantity 'As Double '11     'Quantity
                                'Line item fields that are not visible on the sales order form
                                oNewOrder.Lines.UserFields.Fields.Item("U_" + cUDinit.udfMdL_EstQty).Value = currSalesFormLines.EstQty  'As Double 'U_XX_EstQty
                                'oNewOrder.Lines.UserFields.Fields.Item("U_" + cUDinit.udfMdL_STCC).Value = currSalesFormLines.STCC.ToString    'As Double 'U_XX_STCC
                                'oNewOrder.Lines.UserFields.Fields.Item("U_" + cUDinit.udfMdL_HSC).Value = currSalesFormLines.HSC   'As String 'U_XX_HSC
                                'oNewOrder.Lines.UserFields.Fields.Item("U_" + cUDinit.udfMdL_CVal).Value = currSalesFormLines.CVal.ToString    'As Double 'U_XX_CVal
                                oNewOrder.Lines.TotalLc = currSalesFormLines.TotalLc 'As Double '21     'TotalLc
                                oNewOrder.Lines.Total()
                                oNewOrder.Lines.UserFields.Fields.Item("U_" + cUDinit.udfMdL_QtyMT).Value = currSalesFormLines.QtyMT  'As Double 'U_XX_QtyMT
                                oNewOrder.Lines.UserFields.Fields.Item("U_" + cUDinit.udfMdL_QtyST).Value = currSalesFormLines.QtyST   'As Double 'U_XX_QtyST
                                'oNewOrder.Lines.UserFields.Fields.Item("U_" + cUDinit.udfMdL_DGood).Value = currSalesFormLines.DGood.ToString    'As String 'U_XX_DGood
                            Catch ex As Exception
                                B1Connections.theAppl.MessageBox("In For Step 2 - Lines")
                            End Try
                            Try
                                'Header level UDF's
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_ConNum).Value = cLastUdfMD.ConNum
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_ConTyp).Value = cLastUdfMD.ConTyp
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_ConSta).Value = cLastUdfMD.ConSta
                                If cLastUdfMD.RefCon <> "" Then
                                    oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_RefCon).Value = cLastUdfMD.RefCon
                                End If
                                'Get Release number
                                'B1Connections.theAppl.MessageBox("Before Add Msg 2")
                                lngNextRelease = cReleaseNumber.GetNextNum(cUDinit.udoRn_ReleaseNumber, strSeries)
                                If lngNextRelease = -1 Then
                                    B1Connections.diCompany.EndTransaction(BoWfTransOpt.wf_RollBack)
                                    retVal = cReleaseNumber.UnLockNumbering(cUDinit.udoRn_ReleaseNumber, strSeries)
                                    B1Connections.theAppl.MessageBox("Error - Cannot Get Next Number from NNM1")
                                    Exit Sub
                                End If
                                releaseNumbers.Add(lngNextRelease)
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_RelNum).Value = lngNextRelease.ToString  'intRelNum
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_ShDtSt).Value = cLastUdfMD.ShDtSt
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_ShDtEn).Value = cLastUdfMD.ShDtEn
                                If cLastUdfMD.StrDt <> "" Then
                                    oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_StrDt).Value = cLastUdfMD.StrDt
                                End If
                                If cLastUdfMD.StrAmt <> "" Then
                                    oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_StrAmt).Value = cLastUdfMD.StrAmt
                                End If
                                If cLastUdfMD.AcrAmt <> "" Then
                                    oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_AcrAmt).Value = cLastUdfMD.AcrAmt
                                End If
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_CQTY).Value = cLastUdfMD.CQTY
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_LN).Value = cLastUdfMD.LN
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_STerms).Value = cLastUdfMD.STerms
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_Mode).Value = cLastUdfMD.Mode
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_Carrier).Value = cLastUdfMD.Carrier
                                If cLastUdfMD.PortEntry <> "" Then
                                    oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_PtEnt).Value = cLastUdfMD.PortEntry
                                End If
                                If cLastUdfMD.CBrok <> "" Then
                                    oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_CBrok).Value = cLastUdfMD.CBrok
                                End If
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_Fterm).Value = cLastUdfMD.FTerms
                                If cLastUdfMD.PriveEq <> "" Then
                                    oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_PrivEq).Value = cLastUdfMD.PriveEq
                                End If
                                If cLastUdfMD.Route <> "" Then
                                    oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_Route).Value = cLastUdfMD.Route
                                End If
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_TF).Value = cLastUdfMD.TF
                                'oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_Season).Value = cLastUdfMD.Season
                                'oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_STCity).Value = cLastUdfMD.STCity
                                'oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_STCtr).Value = cLastUdfMD.STCtr
                                'oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_STSt).Value = cLastUdfMD.STSt
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_TAmtIn).Value = cLastUdfMD.TAmtIn
                                oNewOrder.UserFields.Fields.Item("U_" + cUDinit.udfMdH_TAmtOr).Value = cLastUdfMD.TAmtOr
                            Catch ex As Exception
                                B1Connections.theAppl.MessageBox("In For Step 3 - Header Level UDF")
                            End Try
                            ' add sales order current quntity () from total (U_XX_TQTYR)
                            ' add sales order current dollar value() from total (U_XX_TAMTR)
                            ' Try to add the sales order object to the database
                            'B1Connections.theAppl.MessageBox("Before Add Msg 3")
                            lRetCode = oNewOrder.Add()
                            'B1Connections.theAppl.MessageBox("Before Add Msg 3.1")
                            If lRetCode <> 0 Then ' If the addition failed
                                B1Connections.diCompany.GetLastError(lErrCode, sErrMsg)
                                B1Connections.theAppl.MessageBox("Error - " & lErrCode & sErrMsg)
                                '   B1Connections.diCompany.EndTransaction(BoWfTransOpt.wf_RollBack)
                                Try
                                    B1Connections.diCompany.EndTransaction(BoWfTransOpt.wf_RollBack)
                                Catch ex As Exception
                                    B1Connections.theAppl.MessageBox("Error - Add Error:" & lRetCode & " - " & ex.Message)
                                End Try
                                retVal = cReleaseNumber.UnLockNumbering(cUDinit.udoRn_ReleaseNumber, strSeries)
                                'B1Connections.diCompany.GetLastError(lErrCode, sErrMsg)
                                'B1Connections.theAppl.MessageBox("Error - " & lErrCode & sErrMsg)
                                Exit Sub
                            Else
                            End If
                            LinesAdded = LinesAdded + 1
                            ' init the order object
                            oNewOrder = B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
                        Next i
                        'B1Connections.diCompany.EndTransaction(BoWfTransOpt.wf_Commit)
                        retVal = cReleaseNumber.UnLockNumbering(cUDinit.udoRn_ReleaseNumber, strSeries)

  • How to Upgrade sqlserver2000 to Sqlserver2005(Sapb2005)

    Hi,
    How can i upgrade Sqlserver2000 to sqlserver2005 database.Previously i am working with Sqlserver 2000 Database now regarding requirement i had to upgrade Database in Sqlserver2005 without uninstalling Sapb12005  can anyone suggest me regarding this Issue.
    very Urgent.
    Regards
    Nagababu

    Hello,
    You could directly change the common database server from SQL 2000 to SQL2005 in the add remove program (in the control panel). Select / highlight the SAP Business One, click  change / remove button and after the screen install shield wizard welcome screen appears, click modify, click next --> select by ticking common database and demo in the select feature screen, click next --> edit data screen to select database server type. In this screen you choose SQL 2005, click next --> edit data server login screen,here you must fill the login screen, click next until finish.
    If it is finished, you could backed up the production live database in the SQL 2000, and restore in the SQL 2005. It must be done after you have finished creating new database in the SQL 2005. If you change common database to SQL 2005, it means your production live database can be read or access if it has been restored in the SQL 2005. So, the database is still disturbed. The benefit is you do not have to reinstall the SAP B1.
    Rgds,

  • SAPb1-Reports

    Hi,
    I am customizing the Sapb12005 Reports.
    in that
    1.  how to edit the existing Reports format in b1?
    for this we tried modify the Report format(Template). but it not reflecting.
    2.  How to create New report with our customized format? plz help me
    for this Reports, is there any necessary to use crystal reports?
    plz help me asap.
    Regards,
    Anand.

    anand,
    Check this link for PLD documents.
    https://websmp107.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000706496&_SCENARIO=01100035870000000183&_ADDINC=011000358700001192682007E&
    Also, see https://websmp107.sap-ag.de/~sapidb/011000358700003245962006E
    Jeyakanthan

  • Error: -1612 The installation source for this product is not available. Ver

    Hi,
    I am trying installing the FA in SAPB12005A SP01 PL36. and I received this error message:
    Error: -1612 The installation source for this product is not available. Verify that the source exists and that you can access it.
    How can I resolved this?
    Regards,
    IAN

    I am getting the exact same error. How come anyone else did not get it?
    The procedure I followed was :
    Downloaded and installed the "download manager" first.
    Then selected all product updates from BOXI3.1 Enterprise
    It downloaded 58 items. After an inquiry I came to know that you need to install only the latest patch, i.e. Patch 1.7 will include all previous patches. So I was running 1.7 and getting this error constantly, and unable to install it at all.
    I tried downloading it from different places and networks, same error persists.

Maybe you are looking for

  • Problem in 1GB micro memory card

    hey, i'm using nokia 3120 classic. i have problem on my memory card. when i placed my 1GB micro memory card into my mobile. it show a message "Memory card not formatted". this problem occur when i was moving data from phone memory to memory card, i q

  • PA & OM mini master 1st phase & Full blown 2nd phase?

    hi gurus!                   We have another problem. The thing is we already have mini master in the system before full implementation. The client is already using the production server. The new Ent & Personnel Structure has changed. So the second ph

  • I can find no way to change the primary number online

    I want to switch one of my two phone numbers to primary with the other - can't find anyway to do it online

  • CS5 printer issues with Epson R2400

    Upgraded (????) to CS5 Win7-64, Photoshop CS5 - 64 & 32, Epson R2400 (Epson Easy Photo Print v1.51 Drivers) CS5 will not print multiple copies. Can change it in printer settings, makes no difference. CS5 will not allow me to change orientation to lan

  • Why won't BT let me have BT Vision - 3 failed orde...

    I have placed 1 online order for BT Vision and 2 on the phone orders. All have been cancelled (in succession - I didn't place all at the same time!). Apparently I live in a "red" freeview area and they won't sell me it. Even though I get every single