cancel
Showing results for 
Search instead for 
Did you mean: 

SAP S4 Hana Advanced Bank Statement rules - Document Number Search

fcousin
Explorer
0 Kudos
1,880

Hi,

We recently implemented the S4 Hana Advanced Bank Statements Reprocessing tool.
We are basically using the Fiori apps "Manage Bank Statements", "Reprocess Bank Statement Items" and "Manage Processing Rules".
We are having problems with rules not working and activating simple rules such as using the document number in the Note to Payee to clear an open item. We've defined a processing instruction using the Interpretation algorithm 20 "Document Number Search" but that does not seem to work. 
We have also tried to set break points in the classes CL_FAR_FEB_ALGORITHMS and CL_FAR_FEB_OPEN_ITEM_FINDER but those do not get triggered.
Anybody can help figuring out why that rule/algorithm does not kick in in the Advanced Bank statement processing app?
Thanks,
Fred

Accepted Solutions (1)

Accepted Solutions (1)

Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

 

first of all, have you double checked in the app Reprocess Bank Statement Items, by navigating into those items which did not clear any invoices. What the application log says? (You navigate into it and switch in the tab section to "Log", just to make sure that the rule conditions really match the processing rules)

 

If you find a message that it matches the rule then of course debugging would be the next step. For that though I would set the break point at the class CL_FAR_BS_ITM_REPROC_DPC_EXT in the method EXECUTE_BS_POSTING_PROPOSAL.

That method is basically always the starting point for any rule which has been applied to a bank statement item. There should be a method named find_open_items -> this is where we search for open items. This class and this method though have been changed over time so I cannot tell at which release you are and where you find this method.

You got two options how to debug this. The easiest option would be to use the Reprocess Bank Statement Items app. You navigate into that item which was not set to completed with the document reference in the memoline. You set the breakpoint first in the class: CL_FAR_BS_ITM_REPROC_DPC_EXT in the method: FIND_OPEN_ITEMS (in case you do not reach that break point try to set a breakpoint in /IWBEP/IF_MGW_APPL_SRV_RUNTIME~EXECUTE_ACTION this method is basically the starting point for any call on the reprocess bank statement items app).

Now when you set up the break point you are good to go. Simply go to the Reprocess Bank Statement Items app and navigate to that item, open it and select the algorithm which you want to use in the "Processing Instruction" field and click on the button "Allocate Open Items". (see attached screenshot) Now you should reach the break point. 

 

 

The other way to debug this is a more technical way. What I do is: I create a copy from the automated rule. Then my user has the the same rule as a manual rule. Now you can see in the URL the UUID of this processing rule (in the URL you should find something like "....C_ARPostingRule(PostingRuleUUID=guid'<UUID>....". Save this because you'll need it later. Now write down that bank statement item which has not been posted. What you need is basically the bank statement short ID and the bank statement item (number).

The bank statement short ID is the value which is saved in the database table FEBEP it's the field KUKEY. You can also find this by simply navigating in the app Reprocess Bank Statement Item and check the URL you should file something similar like this: ".....BankStatement-reprocessItems?sap-ui-tech-hint=UI5&/2475/5....."

Here the 2475 is the short ID and the 5 is basically telling us that his is the fifth item of that bank statement (field ESNUM on table FEBEP). Of course you could also just add these columns on the list report view and you do not need to navigate into the item but if you check the log anyway as I proposed you can do this in one step.

Now go to the backend and execute the following report: rfar_bs_apply_rule.

Here you are asked now to enter the UUID of your manual rule, just enter it without the dashes in between so change it from 563243-GLASD23-DSFF233... to 563243GLASD23DSFF233....

and in the concatenated BS Item Key field you enter your short id and bank statement item number by also adding the leading zeros, so in my example 2475/5 that would be changed to: 00002475/00005

 

The short ID has a length of 8 and the statement item number of 5.

You have to check that you find the right spot in the coding where the posting is parallelized to increase performance. As already mentioned we have developed over the past years and extended and changed the coding but you should find it.

 

Hope I could help you.

 

Best,

Edrilan Berisha 

SAP S/4HANA Cloud Financials Development

fcousin
Explorer
0 Kudos
Thanks a lot Edrilan!
fcousin
Explorer
0 Kudos
I have done more research and debugging and it appears that S4 Hana only allows rules with an Interpretation Algorithm starting with a "4" to be executed on the Reprocessing Screen.
Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Fred, on which S/4HANA release are you currently? We are currently working on providing a feature in the future, where the end user are able to configure their own algorithm within our Processing Rules app. So you could define if you want to search for XBELNR, BELNR, DME Reference etc. So I hope you can somehow manage to upgrade to the latest version. Just try to keep a look on the What's New section. We will announce it once we have finished the implementation and the testing. Best, Edrilan
fcousin
Explorer
0 Kudos
Thank you Edrilan,
fcousin
Explorer
0 Kudos
We are on version S4 HANA 2022 (Initial stack) and are planning on going to 2023 at the end of the month. Can any Interpretation algorithm be used in Processing instructions to be used in rules? I am trying to define a simple rule to clear an open item on a G/L account by using Interpretation Algorithm 20 but that doesn't seem to work. Any idea? Thanks. Fred
Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Fred, have you tried it with interpretation algorithm 021? I think that should be what you are looking for. If that does not work: basically once you upgraded to OP2023 you should be able to even create any kind of algorithm you want by using our EXECUTE_ALGORITHM BAdI and implementing any logic you want. Let me know if this would be sufficient. Best, Edrilan
Edrilan_Berisha
Product and Topic Expert
Product and Topic Expert
0 Kudos
You find more information here: https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/3cb1182b4a184bdd93f8d62e3f1f0741/e06a7925f954416793c... on the bottom there is a section for the BAdI
fcousin
Explorer
0 Kudos
Thanks you Edrilan.
fcousin
Explorer
0 Kudos
I was trying to use the standard Processing Instructions without having to implement Badi's. I tried algorithm 020 "Document Number Search" but that doesn't work. Algorithm 021 seems to be for a Reference Document Search. Would you know which program/class/function contains the algorithms code? I would like to check what is behind 020 and 060. Are all algorithms useable in the Advanced Bank Statements Processing Rules? Thanks a lot. Fred

Answers (0)