Skip to Content
0
Jul 09, 2020 at 01:33 PM

1320000112 - Invalid field value

281 Views

Hi ,

I tried to POST Landed Cost using DI API C# code,but stuck on this error"1320000112 - Invalid field value".

I have use Same code every param values is correct passing.please help me .

SAPbobsCOM.LandedCostsService svrLandedCost = oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.LandedCostsService); SAPbobsCOM.LandedCost oLandedCost = svrLandedCost.GetDataInterface(SAPbobsCOM.LandedCostsServiceDataInterfaces.lcsLandedCost); long oLandedCostEntry = 0; int GRPOEntry = 638; // Landed cost document - item tab line 1 SAPbobsCOM.LandedCost_ItemLine oLandedCost_ItemLine; oLandedCost_ItemLine = oLandedCost.LandedCost_ItemLines.Add(); oLandedCost_ItemLine.BaseDocumentType = SAPbobsCOM.LandedCostBaseDocumentTypeEnum.asGoodsReceiptPO; oLandedCost_ItemLine.BaseEntry = GRPOEntry; oLandedCost_ItemLine.BaseLine = 0; //// Landed cost document - item tab line 2 //oLandedCost_ItemLine = oLandedCost.LandedCost_ItemLines.Add(); //oLandedCost_ItemLine.BaseDocumentType = SAPbobsCOM.LandedCostBaseDocumentTypeEnum.asGoodsReceiptPO; //oLandedCost_ItemLine.BaseEntry = GRPOEntry; //oLandedCost_ItemLine.BaseLine = 1; //// Landed cost document - item tab line 3 //// This is a split line –split from second line (BaseEntry = 13, BaseLine = 1) //oLandedCost_ItemLine = oLandedCost.LandedCost_ItemLines.Add(); //oLandedCost_ItemLine.BaseDocumentType = SAPbobsCOM.LandedCostBaseDocumentTypeEnum.asGoodsReceiptPO; //oLandedCost_ItemLine.BaseEntry = GRPOEntry; //oLandedCost_ItemLine.BaseLine = 1; //oLandedCost_ItemLine.Quantity = 1; //oLandedCost_ItemLine.Warehouse = "01"; // Landed cost document - cost tab line 1 SAPbobsCOM.LandedCost_CostLine oLandedCost_CostLine; oLandedCost_CostLine = oLandedCost.LandedCost_CostLines.Add(); oLandedCost_CostLine.LandedCostCode = "IN"; // Suppose the vendor currency is Foreign Currency, if in local currency should set 'oLandedCost_CostLine.amount oLandedCost_CostLine.amount = 100; // Landed cost document - cost tab line 2 //oLandedCost_CostLine = oLandedCost.LandedCost_CostLines.Add(); //oLandedCost_CostLine.LandedCostCode = "SH"; //oLandedCost_CostLine.amount = 100; //// oLandedCost_CostLine.AllocationBy = SAPbobsCOM.LandedCostAllocationByEnum.asCashValueAfterCustoms //// Landed cost document - cost tab line 3 //oLandedCost_CostLine = oLandedCost.LandedCost_CostLines.Add(); //oLandedCost_CostLine.LandedCostCode = "ST"; //oLandedCost_CostLine.amount = 100; // oLandedCost_CostLine.AllocationBy = SAPbobsCOM.LandedCostAllocationByEnum.asCashValueAfterCustoms oLandedCost_CostLine.CostType = SAPbobsCOM.LCCostTypeEnum.asVariableCosts; SAPbobsCOM.LandedCostParams oLandedCostParams = svrLandedCost.GetDataInterface(SAPbobsCOM.LandedCostsServiceDataInterfaces.lcsLandedCostParams); try { oLandedCostParams = svrLandedCost.AddLandedCost(oLandedCost); oLandedCostEntry = oLandedCostParams.LandedCostNumber; JavaScriptSerializer js = new JavaScriptSerializer(); sucessRes s = new sucessRes(); string json = JsonConvert.SerializeObject(s); json = json.Substring(0, json.Length); return json; } catch (Exception ex) { JavaScriptSerializer js = new JavaScriptSerializer(); errObjClass s = new errObjClass(); s.errMessage = ex.Message; string json = JsonConvert.SerializeObject(s); json = json.Substring(0, json.Length); return json; }