8

PaymentReasonCodeService in SAP Business One SDK

 1 year ago
source link: https://blogs.sap.com/2023/01/23/paymentreasoncodeservice-in-sap-business-one-sdk/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
January 23, 2023 Less than a 1 minute read

PaymentReasonCodeService in SAP Business One SDK

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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK