Dear SAP Experts,
I am implementing an Add-On that creates Sales Orders (but this thread could be applied to any marketing document).
I need to load the information from a text file and to create a Sales Order document with as many items as lines existing in the file.
I successfully achieved that already, but the process is very slow.
I know that the process of loading information can be improved by using Data Sources (but please correct me if I am wrong).
What really worries me is that SAP B1 seems to freeze / crash when I commit the changes to the system.
The skeleton of the application is as follows:
SAPbobsCOM.Documents doc; SAPbobsCOM.Document_Lines docLines; doc = (SAPbobsCOM.Documents) company.GetBusinessObject(BoObjectTypes.oOrders); // Setup document header // ... for (lc = 0 ; lc < lines ; lc ++) { // Setup line fields (Produc, quantity, price) docLines.Add(); docLines.SetCurrentLine(lc + 1); } // Now it is when SAP freezes doc.Add();
Is it possible to optimize the process in line # 12?
The document may contain up to 5000 lines, but I am benchmarking with files twice as big.
I am using SAP B1 8.81 and C#
Best regards,
Nicolas