cancel
Showing results for 
Search instead for 
Did you mean: 

Receipt from Production with DIAPI error -2014

0 Kudos

After upgrading to 2005 SP1 PL19, Receipt from Production with DIAPI give error -2104.

The function worked fine in 2004. In 2005 SP1 early patches, it gave wrong price (= different from manually created ones) and you actually can't even set the price in DIAPI. Now in the latest patches it does not work at all anymore. Error description is "Internal error (-2014) occurred".

I can manually do the Receipt from Production in SBO, so the problem is only in DIAPI.

Anyone else have the same problem? Any ideas on what to do?

I have tried to set different values in the document (CostingCode, WarehouseCode, etc), but nothing seems help.

Here is the relevant part of the code:


// int baseEntry    - DocEntry of the production order
// double quantity - amount to receipt from production

diDoc = (Documents)B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oInventoryGenEntry);
diDoc.Lines.BaseType = (int)BoObjectTypes.oProductionOrders;
diDoc.Lines.BaseEntry = baseEntry;
diDoc.Lines.Quantity = quantity;
if (diDoc.Add() != 0)
  throw new Exception(B1Connections.diCompany.GetLastErrorDescription());

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

we had similar problems with patch 19 and before.

check these notes that were created from our reports:

1008671 and 1038224.

right now, the latter can not be opened (for some reason, notes appear/disappear randomly sometimes), but it describes the problem of not being able to create any issues/receipts in Pl19

0 Kudos

Thanks for your help.

The notes are visible now and the note 1038224 covers the main problem.

I updated to SBO 2005 SP1 PL20 and Receipt from Production with DIAPI no longer crash.

The smaller problem of different default behavior with the client and DIAPI still remains.

When not using the 'Default Valuation Method', the client uses the BOM price for default,

where as the DIAPI uses 'Last Purchase Price'. This issue has not changed in the PL20.

I can set the price in the code, so this is not too critical.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Tero,

According to SDK Help Center, there's no production order type.

But, I think, you don't need to specify the base type of the receipt document.

I did, and it works as receipt from production. My source code comes below.

Set vGe = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry)

cv_opdt_s = oForm.Items.Item("edtOpdt").Specific.String

cv_opdt_s = SBOFUNC.GetDateFormat(cv_opdt_s)

vGe.DocDate = cv_opdt_s

vGe.Lines.BaseEntry = av_OrderNo_s

vGe.Lines.Quantity = av_qty_i

vGe.Lines.Rate = 0

cv_RetVal_i = vGe.Add

If cv_RetVal_i <> 0 Then

Set vGe = Nothing

oCompany.GetLastError c_Definded.ErrCode, c_Definded.ErrMsg

Call SBOFUNC.COMMON_MESSAGE("!", c_Definded.ErrMsg)

Exit Function

Else

xSQL = "update ign1 set baseref = baseentry where BaseEntry = " & av_OrderNo_s

Set RS = oCompany.GetBusinessObject(BoRecordset)

RS.DoQuery xSQL

Set RS = Nothing

End If

Set vGe = Nothing

Hope this useful for you.

Regards,

Hyunil Choi.

0 Kudos

The original code we used for SBO2004 did not contain the BaseType. I have tested it with and without BaseType, it doesn't work.

Do you have SBO2005 SP1 PL19? Do you use some older DIAPI or what? Would be most interested to know, if an older version DIAPI works with the latest SBO in this case.