Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Hongjun_Qian
Product and Topic Expert
Product and Topic Expert
One Exposure is the central storage which targets to all actual and forecast operational business transactions, it plays as the single source of truth for all financial risks from operations. The SAP Cash Management are using One Exposure as it’s storage for the apps.

Bank Statement is one of most used source application in One Exposure. The traditional use scenario is that:

  1. The relevant bank statement flows (FQM flows with source application 'BS') generated when importing bank statement;

  2. When posting and clearing bank statement items, the accounting document posted;

  3. The relevant FI flows (FQM flows with source application 'BSEGV') generated, and the relevant bank statement flows will be deleted.


It is also quite common for the customer to archive bank statement (table FEBKO, table FEBKO, and so on). Normally there won't be bank statement flows for those archived bank statement. The reasons behind could be quite complexity, such as relevant FI document failed to build flow, the logic detect between bank statement with FI documents are not solid.

This blog just targets to bring you the facts that how many bank statement flows exist without bank statement.

The following codes ship the logic to perform such check:
*&---------------------------------------------------------------------*
*& Report ZAC_FLOWBUILDER_DELBSFLOWS
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZAC_FLOWBUILDER_DELBSFLOWS.

PARAMETERS:
p_bukrs type bukrs.

START-OF-SELECTION.

SELECT DISTINCT origin_document_id from FQM_FLOW
into table @data(lt_bsflows)
where company_code = @p_bukrs
and DELETED = ''
and origin_application = 'BS'.

data lt_febko type table of febko.
data lv_kukey type KUKEY_EB.

LOOP AT lt_bsflows ASSIGNING FIELD-SYMBOL(<fs_bsflow>).
move <fs_bsflow> to lv_kukey.
select single * from febko
into @data(ls_febko)
where kukey = @lv_kukey.
if sy-subrc ne 0.
append INITIAL LINE TO lt_febko ASSIGNING FIELD-SYMBOL(<fs_febko>).
<fs_febko>-kukey = <fs_bsflow>.
endif.
ENDLOOP.

IF lines( lt_febko ) > 0.
WRITE 'FQM flows but bank statement not exist: '.
loop at lt_febko ASSIGNING <fs_febko>.
NEW-LINE.
write <fs_febko>-kukey.
endloop.
ENDIF.

To run it, copy the code into your own program, and execute it:



After executed, it find out several flows: