Skip to Content
0
Former Member
Oct 26, 2013 at 05:47 AM

Inventory Revaluation - Posting through SDK Using DI

288 Views

Dear Friend,

I need to set the Price value 0 when do the GR PO using Inventory Revalution Posting though SDK using DI API.


I am using following Code in FormDataEvent at AcctionSuccess.

But I am Getting Following Error.

How do the Inventory Revaluation Posting. Please give me any sample.

We using SAP B1 8.82 PL 6.

Stock Posting Function The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

Dim m_MaterialRev As SAPbobsCOM.MaterialRevaluation

Dim m_MaterialRevLines As SAPbobsCOM.MaterialRevaluation_lines

m_MaterialRev = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMaterialRevaluation)

m_MaterialRev.DocDate = DateTime.Now

m_MaterialRev.RevalType = "P"

m_MaterialRevLines = m_MaterialRev.Lines

m_MaterialRevLines.SetCurrentLine(0)

m_MaterialRevLines.ItemCode = oMatrix.GetCellSpecific("1", 1).value.ToString.Trim

m_MaterialRevLines.WarehouseCode = oMatrix.GetCellSpecific("24", 1).value.ToString.Trim

m_MaterialRevLines.Price = 0

m_MaterialRevLines.RevaluationDecrementAccount = "101010100021"

m_MaterialRevLines.RevaluationIncrementAccount = "101010100021"

m_MaterialRevLines.Quantity = oMatrix.GetCellSpecific("11", 1).value.ToString.Trim

m_MaterialRevLines.Add()

m_MaterialRev.Add()

If m_MaterialRev.Add() <> 0 Then

StatusBarWarningMsg("Unable To Post Stock Document....... at line Id " & oCompany.GetLastErrorDescription)

Return False

End If

Please Help Me.

Regards,

K Sakthivel

Return True