Skip to Content
Technical Articles

Bank statement in XML format

Hello SAPers!

Here is another post, where I’d like to share a couple of details about SAP’s functionality. This post as many others that I share deals with functionalities around bank statement processing. Setup of bank statement reconciliation in SAP as a rule is quite simple and intuitive, but sometimes you have to deal with more difficult topics, which are not covered by standard customizing. This post explores the mechanism behind uploading of bank statement in XML-format. Please also check out my other post on import of bank statements in CSV format.  I hope you’ll find something interesting for you.

1.   Introduction

Best practices for bank reconciliation in SAP imply upload of electronic bank statements and their postprocessing. Most banks provide bank statements in format MT940, BAI or Multicash which are well supported by SAP. These are the most popular formats, though there are other formats which SAP supports as well. However, once upon a time you’ll have to deal with some bank that doesn’t support these formats and provides statements in its own format. This post explores the options behind configuration of bank-specific statements in XML-format.

Example of bank statement in XML-format can be found below. This is dummy bank statement devised by me specifically for this example and any similarities with real life bank statements are coincidental.

<?xml version="1.0" encoding="windows-1251"?>
    <line rownum="1">
	  <note>Payment for consulting services, invoice #1800000018 from 01.01.2018, contract #10 from 01.01.2018</note>
	  <bp_name>Sport Country LLC</bp_name>
	<line rownum="2">
	  <note>Payment for utility services, invoice #431 from 01.12.2017</note>
	  <bp_name>Utility Investments LLD</bp_name>

2.   Overview of development objects and configuration activities

First step is to develop XSLT-transformation that will parse bank statement and transform it into internal table with type TTY_FEB_STATEMENT. This internal table contains two item components:

  • FEBKO – which stores requisites of bank statement header;
  • ITEMS_FEB, which in turn consists of internal tables storing line item data (i.e. FEBEP), note to payee (i.e. VWEZW) and clearing data (i.e. FEBCL).

Representation of a variable with this data type in a debug mode can be found below:

Main responsibility of a consultant with regards to this task is to prepare a mapping between tags of XML-files and fields of target structure. Check out the contents of standard tables FEBKO, FEBEP and FEBCL in SAP to understand which fields should be filled and what are the rules for data formatting.

Transformation should be created by a developer (in t-code STRANS). But if you want to do it yourself, you can check out an example below:

<xsl:stylesheet xmlns:xsl="" xmlns:sap="" version="1.0">
  <xsl:template match="/">
    <asx:abap xmlns:asx="" version="1.0">
            <!-- Bank statement header data -->
            <xsl:for-each select="/statement/head">
              <xsl:variable name="stmtCurrency">
                <xsl:value-of select="currency"/>
              <xsl:variable name="stmtDate">
                <xsl:value-of select="concat(substring(stmt_date,5,4), substring(stmt_date,3,2), substring(stmt_date,1,2))"/>
                  <xsl:value-of select="stmt_no"/>
                  <xsl:value-of select="$stmtDate"/>
                  <xsl:value-of select="stmtCurrency"/>
                  <xsl:value-of select="'1'"/>
                  <xsl:value-of select="bank_key"/>
                  <xsl:value-of select="account_no"/>
                  <xsl:value-of select="open_balance"/>
                  <xsl:value-of select="end_balance"/>

              <!-- Bank statement line data -->
              <xsl:for-each select="/statement/linedata/line">
                <xsl:variable name="sign">
                  <xsl:value-of select="dr_cr"/>
                      <xsl:value-of select="$stmtDate"/>
                      <xsl:value-of select="$stmtDate"/>
                      <xsl:value-of select="$stmtDate"/>
                      <xsl:value-of select="$stmtCurrency"/>
                      <xsl:value-of select="amount"/>
                      <!-- Transaction code -->
                      <xsl:value-of select="btc"/>
                      <!-- Business partner details -->
                      <xsl:value-of select="bp_bank_acc"/>
                      <xsl:value-of select="bp_name"/>
                      <xsl:value-of select="bp_bank_key"/>
                        <xsl:when test="$sign='C'">
                          <xsl:value-of select="'H'"/>
                          <xsl:value-of select="'S'"/>
                      <xsl:value-of select="note"/>
                  <!-- Note to Payee -->
                        <xsl:value-of select="note"/>

Next step is to define new format for your bank statement in XML-format and link it to XSLT-transformation. Use customizing view VFIEB_MAPP_XCTRL or the following menu path to perform this activity:

SPRO → Financial Accounting (new) → Bank Accounting → Business Transactions → Payment Transactions → Electronic Bank Statement → XML Format and Bank-Specific Formats.

Once you prepared XSLT-transformation and maintained mapping procedure, you can attempt to load bank statement. Go to FF_5 and choose “XML or Bank-Specific Format” option. Once you select it, additional drop-down list will appear, where you can select your custom format. Provide the reference to file path and fill the rest of the screen as usual.

The results of the upload can be found below:

P.S. This post doesn’t describe basic configuration of bank statement, which is also required for bank statement processing e.g. setup of house bank / account IDs, setup of posting rules, transaction types for bank statement etc. Customizing in these areas is standard for any bank statement and well explained.

I hope that you have learn something useful once you reached this sentcen. I’m looking forward to your comments and remarks.


Best regards, 

Bohdan Petrushchak

You must be Logged on to comment or reply to a post.
  • Hi,

    Really nice post, congratulations !!!

    I just have one question … When you write the XML code for the XSLT-transformation, is there any way to put some lines of Abap code to read a table and retrieve back some values from that table ?

    For one of the banks that I am dealing with, I will need to read the table used by the BAI pre -processor (T028Q) because they are not following the XML CAMT.053 standard properly and they are not providing the same bank keys (Transit/Routing) that we have stored in the system. And we need the keys the way we have them in the system to be able to do electronic payments.

    In a sense, they need some keys for Electronic Payments and a different set is sent by them in the EBS XML for the same series of Bank Accounts. That is why the BAI  pre processor works really well for us because we can have that transformation. But the pre processor does not kick in for XML.

    I know I could achieve this with a User-Exit, but just thought that maybe could be achieved here in the XSLT. If yes, how can those sentences be defined ? what are the commands to indicate Abap code ?

    Thanks for your help !


    • Hi Adrian,

      Thanks for appreciating:) As far as I know, it’s not possible to perform ABAP queries from XSLT-transformation. But at the end, it’s better to confirm this point with ABAP developer, maybe there is some workaround.

      Anyway, please let us know if you’ll find a way to call ABAP commands, it would be a good update.



  • Hi Bohdan Petrushchak,

    Thank you so much for sharing such nice blog, we have similar requirement with our existing client

    basically we are getting file from third Party as XML but this file can’t be used directly to SAP for uploading. we need to convert this file in to SAP understandable XML format and post in to SAP

    however we are finding challenges to read SAP XML file format, could you please help/share us the way to identity this file.





    • Hi Santosh,


      Essentially the example of XML-file that I provided in this post cannot be loaded in SAP as is. But the mechanism described in this blog post allows you to take any XML-based bank statement and transform it into internal table that resembles data structure for bank statement header, lines and note to payee information. All you have to understand is how XSLT transformations work and what the the target fields, you’d like to map. Reach out to your development team, they should be able to support you with this task.