cancel
Showing results for 
Search instead for 
Did you mean: 

Update Another Add-Ons Table in Database?

Former Member
0 Kudos


Hello, I am using Enprise Add-On for Job Costing. This add-on adds the tables below to SAP company database. I had built an enhancements add-on for our company and fill a Matrix with data from a few joined tables in the list below.

I can't seem to be able to update any of these tables using the SAP com objects. The SAPbobsCOM.UserTable does not recognize the Enprise tables. Below is some code that I was trying. Can anyone give example on how I can accomplish this? Any help is deeply appreciated.

Thanks,

Mike

Dim tblJobLines As SAPbobsCOM.UserTable       

tblJobLines = OMComp.UserTables.Item("ENPRISE_JOBCOST_JOBLINES")       

Dim tblSubJobs As SAPbobsCOM.UserTable       

tblSubJobs = OMComp.UserTables.Item("ENPRISE_JOBCOST_SUBJOB")       

Dim sSEQNO As String = ""

Dim sSUBJOB As String = ""      

Try       

     For i As Integer = 0 To tblQuotes.Rows.Count - 1               

          sSEQNO = tblQuotes.Columns.Item("SEQNO").Cells.Item(i).Value

          sSUNJOB = tblQuotes.Columns.Item("SUBJOB").Cells.Item(i).Value               

          tblJobLines.GetByKey(sSEQNO)               

          tblSubJobs.UserFields.Fields.Item("ENTEREDDATE").Value = CType(tblQuotes.GetValue("ENTEREDDATE", i), Date)

          tblJobLines.UserFields.Fields.Item("QTY").Value = CDec(tblQuotes.Columns.Item("QTY").Cells.Item(i).Value)

          tblJobLines.UserFields.Fields.Item("ORIGSELLPR").Value = CDec(tblQuotes.Columns.Item("ORIGSELLPR").Cells.Item(i).Value)

     Next           

     tblJobLines.Update()           

     tblSubJobs.Update()

      LoadMatrix() 'Refresh Matrix with updated values   

Catch ex As Exception           

     Throw       

Finally           

     tblJobLines = Nothing 

     tblSubJobs = Nothing     

End Try

Accepted Solutions (1)

Accepted Solutions (1)

former_member201110
Active Contributor
0 Kudos

Hi Mike,

Enprise tables can't be updated using the standard DI API objects as they are separate SQL tables, rather than UDTs or UDOs. You could use a recordset object and use SQL statements (ie updates or insert statements) to update the tables. I must stress though that updating any third-party tables is not without risk and I'd strongly recommend you confirm with Enprise that they will support their addon at your site if you do this. In some cases, the addon vendors have their own APIs or provide details on what they do or don't allow when customising the logic in their programs. Other addon vendors might not allow any custom tweaks to how their addon works.

Kind Regards,

Owen

Former Member
0 Kudos

Thanks for the info. Owen.

The 3 fields that I am allowing the user to update have been approved by Enprise.

My company has a need to modify this data in an expeditious manner and the current method from Enprise is way too slow.

Hopefully Enprise's next release will be more efficient. It is getting to the point whether the benefit of Enprise is worth all the expense associated with their add-on.

Thanks, again,

Mike

Former Member
0 Kudos

Hi Owen, using an System.Data, SQLRecordSet worked.

It took me awhile to figure out all the sensitivities of Add-On tables located in SAP database, but using the SQLClient client tools to manipulate Add-On data turns out much more efficient than the SAP tools,

I use them in conjunction with one another, i.e. manipulate data, to and from, my add-on in Enprise tables then transfer data to SAP objects in code. It reduces the amount of code and is a whole lot faster.

Keep in mind that your info about being careful not to manipulate anything directly, where undesired results could occur, is still key and only allowed if you have permission from the partner.

Thanks for your input,

Mike

Answers (0)