Showing posts with label French accents. Show all posts
Showing posts with label French accents. Show all posts

Apr 11, 2023

Some banks can't deal with characters with accents and special characters, how to remove them with no-code ...

Recently, while doing a banking implementation with a US bank, I run into an issue that never had before. It caught my attention and thought it was worth sharing it because it is quite specific that I am sure it is going to benefit someone.

I was doing payment files testing with a US Bank (a really big one) for my client's US and Canadian operations and because my client also operates in the province of Quebec, Canada (where we also speak French); we run into some particular issue because we have data with French accented characters. 

It is really common in the French language to have accents on people's name, streets and companies too. But this bank's systems where not able to handle and read our files because of this "special characters / strange characters". Many times bank's systems are so antiquated that they are still running mainframe servers that were conceived in the 80's easily. Many of this servers and operating systems do not have the ability to handle some of this characters and even had a complete different code page too. In some of this cases, since we were passing them ASCII files (as per their request), their systems were not interpreting these characters and adding an extra space to the line record. This was making the record longer and therefore failing.

These are some of these "special characters" (Ex, À Á Ã È É Ê Ì Í Ò Ó Ô Ù Ú Û à á â è é ê ì í î ò ó ô ù ú û ).

Now there are 2 different scenarios that I had where I needed to remove this special characters, one without code and another one with.

# 1 - DME file creation (Ex. Electronic Payments, Positive Pay or any type of Banking file)

#2 - Check printing


# 1 - DME file creation

In this scenario we were creating 2 different types of files for this bank, an ASCII Positive Pay file and an XML ISO 20022 payment file. The ASCII one was the one that the bank was not able to process properly. 

In order to remove the 'special characters' on the DME file, you just need to flag one option on the corresponding field and the DME engine will take care of the rest.

Ex. I want to remove the 'special characters' from the Vendor Name (PayeeName1 field in my DME) that is part of the output file.


Select the Field name (Element or Atom) and click on the "Conv.Function" icon. You will get a pop-up like this one (see below).



Here you have a series of options to right justify or left justify your characters. Then on the 2nd part, you have the option "Replace National Chars". This option will allow you to replace these series of "accented" characters by no accented ones by executing a standard FM behind the scenes. (which opens the door to talk about my option #2).


#2 - Check printing

I mentioned that the output file was related to Positive Pay, so in this case, we needed to have a exact match file vs. printed check otherwise the bank was going to reject our checks. So, we also needed to adjust our check forms so that the printed names do not have these accented characters either. 

To do this, we will be using the exact same Function Module that is available in the DME engine, but in this case calling it via code.

FM SCP_REPLACE_STRANGE_CHARS


You can test it here to see the results before incorporating it in your code.


Here you will see how in the Input text I put all sort of accented characters and the FM returned all the same characters but without accents. The same can be executed in your forms or any other Abap program to remove these characters.


Bonus track ...

You can also use program RSCP0155 that has a selection screen where you can play with more sophisticated options like input and output code page and range of Unicode characters. Then this selection screen will end up executing this same FM and returning all the input characters and converted characters for the whole ASCII code. So you can see upfront what your characters will look like after conversion.



Part of this Post is based on OSS Note 
1062237 - Transliteration of characters with SCP_REPLACE_STRANGE_CHARS

(requires a valid SAP Marketplace ID to display the Note) 



If your Company and/or Project needs to implement this, or any of the functionalities described in my Blog, or advise about them, do not hesitate to reach out to me and I will be happy to provide you my services.