Inventory Posting in SAP Business One SDK
About Inventory Posting:
Inventory Posting is used to reconcile the item quantities with the Inventory Counting results.
After creating an Inventory Counting document to record the counting results, you must post the inventory changes to effect the adjustments in the system. For this, you need to create an Inventory Posting document based on the Inventory Counting document.
To access this window, from the SAP Business One Main Menu
, choose →
For more details on Inventory Posting, you can refer to following link:
https://help.sap.com/saphelp_sbo92/helpdata/en/2f/ca149512334ee58fd95c1c9b3af841/content.htm
Using Inventory Posting in SAP Business One SDK:
Inventory Posting is exposed as a service type Object (InventoryPostingsService) in SAP Business One SDK.
Add an Inventory Posting Document using DI API:
SAPbobsCOM.CompanyService oCS = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService(); SAPbobsCOM.InventoryPostingsService oInventoryPostingsService = oCS.GetBusinessService(SAPbobsCOM.ServiceTypes.InventoryPostingsService); SAPbobsCOM.InventoryPosting oInventoryPosting = oInventoryPostingsService.GetDataInterface(SAPbobsCOM.InventoryPostingsServiceDataInterfaces.ipsInventoryPosting); oInventoryPosting.CountDate = DateTime.Now; SAPbobsCOM.InventoryPostingLines oInventoryPostingLines = oInventoryPosting.InventoryPostingLines; SAPbobsCOM.InventoryPostingLine oInventoryPostingLine = oInventoryPostingLines.Add(); oInventoryPostingLine.ItemCode = "B10000"; oInventoryPostingLine.CountedQuantity = 13; oInventoryPostingLine.WarehouseCode = "05"; oInventoryPostingLine.BinEntry = 2; oInventoryPostingLine.Price = 58; oInventoryPostingLine.UoMCode = "Carton"; oInventoryPostingLine.UoMCountedQuantity = 12; SAPbobsCOM.InventoryPostingBatchNumber oInventoryPostingBatchNumber = oInventoryPostingLine.InventoryPostingBatchNumbers.Add(); oInventoryPostingBatchNumber.BatchNumber = "B-B1234"; oInventoryPostingBatchNumber.Quantity = 288; SAPbobsCOM.InventoryPostingParams oInventoryPostingParams = oInventoryPostingsService.Add(oInventoryPosting);
Update an Inventory Posting Document using DI API:
SAPbobsCOM.CompanyService oCS = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService(); SAPbobsCOM.InventoryPostingsService oInventoryPostingsService = oCS.GetBusinessService(SAPbobsCOM.ServiceTypes.InventoryPostingsService); SAPbobsCOM.InventoryPostingParams oInventoryPostingParams = (SAPbobsCOM.InventoryPostingParams)oInventoryPostingsService.GetDataInterface(SAPbobsCOM.InventoryPostingsServiceDataInterfaces.ipsInventoryPostingParams); oInventoryPostingParams.DocumentEntry = 1; SAPbobsCOM.InventoryPosting oInventoryPosting = oInventoryPostingsService.Get(oInventoryPostingParams); oInventoryPosting.Remarks = "TEST DI API"; oInventoryPostingsService.Update(oInventoryPosting);
New NetWeaver Information at SAP.com
Very Helpfull