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
543
PaymentReasonCodeService in SAP Business One SDK, is specific to Certificazione Unica for Italy localization.

For details about Certificazione Unica, refer to the following blog: Italy_Certificazione Unica related objects and properties in SAP Business One SDK.




Navigation path 1 in SAP Business One: Administration → Setup → Financial → Tax → Withholding Tax, and go to the column Payment Reason Code.

Navigation path 2 in SAP Business One: Business Partner Master Data → Accounting → Tax, select the checkbox Subject to Withholding Tax, choose the browser button next to the Specific WTax Amounts Setup field, and go to the column Payment Reason Code.

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

  • Add a new Payment Reason Code:


SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
SAPbobsCOM.PaymentReasonCodeService oPaymentReasonCodeService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.PaymentReasonCodeService);
SAPbobsCOM.PaymentReasonCode oPaymentReasonCode = oPaymentReasonCodeService.GetDataInterface(SAPbobsCOM.PaymentReasonCodeServiceDataInterfaces.prcsPaymentReasonCode);
oPaymentReasonCode.Code = "TT";
oPaymentReasonCodeService.AddPaymentReasonCode(oPaymentReasonCode);


  • Get an existing Payment Reason Code:


SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
SAPbobsCOM.PaymentReasonCodeService oPaymentReasonCodeService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.PaymentReasonCodeService);
SAPbobsCOM.PaymentReasonCodeParams oPaymentReasonCodeParams = oPaymentReasonCodeService.GetDataInterface(SAPbobsCOM.PaymentReasonCodeServiceDataInterfaces.prcsPaymentReasonCodeParams);
SAPbobsCOM.PaymentReasonCodesParams oPaymentReasonCodesParams = oPaymentReasonCodeService.GetDataInterface(SAPbobsCOM.PaymentReasonCodeServiceDataInterfaces.prcsPaymentReasonCodesParams);
oPaymentReasonCodeParams.Code = "A";
SAPbobsCOM.PaymentReasonCode oPaymentReasonCode = oPaymentReasonCodeService.GetDataInterface(SAPbobsCOM.PaymentReasonCodeServiceDataInterfaces.prcsPaymentReasonCode);
oPaymentReasonCode = oPaymentReasonCodeService.GetPaymentReasonCode(oPaymentReasonCodeParams);


  • Delete an existing Payment Reason Code:


SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
SAPbobsCOM.PaymentReasonCodeService oPaymentReasonCodeService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.PaymentReasonCodeService);
SAPbobsCOM.PaymentReasonCodeParams oPaymentReasonCodeParams = oPaymentReasonCodeService.GetDataInterface(SAPbobsCOM.PaymentReasonCodeServiceDataInterfaces.prcsPaymentReasonCodeParams);
oPaymentReasonCodeParams.Code = "Z1";
oPaymentReasonCodeService.DeletePaymentReasonCode(oPaymentReasonCodeParams);

Note: In Service Layer, refer to the entity PaymentReasonCodes for the same.