Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
662
DeductibleTaxService in SAP Business One SDK enables you to add, look up, update and remove Deducted Purchase Tax Codes related data in ORTG table.

Deducted Purchase Tax Codes is specific to Israel (IL) localization. More details about Deducted Purchase Tax Codes can be found in the following blog post: https://blogs.sap.com/?p=1775261

In SAP Business One, Deducted Purchase Tax Codes – Setup is available under Administration → Setup → Financials → Tax → Deducted Purchase Tax Codes.

Below are some samples which you might find useful when using DeductibleTaxService in SAP Business One SDK:

  • Add a new Deducted Purchase Tax Code:


SAPbobsCOM.CompanyService oCompanyService = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService();
SAPbobsCOM.DeductibleTaxService oDeductibleTaxService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.DeductibleTaxService);
SAPbobsCOM.DeductibleTax oDeductibleTax = oDeductibleTaxService.GetDataInterface(SAPbobsCOM.DeductibleTaxServiceDataInterfaces.dtsDeductibleTax);
oDeductibleTax.Code = "X1";
oDeductibleTax.Name = "X1 Name";
oDeductibleTax.DeductibleTaxRate = 18;
oDeductibleTax.Inactive = SAPbobsCOM.BoYesNoEnum.tNO;
var Add = oDeductibleTaxService.Add(oDeductibleTax);


  • Update an existing Deducted Purchase Tax Code:


SAPbobsCOM.CompanyService oCompanyService = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService();
SAPbobsCOM.DeductibleTaxService oDeductibleTaxService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.DeductibleTaxService);
SAPbobsCOM.DeductibleTaxParams oDeductibleTaxParams = oDeductibleTaxService.GetDataInterface(SAPbobsCOM.DeductibleTaxServiceDataInterfaces.dtsDeductibleTaxParams);
SAPbobsCOM.DeductibleTax oDeductibleTax;
oDeductibleTaxParams.Code = "X1";
oDeductibleTax = oDeductibleTaxService.Get(oDeductibleTaxParams);
oDeductibleTax.Inactive = SAPbobsCOM.BoYesNoEnum.tYES;
oDeductibleTax.DeductibleTaxRate = 16;
oDeductibleTaxService.Update(oDeductibleTax);


  • Get all existing Deducted Purchase Tax Codes:


SAPbobsCOM.CompanyService oCompanyService = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService();
SAPbobsCOM.DeductibleTaxService oDeductibleTaxService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.DeductibleTaxService);
SAPbobsCOM.DeductibleTaxParamsCollection oDeductibleTaxParamsCollection;
oDeductibleTaxParamsCollection = oDeductibleTaxService.GetList();
foreach (SAPbobsCOM.DeductibleTaxParams oDeductibleTaxParams in oDeductibleTaxParamsCollection)
{
var Code = oDeductibleTaxParams.Code;
var Name = oDeductibleTaxParams.Name;
}


  • Delete an existing Deducted Purchase Tax Code:


SAPbobsCOM.CompanyService oCompanyService = (SAPbobsCOM.CompanyService)oCompany.GetCompanyService();
SAPbobsCOM.DeductibleTaxService oDeductibleTaxService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.DeductibleTaxService);
SAPbobsCOM.DeductibleTaxParams oDeductibleTaxParams = oDeductibleTaxService.GetDataInterface(SAPbobsCOM.DeductibleTaxServiceDataInterfaces.dtsDeductibleTaxParams);
oDeductibleTaxParams.Code = "X1";
oDeductibleTaxService.Delete(oDeductibleTaxParams);