cancel
Showing results for 
Search instead for 
Did you mean: 

Does SAP DI support creating BinLocation programmatically?

former_member244307
Participant
0 Kudos

Hi,

I didn't find any method in its DI object to allow me to create a BinLocation, just wondering does SAP DI expose the method?

My SAP DI version is 9.0, SAP B1 9.02.240 PL 14(32 bit).

Thanks,

Lan

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185682
Active Contributor
0 Kudos

Hi Lan,

The DI API exposes a service to manipulate the bin locations. You can try add new bin location with the following code:


SAPbobsCOM.CompanyService oCompanyService = null;

SAPbobsCOM.BinLocationsService oBinService = null;

SAPbobsCOM.BinLocation oBinLoc = null;

SAPbobsCOM.BinLocationParams oBinParams = null;

//Get the company Service

oCompanyService = oCompany.GetCompanyService();

//Get the service that Add Bin Location

oBinService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.BinLocationsService);

//Get the object of Bin Location

oBinLoc = (SAPbobsCOM.BinLocation)oBinService.GetDataInterface(SAPbobsCOM.BinLocationsServiceDataInterfaces.blcsBinLocation);

//Set the required properties

oBinLoc.Warehouse = "02";

oBinLoc.Sublevel1 = "SYSTEM-BIN-LOCATION-1";

//Add new location

oBinParams = oBinService.Add(oBinLoc);

MessageBox.Show("New Bin Location Created - AbsEntry: " + Convert.ToString(oBinParams.AbsEntry));

Hope it helps.

Regards,

Diego