ImportDeterminationService in SAP Business One DI API enables you to add, update, get and delete Import Determination data in Electronic Documents Import Setup window.

It is a part of the Electronic Document Import Wizard. The Electronic Document Import Wizard provides dedicated functionality for importing electronic documents to the system.

In SAP Business One, you can access it using Main Menu → Purchasing – A/P → Electronic Documents Import Wizard.

Below are some samples which you might find useful when using ImportDeterminationService in SAP Business One DI API:

  • Add a new Import Determination:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
ImportDeterminationService oImportDeterminationService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ImportDeterminationService);
ImportDetermination oImportDetermination = oImportDeterminationService.GetDataInterface(ImportDeterminationServiceDataInterfaces.idsImportDetermination);
oImportDetermination.Code = ElectronicDocProtocolCodeStrEnum.edpcs_PEPPOL;
oImportDetermination.LineNumber = 4;
oImportDetermination.ObjectType = ((int)BoObjectTypes.oPurchaseCreditNotes).ToString();
oImportDetermination.ObjectTypeXPath = "?object_type_xpath";
oImportDetermination.FieldType = ImportFieldTypeEnum.iftFederalTaxID;
oImportDetermination.FieldTypeXPath = "field_type_xpath";
oImportDetermination.ImportFormat = -12; //eDoc PEPPOL - Credit Note Import (System);
oImportDetermination.DefaultDigitalSeries = 72;
oImportDeterminationService.AddDetermination(oImportDetermination);
  • Update an existing Import Determination:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
ImportDeterminationService oImportDeterminationService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ImportDeterminationService);
ImportDeterminationParams oImportDeterminationParams = oImportDeterminationService.GetDataInterface(ImportDeterminationServiceDataInterfaces.idsImportDeterminationParams);
oImportDeterminationParams.Code = ElectronicDocProtocolCodeStrEnum.edpcs_PEPPOL;
oImportDeterminationParams.AbsEntry = 9;
ImportDetermination oImportDetermination = oImportDeterminationService.GetDetermination(oImportDeterminationParams);
oImportDetermination.FieldType = ImportFieldTypeEnum.iftUnifiedFederalTaxID;
oImportDeterminationService.UpdateDetermination(oImportDetermination);
  • Retrieve all available Import Determinations:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
ImportDeterminationService oImportDeterminationService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ImportDeterminationService);
ImportDeterminationsParams oImportDeterminationsParams = oImportDeterminationService.GetDataInterface(ImportDeterminationServiceDataInterfaces.idsImportDeterminationsParams);
ImportDeterminationsCollection oImportDeterminations = (ImportDeterminationsCollection)oImportDeterminationService.GetDeterminations(oImportDeterminationsParams);

for (int i = 0; i < oImportDeterminations.Count; ++i)
{
    var ImportDetermination = oImportDeterminations.Item(i);
    var AbsEntry = ImportDetermination.AbsEntry;
    var Code = ImportDetermination.Code;
    var LineNumber = ImportDetermination.LineNumber;
    var ObjectType = ImportDetermination.ObjectType;
    var ObjectTypeXPath = ImportDetermination.ObjectTypeXPath;
    var FieldType = ImportDetermination.FieldType;
    var FieldTypeXPath = ImportDetermination.FieldTypeXPath;
    var ImportFormat = ImportDetermination.ImportFormat;
    var DefaultDigitalSeries = ImportDetermination.DefaultDigitalSeries;
}
  • Delete an Import Determination:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
ImportDeterminationService oImportDeterminationService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ImportDeterminationService);
ImportDeterminationParams oImportDeterminationParams = oImportDeterminationService.GetDataInterface(ImportDeterminationServiceDataInterfaces.idsImportDeterminationParams);
oImportDeterminationParams.Code = ElectronicDocProtocolCodeStrEnum.edpcs_PEPPOL;
oImportDeterminationParams.AbsEntry = 9;
ImportDetermination oImportDetermination = oImportDeterminationService.GetDetermination(oImportDeterminationParams);
oImportDeterminationService.DeleteDetermination(oImportDeterminationParams);
Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x