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: 
bettina_anders
Associate
Associate
876
In this blog, we want to show how you can easily integrate supported special fields into an XSL Transformation for custom payment files.

As example for one of these supported special fields, we are taking the Payment Purpose introduced in release 2208 and with release 2302 now available for XSL Transformation.

Source of this field is a wire or bank transfer, so this means it is transaction-based and we need to integrate it accordingly into the XSLT structure. Additionally, the bank configuration needs to be set up so that the system determines the XSL Transformation to be used.


Bank Transfer with Payment Purpose and XSLT Bank Transfer


In our code snippet example, we want to put this into the section for Regulatory Reporting into the XML tag <Cd>, in combination with the country of the receiving bank in tag <Ctry>.
To get the country of the receiving bank, we can use the bank's address and there grab the CountryCode. To retrieve the value of the payment purpose field, we need to check for it as "PaymentMediumSpecificField" with the id "GLO_PAY_PURPOSE" and grab it via its "Value/Code" value.

Bringing us to the following code snippet for the payment purpose inclusion:

<xsl:for-each select="PaymentMediumSpecificField">
<xsl:choose>
<xsl:when test="ID = 'GLO_PAY_PURPOSE'">
<RgltryRptg>
<DbtCdtRptgInd>
<Dtls>
<Ctry>
<xsl:value-of select="../PaymentTransactionDestinatedBankAccount/Bank/Address/PhysicalAddress/CountryCode"/>
</Ctry>
<Cd>
<xsl:value-of select= "Value/Code"/>
</Cd>
</Dtls>
</DbtCdtRptgIndv
</RgltryRptg>
</xsl:when>
</xsl:choose>
</xsl:for-each>


Upon creation of the bank file for above screenshot example, the corresponding data is filled accordingly into the generated payment file:


Payment Purpose information in tag RgltryRptg


Keep in mind that the integration of a field can differ for each bank format, hence kindly check with your bank for the specification guide.

More information on payment purpose and XSL Transformations, especially in regards to payment file generation, can be found here: