Uploading the Federal Reserve E-Payments Routing File into SAP
Enterprises running SAP frequently need to update bank routing numbers in FI-BL to ensure their customers and vendors are using valid bank accounts. Traditionally, this could be done in transaction BAUP if the file were formatted as a Thompson Electronic Payment File. However, many SAP clients receive periodic routing number files directly from the Federal Reserve or a licensed vendor. The file format from the Federal Reserve is quite different. Rather than creating a custom program, you can still use transaction BAUP by following these steps:
- Ensure that you have read and understand the latest file layout from the Federal Reserve’s website (http://www.fededirectory.frb.org/format_ACH.cfm).
- Copy function module FILL_BNKA_FIELDS_US1 to a custom function module called ZFILL_BNKA_FIELDS_USF.
- Delete the code in ZFILL_BNKA_FIELDS_USF and replace with the following:
FUNCTION ZFILL_BNKA_FIELDS_USF.
*”———————————————————————-
*”*”Local Interface:
*” IMPORTING
*” VALUE(I_BANKS) LIKE BNKA-BANKS
*” VALUE(I_VERS) LIKE T005BU-VERS
*” VALUE(I_XPC) LIKE RF02B-BANKXFPR
*” VALUE(I_MAX_REC) LIKE RFPDO_BF-MAX_REC
*” EXPORTING
*” VALUE(CNT_SREADTO) LIKE RF02B-COUNTER
*” TABLES
*” ITAB_BNKA STRUCTURE BNKA
*” TAB_FILE STRUCTURE RLGRAP
*”———————————————————————-
DATA: LS_BNKA TYPE BNKA,
LS_BNKA_NEW TYPE BNKA,
BEGIN OF file_all OCCURS 0, “DEFINE AN OPEN CONTAINER TO PLACE THE RAW DATA
all(1851) TYPE c,
END OF file_all,
BEGIN OF FED_STRUCTURE OCCURS 0, “DEFINE THE FEDERAL RESERVE STRUCTURE
ROUTING_NUMBER TYPE C LENGTH 9,
OFFICE_CODE TYPE C LENGTH 1, “THERE IS NOWHERE TO PUT THIS IN BNKA
SERVICING_FRB_NUMBER TYPE C LENGTH 9,
RECORD_TYPE_CODE TYPE C LENGTH 1, “THERE IS NOWHERE TO PUT THIS IN BNKA
CHANGE_DATE TYPE C LENGTH 6, “THERE IS NOWHERE TO PUT THIS IN BNKA
NEW_ROUTING_NUMBER TYPE C LENGTH 9,
CUSTOMER_NAME TYPE C LENGTH 36,
ADDRESS TYPE C LENGTH 36,
CITY TYPE C LENGTH 20,
STATE_CODE TYPE C LENGTH 2,
ZIPCODE TYPE C LENGTH 5,
ZIPCODE_EXTENSION TYPE C LENGTH 4,
TELEPHONE_AREA_CODE TYPE C LENGTH 3,
TELEPHONE_PREFIX_NUMBER TYPE C LENGTH 3,
TELEPHONE_SUFFIX_NUMBER TYPE C LENGTH 4,
INSTITUTION_STATUS_CODE TYPE C LENGTH 1, “THERE IS NOWHERE TO PUT THIS IN BNKA
DATA_VIEW_CODE TYPE C LENGTH 1, “THERE IS NOWHERE TO PUT THIS IN BNKA
FILLER TYPE C LENGTH 5,
END OF FED_STRUCTURE.
CALL FUNCTION ‘UPLOAD_FILES’ “********* Upload datafile *****************************
EXPORTING
i_filetype = ‘ASC’
i_xpc = i_xpc
TABLES
file_all = file_all
tab_file = tab_file
EXCEPTIONS
error_file = 1
OTHERS = 2.
IF sy–subrc <> 0.
MESSAGE ID sy–msgid TYPE sy–msgty NUMBER sy–msgno WITH sy–msgv1 sy–msgv2 sy–msgv3 sy–msgv4.
ENDIF.
FED_STRUCTURE[] = file_all[].
SORT FED_STRUCTURE BY ROUTING_NUMBER.
LOOP AT FED_STRUCTURE.
CLEAR: LS_BNKA, LS_BNKA_NEW.
CNT_SREADTO = CNT_SREADTO + 1. “counter of total records
IF i_max_rec NE 99999 AND CNT_SREADTO GT i_max_rec. “Exit loop if number of record greater than MAX_REC
CNT_SREADTO = CNT_SREADTO – 1.
EXIT.
ENDIF.
READ TABLE ITAB_BNKA WITH KEY BANKL = FED_STRUCTURE–ROUTING_NUMBER. “* Just one bank with the same Routing Number
CHECK SY–SUBRC NE 0.
LS_BNKA–BANKL = FED_STRUCTURE–ROUTING_NUMBER.
LS_BNKA–BNKLZ = FED_STRUCTURE–SERVICING_FRB_NUMBER.
LS_BNKA–BANKA = FED_STRUCTURE–CUSTOMER_NAME.
LS_BNKA–STRAS = FED_STRUCTURE–ADDRESS.
CONCATENATE FED_STRUCTURE–ZIPCODE FED_STRUCTURE–CITY INTO LS_BNKA–ORT01 SEPARATED BY SPACE.
LS_BNKA–PROVZ = FED_STRUCTURE–STATE_CODE.
IF FED_STRUCTURE-NEW_ROUTING_NUMBER <> ‘000000000’. “IF THE CURRENT ROUTING NUMBER IS BEING CHANGED TO A NEW ROUTING NUMBER
* LS_BNKA-LOEVM = ‘X’. “SET THE DELETION INDICATOR FOR THE CURRENT ROUTING NUMBER
MOVE-CORRESPONDING LS_BNKA TO LS_BNKA_NEW.
LS_BNKA_NEW–BANKL = FED_STRUCTURE–NEW_ROUTING_NUMBER.
APPEND LS_BNKA_NEW TO ITAB_BNKA.
ENDIF.
APPEND LS_BNKA TO ITAB_BNKA.
ENDLOOP.
ENDFUNCTION.
4. In the IMG (transaction SPRO), navigate to Cross-Application Components > Bank Directory > Bank Directory Data Transfer > Define File Formats for Country-Specific Bank Directories add the following entry:
Now you can select this file format in transaction BAUP and load the Federal Reserve file with no issues.
Jon Gilman is the founder of Clear Software, a company focused on providing highly intuitive, cloud-based accounting applications that transform traditional back-office processes into an efficient and enjoyable user experience. Their main product is ClearUI, a cloud application that exposes SAP’s Contract Accounting (FI-CA) functionality in a simple and easy-to-use format. It is seamlessly integrated with SAP’s industry solutions for high volume billing including insurance (FS-CD), public sector (PS-CD), utilities (IS-U), and media (RM-CA). For more information, visit www.clearsoftware.com.
Works perfectly, thanks for sharing.