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: 
SRuthe
Product and Topic Expert
Product and Topic Expert
4,816
The objective of this blog post is to introduce the new web service for bank statements in SAP Business ByDesign 2102.

In 2011 we developed the ManageBankStatementIn web service and executed a Beta Release for it. During the Beta Release we got very positive feedback and now, with release 2102 the web service interface Manage Bank Statements is general available. It enables you to create and edit bank statements in your system by connecting external applications to SAP Business ByDesign.

The web service creates a bank statement like the creation of a manual bank statement in the Liquidity Management work center. Therefore, it is independent of the file format provided by the bank and cannot be compared with the existing Bank Statement Upload functionality in the system.

The intention of this web service is to support

  • the mass upload of bank statements,

  • or the automatic creation of bank statements with file formats which are not supported by the existing Bank Statement Upload functionality


by building partner or customer-specific solutions.

You find the web service in the Application and User Management work center under Input and Output Management - Service Explorer. Just enter Bank Statement in the Search field and start the search.



When you select a line, like for example the Check bank statements operation, you will find a link to further Documentation under Details: Manage Bank Statements - Check bank statements. The documentation also provides a simple web service request which uses the MaintainBundle operation to create a new bank statement.

In case you need further general information related to the use of web service APIs (SOAP) please read this blog post SAP Business ByDesign – API Overview from my colleague Knut Heusermann.

This explanation shall help you to understand how to use the new web service for bank statements in SAP Business ByDesign 2102.
18 Comments
ChrisWarken
Participant
This is great that there is finally an alternative to the existing Bank Statement Upload.

Until now we just had the possibility to automatize the upload of standardized MT940 or CAMT files wherefor we already developed some solutions for our customers.

I am curious to test it.

Regards
tobias_czech
Explorer
0 Kudos

It has been possible for a long time to upload bank statements via oData Service and to release them via Function Import.

oData BO Company Payment File Register / Incoming File / Attachment Folder using POST method.
The MT940 file can be included as base 64 string.

The bank statement can then be released via the function Import StartPaymentUpdate.

 

Regards

SRuthe
Product and Topic Expert
Product and Topic Expert
Hi Tobias,

thanks for your comment. The idea of this web service we delivered is to be independent of the bank statement file format such as MT940, so that it is possible to upload bank statement file formats which are not supported in ByD standard. In case of non-localized countries this is a typical requirement.

Best regards,

Sissi
ronald_vanherk
Explorer
0 Kudos
Hi Sissi,

Thanks for sharing, we are investigating the use of this webservice but cannot find a good soap xml example on how to utilize the Document element to upload a bankstatement using this webservice.

Manage Bank Statements | API | SAP API Business Hub

Do you have an example?

 
ronald_vanherk
Explorer
0 Kudos
Hi Tobias,

Do you know if it possible to upload CAMT053/ISO20022 files using the oData webservices?
SRuthe
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Ronald,

did you check the examples in the Manage Bank Statements | API | SAP API Business Hub documentation? If yes, what is missing in the examples?

Best regards,


Sissi
FX
Participant
0 Kudos
Hi Ronald,

Here's a working example from our side if it helps.

Cheers,
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
<soapenv:Body>
<glob:BankStatementBundleMaintainRequest_sync>
<BankStatement ActionCode="01">
<CompanyID>COMPANY</CompanyID>
<HouseBankAccount>
<ID>DFR00006</ID>
</HouseBankAccount>
<StatementDate>2021-05-20</StatementDate>
<PostingDate>2021-05-20</PostingDate>
<OpeningBalanceAmount currencyCode="EUR">0</OpeningBalanceAmount>
<ClosingBalanceAmount currencyCode="EUR">0</ClosingBalanceAmount>
<CreditTotalAmount currencyCode="EUR">1409.84</CreditTotalAmount>
<DebitTotalAmount currencyCode="EUR">1409.84</DebitTotalAmount>
<Item ActionCode="01">
<ItemID>1</ItemID>
<PostedAmount currencyCode="EUR">0.84</PostedAmount>
<BusinessProcessVariantTypeCode>48</BusinessProcessVariantTypeCode>
<PaymentReference>
<ID/>
</PaymentReference>
<BankValueDate>2021-05-20</BankValueDate>
<BankPostingDate>2021-05-19</BankPostingDate>
<PaymentExplanationNote>
<Note/>
</PaymentExplanationNote>
</Item>
<Item ActionCode="01">
<ItemID>2</ItemID>
<PostedAmount currencyCode="EUR">1409.0</PostedAmount>
<BusinessProcessVariantTypeCode>48</BusinessProcessVariantTypeCode>
<PaymentReference>
<ID>1759214121714884</ID>
</PaymentReference>
<BankValueDate>2021-05-20</BankValueDate>
<BankPostingDate>2021-05-19</BankPostingDate>
<PaymentExplanationNote>
<Note>1759214999914884</Note>
</PaymentExplanationNote>
</Item>
<Item ActionCode="01">
<ItemID>3</ItemID>
<PostedAmount currencyCode="EUR">-1385.0</PostedAmount>
<PaymentReference>
<ID/>
</PaymentReference>
<BankValueDate>2021-05-20</BankValueDate>
<BankPostingDate>2021-05-20</BankPostingDate>
<PaymentExplanationNote>
<Note/>
</PaymentExplanationNote>
</Item>
<Item ActionCode="01">
<ItemID>4</ItemID>
<PostedAmount currencyCode="EUR">-24.84</PostedAmount>
<PaymentReference>
<ID/>
</PaymentReference>
<BankValueDate>2021-05-20</BankValueDate>
<BankPostingDate>2021-05-20</BankPostingDate>
<PaymentExplanationNote>
<Note>FEES</Note>
</PaymentExplanationNote>
</Item>
<ReleaseBankStatement>true</ReleaseBankStatement>
</BankStatement>
</glob:BankStatementBundleMaintainRequest_sync>
</soapenv:Body>
</soapenv:Envelope>

And it integrates properly in SAP:


 

Hope it helps,

FX
ronald_vanherk
Explorer
0 Kudos
Hi François-Xavier,

Thank you for your response. My question was about adding an document in the soap envelope as binary object as partly described in the documentation. I am hoping it facilitates a way to upload the whole bank statement as file into the Incoming Files work center.

ronald_vanherk
Explorer
0 Kudos
Hi Sissi,

Yes, I did and I referred to the same documentation in my previous post 🙂 But I would like to see an example where a document is attached as binary object in the soap envelop. If that is possible at all. See also my screenshot as reply below to the post of François-Xavier.
FX
Participant
Hi Ronald,

From my understanding, the "Manage Bank Statements" webservice documented here does not put anything in the "Incoming Files" work center, and creates directly the Bank Statement object, bypassing the whole mechanism of uploading a file, and translating it from a bank standard (for example MT940 UK, BAI2 US, AFB, etc...) to an SAP object.

The Attachment node documented in your screenshot is only adding an attachment in the Attachment tab of the bank statement, which therefore can be of any format supported by SAP.


The process of adding those attachments through webservice works globally the same for any object, and is described here: https://blogs.sap.com/2015/10/08/read-and-write-bydesign-attachments-using-web-services/

If your objective is to upload a file in the Incoming Files work center and use the standard SAP mechanisms to translate it from a bank standard (for example MT940 UK, BAI2 US, AFB, etc...) to an SAP object, then this is not covered in SAP standard webservices. On our side, before the "Manage Bank Statements" webservice existed, we had requested our partner to create a webservice for us that allowed to upload files programmatically, so they became visible in the "Incoming Files" work center, and could be processed as if you had done a manual upload.

I hope it's clearer.

Cheers,

FX
ronald_vanherk
Explorer
0 Kudos
Dear François-Xavier,

Thank you for clarifying that. We have seen an custom webservice with another party as well for the incoming files upload.

For now I will look into the oData suggestion of Tobias above using the CompanyPaymentFileRegister object. I saw that @KnutHeusermann also has an example for that in his example set called: Create bank statement as incoming file.

I only do not know if I then can set the file format to CAMT053/ISO20022 using that.

When doing an upload manually of a bankstatement that works well. So if I could automated that then I do not need to extract all the data from a bankstatement to created the correct soap envelop for that.

I will keep you updated here of my progress.
tobias_czech
Explorer
0 Kudos
Hi Ronald,
ISO20022 is a pre-delivered bank statement file format in SAP ByD. So this works as well.
Here is a JSON for the POST request:
{
    "ParentObjectID": "COMPANY UUID",
    "HouseBankUUID": "HOUSEBANK UUID",
    "ContentTypeCode": "1",
    "AttachmentFolder": [
        {
            "CategoryCode": "2",
            "TypeCode": "10001",
            "Title": "BANKSTATEMENT123.TXT}",
            "Name": "BANKSTATEMENT123-NAME.TXT",
            "MimeType": "text/plain",
            "Binary":
        Enter your CAMT053/ISO20022 binary string here
        }
    ]
}
To get right Company UUID and HouseBank UUID for the POST request, you have to query Company Details as well as HouseBank Details upfront. Both can be queried with ODATA as well upfront.
Hope this helps
Regards,
Tobias
ronald_vanherk
Explorer
0 Kudos
Hi Tobias,

Thank you for your reply and confirmation.

I am testing this with Postman and it seems to work fine.

I do have a challenge using our interface language's web client to work with the Post commands as they need to have the cookies from the Get command next to the token to work. I notice that more people have that challenge so I should manage to make this work

Thanks again
tobias_czech
Explorer
0 Kudos
Hi Ronald,

 

you have to fetch the x-csrf-token from a GET command.

Add key x-csrf-token in the Get Header. Once invoked GET request, you can extract the x-csrf-token value from the Get Header Response: (check screenshot)


 

Now add the key x-csrf-token to the POST header. Use the responded token as value.


Regards,

Tobias
ronald_vanherk
Explorer
0 Kudos
Hi Tobias,

Yes, that was what I found to, but I also learned that Postman automatically adds the cookies from the Get session in the headers of the Post request, while other web clients do not do that automatically and then you have to arrange for that. See also this blog post around the same problem I encounter: Issues with CSRF token and how to solve them | SAP Blogs

 
ronald_vanherk
Explorer
0 Kudos
Hi François-Xavier,

I will go with the OData option, see my reply to the post of Tobias above: https://blogs.sap.com/2021/02/10/web-service-for-bank-statements/comment-page-1/#comment-572729
Jay_Bhambhani
Explorer
0 Kudos
Hey Sissi ,

I saw standard web service (ManageBankStatementIn) having the option of inserting bank statements along with the option of adding attachment.
However, my requirement is uploading a bank statement in BAI2 AUS format. I can not see web service having this option of uploading the bank statements. Do you have any alternative solution or recommendation ?
I am trying to automate upload of these bank statements in BAI format (coming from bank).

 

Regards

Jay
SRuthe
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hey Jay,

as mentioned in my blog post the web service ManageBankStatementIn creates a bank statement like the creation of a manual bank statement in the Liquidity Management work center. Therefore, it is independent of the file format such as BAI2 AUS provided by the bank.

Please follow some comments of this blog post for the automation of the existing Bank Statement Upload functionality starting with this comment https://blogs.sap.com/2021/02/10/web-service-for-bank-statements/comment-page-1/#comment-566767.

Best regards,

Sissi