cancel
Showing results for 
Search instead for 
Did you mean: 

Inventory Revaluation - Posting through SDK Using DI

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Johan_H
Active Contributor
0 Kudos

Hi,

This is a limitation in B1. Zero value is not allowed.

The only workaround is to set the price to the lowest possible value above 0 for example 0,01

Regards,

Johan

Former Member
0 Kudos

Hi Johan Hakkesteegt.

               It is possible in B1. I  have completed that Task based on SDK Help. Thank You.

Regards

K Sakthivel