Show TOC

Define Search String for Electronic Bank Statement

When importing an electronic bank statement, the system identifies the business transactions and uses the settings you have already made to determine how each should be recorded. In most cases, the system uses the document number entered in the "note to payee" lines of the bank statement to determine the appropriate clearing transaction. For example, a cash receipt clears customer open items.

The information in the note to payee may be incomplete - for example, the first characters in the document number may be cut off or new characters may be added. The interpretation algorithm then reaches the limits and cannot find the appropriate document numbers. This means the document cannot be cleared and you must post- process the transactions manually.

In addition to the search for clearing information, you can use the the search string to fill other fields (such as the cost center or posting rule, depending on the content of the note to payee.

It is the "Target Field" which determined which field is filled in each case. The target field in the bank data store indicates to where the result of the search is written. The target field must always be the note to payee when you are searching for clearing information (document number, reference document number. (Unlike other fields, it is not necessary to repeatedly change the note to payee field - the information in it is temporarily "enriched" while the intepretation algorithm is running.) The explanations and examples that follow all refer to the search for clearing information (meaning that the note to payee is the target field), but they can also be applied to most other fields (such as "Cost Center"; see the section on "Other Target Fields").

To increase the number of hits in the document number search, you can use this step to define strings for the search. The system uses this string to conduct the search before the interpretation algorithm comes into effect.

Having defined the search string, you must then define "mapping". Mapping is used, for example, to eliminate characters that customers have added to document numbers.
To illustrate which sign in the search string is assigned to which character in mapping, the example which follows gives vertical representations of the search strings and associated mapping. See the end of this section for definitions of some special characters. These characters cannot be entered in mapping.
In the example, the symbol "#" means any figure between 0 and 9. A blank in mapping causes the system to delete the respective item.
Example:
Search string Mapping
...
# -> #
. -> (Blank in mapping: '.' eliminate)
# -> #
# -> #
# -> #
...
So: you can assign a different character to each character in the search string (example: a blank to a period). If you are recreating a search string, the system first defaults the unchanged search string as mapping. You can then change the characters as you wish.
You can test the search strin in the detail screen for search string definition. To this end, enter any chain of characters you like, as it could appear in the "Note to payee" field in the bank statement, and choose Test . The system displays the search result.
You can define as many strings as you like per bank account and interpretation algorithm.
In addition, you can also enter a mapping basis and select the ID flag .

Notes

Example: A string with no start and finishe characteristics is called "###". The number in the note to payee in the bank statement is 12345678. The sting search then finds no fewer than six hits in the note to payee, namely: 123, 234, 345, 456, 567, 678. This is not usually desirable because it may lead to a defective selection of items if the matching document numbers actually exist in the system.

Special Characters in Search Strings

Character Definition Example
| or a|b finds a or b
() Group c(ac|b)d finds cacd or cbd
+ Repetition (ab)+ finds, for example, ab or ababababab
* Repetition ab* finds a or ab or abbbbbbb
? Wild card a?b finds aQb or a1b
# Figures 0-9
\ Escape character \#\#\# finds ### and not,for example,
123 (looks for special characters)
^ Start of line
$ End of line

Special Characters in Mapping

Character Definition Example
' ' Blank Character is eliminated.
/ Slash See under Example 2

Example

Example 1

You enter search string (^| )###( |$) with Mapping ###.

The system searches for a document number which starts at the beginning of the line or with a blank, then has three figures and ends with a bland or at the end of the line.

You enter 18000000 as the mapping basis.

The system replaces the last three characters of the basis with 123 so that the searchy result is 18000123. The sysytem looks for document 18000123 to clear the open items.

Example 2

You specify search string (^| )#####/###/###( |$) with mapping #####/###/###.

The system searches for a document number consisting of five figures followed by two sets of three figures, all the sets being separated by "/". (Example: 80429/234/123). The "/" is of special significance in mapping: the chain of charactes is not interpreted as one document number, but as three. The three strings of charactes are separated and the last three in the first string replace by strings 2 and 3 respectively, giving three document numbers in the search result: 80429, 80234, and 80123. If you defined a mapping basis, it is now applied to the three numbers to bring them up to the number of characters required for the document number.

The system verifies that the first number is at least as long as the following. If it is shorter, the hit is rejected. No replacement is made.

You can also search for any other character used to separate document number in your bank statements. The character in question must be in the search string.

More Search String Examples

Search String Mapping Description
(^|)### ####($| ) ### #### 7 characters, blank at position 4
(^|)#(.|)######($| ) # ###### 7 characters, period/blank at pos.2
(|^)##############( |$) ####### 14 char. number, take first 7
(|^)############( |$) #### 12-char., take last 4
(|^)#+(/#+)+( |$) #/# Sequence, separated by slash

Activities

Defining and Simulating Strings

Define string

1. Double click in the tree Search string definition.
2. Choose "New entries".
3. Enter a search string name (example: STRING1), a description ("Five digit document number") and a search string (example: (^| )###.##( |$)),then choose Enter.
4. In the Mapping area, assign a character to each character in your string.
The system proposes the unchanged search string as initial mapping. Change the characters as you want.

Test the string

5. In the Test area, enter a text under Input text. The text must included the document number as it would appear in the electronic bank statement. Then choose Test.
You then see the document number the system uses to find document so that it can post the business transaction in the system. (Any mapping basis you may have entered in addition is ignored in this test.)

Assign Search String to Interpretation Algorithm

6. Go back and double click in the tree Note-to-payee search string
7. Choose New entries.
8. Enter the company code, house bank, account, interpretation algorithm, and a name for the string.
If you leave all or one of the fields Company code, House bank, or Account , the system uses the specified search string to search in all company codes, house banks, and/or accounts.
9. If you want to use the string in the document number search, select Active and "Note to Payee" as the target field.
10. Enter a mapping basis if required. Select the ID indicator if required.

Other Target Fields

Cost Center

If the search string is "6227747474 ???? TELECOM" with mapping "1000" and the character string "6227747474 03 98 TELECOM" appears in the note to payee, "1000" is always entered in the cost center field.

Expenses in Account Currency

You can use this target field if you want to have the system automatically adopt fee information contained in the note to payee field and use it in the posting. A prerequisite for this is usually that the appropriate fee amount is always flagged with a unique key word (such as "Bank Charges"). In this case, you could use, for example, a search string of type Bank Charges: *#+,##" with mapping " # .##" . Note that you must use a period, not a comma, as the decimal point.

BDC Fields

The BDC fields are a means of filling screen fields if there is no suitable target field in the bank data store. You must know the technical name of the relevant screen field (if you do not know it, use the F1 help to find it out).

For example, if you want to transfer a control indicator in the event that the key word "TELECOM" appears in the note to payee, you can proceed as follows:

Use the search string TELECOM with mapping " " (all blanks) for the three target fields "BDC Field Value 1", "BDC Field Name 1" and "BDC Account Type 1". The constants to be entered in the individual BDC fields are always stored in the "Mapping Basis" field:

BDC Field Value 1 = "V1"

BDC Field Name 1 = "BSEG-MWSKZ"

BDC Account Type 1 = "0"

If you want to transfer the content of only one particular line, you can use the "BDC Account Type" field to control the process. If you enter the constants 0, 1, 2, or 3 in this field, the transfer only takes place as specified. The constants here mean the following:

0: First line, posting area 1

1: First line, posting area 2

2: Second line, posting area 1

3: Second line, posting area 2

If you do not control the transfer in this way, the system tries to transfer the screen field defined under "Field Name" in all the posting lines in posting areas 1 and 2. This cause an error on the grounds that the field does not exist (for example, because a control indicator for a particular account does not accept input.

In the control indicator example, note that you must set the "Calculate Tax" indicator too, so that the posting can be made automatically. You then need the following settings in addition:

BDC Field Name 2 = "BKPF-XMWST"

BDC Field Value 2 = "X"

BDC Account Type 2 = "0"

Further Notes

For more information on the electronic bank statement, go to the SAP Libary and choose Financial Accounting -> Bank Accounting -> FI - Electronic Bank Statement.