Skip to Content
Technical Articles
Author's profile photo Hongjun Qian

Flow Builder Plus: extend standard logic for fetching bank account

Like old Flow Builder, Flow Builder Plus also offer the flexibility to bring customer logic in.


I had written a post for old Flow Builder: ‘Flow Builder: Using exit to fetch HBKID/HKTID for Accounting Documents missed those information‘  which target to fulfill house bank/house bank account in flows for those accounting documents missing such information.

This post, like the old one which I wrote, will do the same. It will also update final flows for fetching house bank/house bank accounting from GL master data if the flows without bank account.

In old Flow Builder, the customer need create their own AMDP based class, and re-generate loading class for Flow Builder before the logic could be used.

In Flow Builder Plus, the whole process is simplified. What you need to do is, implement a BAdI implementation. And Flow Builder Plus support two BAdI with its initial release:

  • FCLM_FB2_EXT. This new BAdI consists of five methods for customer to control the Flow Builder Plus chain tracing logic. This post won’t cover that part.
  • BADI_FQM_FLOW_ADJUST_CORE. This BAdI isn’t new to SAP Cash management user as it has been used for other source applications already, like SD, BS, TRM, etc.
    • ADJUST_FLOW. The only method in this BAdI interface which will be called before the flows are saved to database. This method takes only one CHANGING parameter CT_FLOWS.


New steps for Flow Builder Plus are:

  • Step 1. Create a new implementation for BAdI BADI_FQM_FLOW_ADJUST_CORE.



You need maintain the filter values for your BAdI, as this BAdI was commonly used in One Exposure. Flow Builder Plus using ‘BSEGV’ (same source application as the flows).


BAdI Filter

  • Step 2. Implement the logic.

Unlike old Flow Builder, the BAdI implementation logic is purely ABAP.

Method ADJUST_FLOW accepts only one CHANGING parameter ct_flows. This table will be fulfilled with the flows where Flow Builder Plus generated,

An sample code as following:

  METHOD if_fqm_flow_enhancements_core~adjust_flows.
    LOOP AT ct_flows ASSIGNING FIELD-SYMBOL(<fs_flow>)
      WHERE house_bank IS INITIAL OR house_bank_account IS INITIAL OR bank_account_id IS INITIAL.
        " Fulfill the bank account from GL
        SELECT SINGLE HouseBank, HouseBankAccount FROM I_GLAccountInCompanyCode
            WHERE GLAccount = @<fs_flow>-fi_account AND CompanyCode = @<fs_flow>-company_code
            INTO @DATA(ls_glaccount).
        IF sy-subrc EQ 0 AND ls_glaccount IS NOT INITIAL.
          <fs_flow>-house_bank = ls_glaccount-HouseBank.
          <fs_flow>-house_bank_account = ls_glaccount-HouseBankAccount.

        " Recalculate the Bank Account.
        IF <fs_flow>-house_bank IS NOT INITIAL AND <fs_flow>-house_bank_account IS NOT INITIAL.
           SELECT SINGLE *
             FROM i_bankaccountlinkage as a
             WHERE a~companycode = @<fs_flow>-company_code AND a~housebank = @<fs_flow>-house_bank
               AND a~housebankaccount = @<fs_flow>-house_bank_account
               AND a~validitystartdate <= @<fs_flow>-transaction_date AND a~validityenddate >= @<fs_flow>-transaction_date
              INTO @DATA(ls_t012k).
          IF sy-subrc EQ 0 AND ls_t012k IS NOT INITIAL AND ls_t012k-bankaccountinternalid <> <fs_flow>-bank_account_id.
              <fs_flow>-bank_account_id = ls_t012k-bankaccountinternalid.
  • Step 3. Activate you codes and BAdI implementation.

Activate your codes and the BAdI implementation, you can have a try directly with Flow Builder Plus. And Flow Builder Plus shall call your logic as you wished.


* Please be aware that the information in this post is purely for OP releases.




Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Ravi Gunti
      Ravi Gunti

      Hi Hongjun Qian,


      Can the same solution be applied when using Flow builder lite?

      Author's profile photo Jack Reynolds
      Jack Reynolds

      Hi Hongjun Qian ,

      Thanks again for a very useful blog, this solutions works fine for G/L postings!

      I have a similar question regarding AP & AR postings are deriving house bank and house bank accounts for those flows in CM.

      As standard, AP & AR postings (e.g. vendor & customer invoices/credit memos) do not have direct assignment to a bank account, they appear as "Unassigned" in the Cash Flow Analyzer.

      This also means that these flows don't appear in the Short-Term Cash Positioning (STCP) app because this app only displays flows that are linked to a bank account.

      Therefore, to get the AP&AR forecasted flows into the STCP reporting, a bank account needs to be assigned to those flows in FQM_FLOW.

      This must be a need and requirement for most customers so I was wondering if you have a proposal or suggestion for how to do this?  Do you expect this to be a customer specific solution also implemented using BAdI BADI_FQM_FLOW_ADJUST_CORE?

      Many thanks,


      Author's profile photo Hongjun Qian
      Hongjun Qian
      Blog Post Author

      Hi Jack,

      Frankly speaking, there is no standard solution for this case though we received similar requirement already.

      However, there are several non-standard approaches in my mind, which approach you prefer?

      • Approach 1 (Enhance App): STCP shows a dummy node for all those flows without bank account?
      • Approach 2 (Enhance Storage): Define a dummy bank account, where you can assign all flows without bank account with this dummy bank account.

      Thank you.

      Best regards, Hongjun


      Author's profile photo Jack Reynolds
      Jack Reynolds

      Hi Hongjun Qian,

      I was thinking that the best way would be to derive the bank account on the flows in FQM_FLOW because this would work for both Cash Flow Analyzer (CFA) and Short-Term Cash Positioning (STCP). Do you have any experience or advice for doing this?

      But I can also see an advantage of being able to displaying unassigned flows in STCP so users have the visibility and can decide what to include/exclude using the "Cash Position Profiles".

      For example, add option in Cash Position Profiles to include or exclude unassigned flows.  And then if unassigned flows are to be included, they could be displayed as shown in the screenshot below as an unassigned node at the bank account level.




      Unassigned in STCP

      Author's profile photo Hongjun Qian
      Hongjun Qian
      Blog Post Author

      Hi Jack,

      The experience or advice to derive house bank is the major purpose of this blog. I think STCP is focus on the positioning therefore it skips the flows without bank account information by design.

      Thank you for the inputs.

      Best regards, Hongjun



      Author's profile photo Jack Reynolds
      Jack Reynolds

      Hi Hongjun Qian ,

      This blog only talks about deriving the house bank from G/L account master data.  The real challenge and value comes from deriving the correct bank account for AP & AR flows.

      And regarding STCP, I struggle to see how there can be an accurate cash position if AP & AR flows are not included.

      For example, the business needs to see AR open items in the STCP app to see how much cash is expected to be received into the bank accounts from incoming customer payments.


      Author's profile photo Ravi Ramamurthy
      Ravi Ramamurthy


      This is a very good discussion - in fact this has been a requirement for many customers in CFA as well to derive house bank account for AP/AR.  Traditionally (and the current way) is to derive the house bank and account ID on the account document itself through a substitution or FI-enhancement (we can default house bank on the customer/vendor master and during posting of invoices derive the account ID through a substitution or enhancement).  This generally works for simpler treasury setup - however if there are complex treasury setup like central paying entity or pay in the name of scenarios etc. - then the actual paying house bank itself is in a different company code all together.   For these instances, we did use a BADi in flow builder and had a custom table (currency or payment method etc.) to derive the house bank in FQM_FLOW for AP/AR invoices.



      Author's profile photo Hemalatha Loganathan
      Hemalatha Loganathan

      Hi Hongjun Qian,

      May I know how the housebank and housebank accout IDs are fectched in this standard program FCLM_FLOW_BUILDER_2, when no house bank is maintained in BSEG table.

      We see some random bank account getting populated in FQM_FLOW table when running Cash position/Liquidity analysis .

      Could you please show light on how the standard process works on fetching house bank/house bank acccount when data is not available in BSEG table.