cancel
Showing results for 
Search instead for 
Did you mean: 

Internal Error - Draft to Invoice

0 Kudos

Dear Experts,

Am trying to update Draft Document to Invoice . But am getting "Internal Error(-10)".

Here with I have attached Screenshot of my Draft Document and Source code for the same.

Kindly help us to Solve.

Am trying to change Warehouse code and UseBaseUnits in Draft, before converting to Invoice.

Dim ODrafts As SAPbobsCOM.Documents

ODrafts = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)

If ODrafts.GetByKey(objRecset.Fields.Item("DocEntry").Value) = True Then

                  

For i = 0 To ODrafts.Lines.Count - 1

      ODrafts.Lines.SetCurrentLine(i)

      ODrafts.Lines.WarehouseCode = StrBranchCode

       ODrafts.Lines.UseBaseUnits = SAPbobsCOM.BoYesNoEnum.tNO

     

Next

Retcode = ODrafts.Update()

Thanks in Adcance.

Regards

Senthil.K

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Have you tried when you removed this line? ODrafts.Lines.UseBaseUnits = SAPbobsCOM.BoYesNoEnum.tNO

Regards,

Bry

Blog: http://www.sap-tips-tricks.com/

maik_delly
Active Contributor
0 Kudos

Hi Senthil,

internal erro -10 usually means that something was not found. Since you are only changing the warehouse I would double check what value StrBranchCode has ( and try it in client aswell ). Also check if there is a base unit defined in the items.

regards,

Maik

0 Kudos

Dear Maik,

Thanks for the reply.

I have double check , that  StrBranchcode always has the Value of Warehouse. Is there any other reason ?

Thanks in advance.

Regards

Senthil.k

maik_delly
Active Contributor
0 Kudos

Hi Senthil,

try to do the same changes in sbo client.If it woks there, get the XML representation ( GetAsXML method ) of that updated draft and compare it to your version before Retcode = ODrafts.Update().

regards,

Maik

0 Kudos

Dear Maik,

Basically I have to change "UseBaseUnits" for BOM (sale bom) child items. SAP does not give option to change this in Client level. Only possible in DI API.

Regards

Senthil.K