Skip to Content
avatar image
Former Member

Does SAP DI support creating BinLocation programmatically?

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 19, 2015 at 11:03 PM

    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

    Add comment
    10|10000 characters needed characters exceeded