📚 SAP Business One SDK Help

MaterialRevaluationFIFOService Object
See Also  Members  Example

Description

The MaterialRevaluationFIFOService service enables you to retrieve the FIFO layers for a specific item and location. You can then use information about the FIFO layers to specify specific layers to revalue (FIFOLayers) and provide these to the MaterialRevaluation object.

To perform material revaluation, select Inventory --> Inventory Transactions --> Inventory Revaluation

Object Model



Example

Material revaluation (FIFO) (C#)Copy Code
SAPbobsCOM.MaterialRevaluation m_MaterialRev; 
SAPbobsCOM.MaterialRevaluation_lines m_MaterialRevLines; 
SAPbobsCOM.FIFOLayers m_FIFOLayers; 
 
SAPbobsCOM.MaterialRevaluationFIFOService m_MRVFIFOService; 
SAPbobsCOM.MaterialRevaluationFIFO m_MRVFIFO; 
SAPbobsCOM.MaterialRevaluationFIFOParams m_MRVFIFOParam; 
 
SAPbobsCOM.Items m_FIFOItems; 
SAPbobsCOM.Documents m_APInvoice; 
SAPbobsCOM.Document_Lines m_APInvoice_Line; 
 
SAPbobsCOM.BusinessPartners m_Vendor; 
 
m_MaterialRev = (MaterialRevaluation)m_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMaterialRevaluation); 
m_MaterialRev.DocDate = DateTime.Now; 
m_MaterialRev.RevalType = "P"; 
 
// Line sub object: 
m_MaterialRevLines = m_MaterialRev.Lines; 
m_MaterialRevLines.SetCurrentLine(0); 
m_MaterialRevLines.ItemCode = m_FIFOItems.ItemCode; 
 
// Layer sub object 
m_FIFOLayers = m_MaterialRevLines.FIFOLayers; 
  
// Get Company Service 
m_companyService = (CompanyService)m_Company.GetCompanyService(); 
 
// Get Material Revaluation FIFO Service 
m_MRVFIFOService = (MaterialRevaluationFIFOService)m_companyService.GetBusinessService(SAPbobsCOM.ServiceTypes.MaterialRevaluationFIFOService); 
 
// Create Material Revaluation FIFO Service parameters  
m_MRVFIFOParam = (MaterialRevaluationFIFOParams)m_MRVFIFOService.GetDataInterface(SAPbobsCOM.MaterialRevaluationFIFOServiceDataInterfaces.mrfifosMaterialRevaluationFIFOParams); 
m_MRVFIFOParam.ItemCode = m_FIFOItems.ItemCode; 
m_MRVFIFOParam.LocationCode = "01"; 
m_MRVFIFOParam.LocationType = "64"; 
m_MRVFIFOParam.ShowIssuedLayers = BoYesNoEnum.tNO; 
             
// Process FIFO layers 
m_MRVFIFO = m_MRVFIFOService.GetMaterialRevaluationFIFO(m_MRVFIFOParam); 
// Process first layer 
m_FIFOLayers.LayerID = m_MRVFIFO.Layers.Item(0).LayerID; 
m_FIFOLayers.TransactionSequenceNum = m_MRVFIFO.Layers.Item(0).TransactionSequenceNum; 
String strNewPrice = NewPriceTxt.Text; 
m_FIFOLayers.Price = 500; 
// Process other layers 
int LayerNum = m_MRVFIFO.Layers.Count; 
for (int i = 1; i < LayerNum ; ++i) 

     m_FIFOLayers.Add(); 
     m_FIFOLayers.SetCurrentLine(i); 
     m_FIFOLayers.LayerID = m_MRVFIFO.Layers.Item(i).LayerID; 
     m_FIFOLayers.TransactionSequenceNum = m_MRVFIFO.Layers.Item(i).TransactionSequenceNum; 
     m_FIFOLayers.Price = 500; 

m_MaterialRev.Add(); 


See Also