SAPbobsCOM.MaterialRevaluation oMaterialRevaluation = default(SAPbobsCOM.MaterialRevaluation);
SAPbobsCOM.SNBLines oMaterialRevaluationSNBLines = default(SAPbobsCOM.SNBLines);
oMaterialRevaluation = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMaterialRevaluation);
oMaterialRevaluation.DocDate = System.DateTime.Now;
oMaterialRevaluation.RevalType = "P";
oMaterialRevaluation.Comments = "Added through DIAPI";
oMaterialRevaluation.Lines.ItemCode = "TEST01";
oMaterialRevaluation.Lines.WarehouseCode = "02";
oMaterialRevaluation.Lines.RevaluationDecrementAccount = "_SYS00000000134";
oMaterialRevaluation.Lines.RevaluationIncrementAccount = "_SYS00000000135";
oMaterialRevaluationSNBLines = oMaterialRevaluation.Lines.SNBLines;
oMaterialRevaluationSNBLines.SetCurrentLine(0);
oMaterialRevaluationSNBLines.SnbAbsEntry = 80; //AbsEntry from OBTN Table
oMaterialRevaluationSNBLines.NewCost = 900;
oMaterialRevaluationSNBLines.Add();
oMaterialRevaluationSNBLines.SetCurrentLine(1);
oMaterialRevaluationSNBLines.SnbAbsEntry = 81; //AbsEntry from OBTN Table
oMaterialRevaluationSNBLines.NewCost = 1000;
int RetVal = oMaterialRevaluation.Add();
if (RetVal != 0)
{
oCompany.GetLastError(out RetVal, out ErrStr);
MessageBox.Show(ErrStr.ToString().Trim());
}
else
{
oMaterialRevaluation.SaveXML(@"C:\MYFOLDER\MaterialRevaluation.xml");
}
SAPbobsCOM.MaterialRevaluation oMaterialRevaluation = default(SAPbobsCOM.MaterialRevaluation);
SAPbobsCOM.SNBLines oMaterialRevaluationSNBLines = default(SAPbobsCOM.SNBLines);
oMaterialRevaluation = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMaterialRevaluation);
oMaterialRevaluation.DocDate = System.DateTime.Now;
oMaterialRevaluation.RevalType = "P";
oMaterialRevaluation.Comments = "Added through DIAPI";
oMaterialRevaluation.Lines.ItemCode = "MYITEM";
oMaterialRevaluation.Lines.WarehouseCode = "01";
oMaterialRevaluationSNBLines = oMaterialRevaluation.Lines.SNBLines;
oMaterialRevaluationSNBLines.SetCurrentLine(0);
oMaterialRevaluationSNBLines.SnbAbsEntry = 587; //AbsEntry from OSRN
oMaterialRevaluationSNBLines.NewCost = 15;
oMaterialRevaluationSNBLines.Add();
int RetVal = oMaterialRevaluation.Add();
if (RetVal != 0)
{
oCompany.GetLastError(out RetVal, out ErrStr);
MessageBox.Show(ErrStr.ToString().Trim());
}
else
{
oMaterialRevaluation.SaveXML(@"C:\MYFOLDER\MaterialRevaluation.xml");
}
SAPbobsCOM.MaterialRevaluation oMaterialRevaluation = (SAPbobsCOM.MaterialRevaluation)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMaterialRevaluation);
SAPbobsCOM.MaterialRevaluation_lines oMaterialRevaluationLines = oMaterialRevaluation.Lines;
SAPbobsCOM.FIFOLayers oFIFOLayers = oMaterialRevaluationLines.FIFOLayers;
SAPbobsCOM.CompanyService oCompanyService = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService();
SAPbobsCOM.MaterialRevaluationFIFOService oMRVFIFOService = (SAPbobsCOM.MaterialRevaluationFIFOService)oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.MaterialRevaluationFIFOService);
SAPbobsCOM.MaterialRevaluationFIFOParams oMRVFIFOParam = (SAPbobsCOM.MaterialRevaluationFIFOParams)oMRVFIFOService.GetDataInterface(SAPbobsCOM.MaterialRevaluationFIFOServiceDataInterfaces.mrfifosMaterialRevaluationFIFOParams);
SAPbobsCOM.MaterialRevaluationFIFO oMRVFIFO;
oMaterialRevaluation.DocDate = DateTime.Now;
oMaterialRevaluation.RevalType = "P";
oMaterialRevaluationLines.SetCurrentLine(0);
oMaterialRevaluationLines.ItemCode = "TEST2";
oMRVFIFOParam.ItemCode = "TEST2";
oMRVFIFOParam.LocationCode = "01";
oMRVFIFOParam.LocationType = "64";
oMRVFIFOParam.ShowIssuedLayers = SAPbobsCOM.BoYesNoEnum.tNO;
oMRVFIFO = oMRVFIFOService.GetMaterialRevaluationFIFO(oMRVFIFOParam);
oFIFOLayers.LayerID = oMRVFIFO.Layers.Item(0).LayerID;
oFIFOLayers.TransactionSequenceNum = oMRVFIFO.Layers.Item(0).TransactionSequenceNum;
oFIFOLayers.Price = 60;
int LayerNum = oMRVFIFO.Layers.Count;
for (int i = 1; i < LayerNum; ++i)
{
oFIFOLayers.Add();
oFIFOLayers.SetCurrentLine(i);
oFIFOLayers.LayerID = oMRVFIFO.Layers.Item(i).LayerID;
oFIFOLayers.TransactionSequenceNum = oMRVFIFO.Layers.Item(i).TransactionSequenceNum;
oFIFOLayers.Price = 60;
}
int Add = oMaterialRevaluation.Add();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 | |
6 | |
4 | |
4 | |
4 | |
4 |