Update One Exposure Hub from TRM
This article describes the update of the FQM_FLOW table based on financial deals of the TRM module. We will only consider creating and updating FQM_FLOW records with FLOW_TYPE: 900100 “Incoming Bank Cash (TRM)” and 900101 “Outgoing Bank Cash (TRM)”. These flow types relevant for the liquidity forecast. The table entries FQM_FLOW (with flow type 900100 and 900101) are created based on the flow of financial transactions (table vtbfhapo).
Update FQM_FLOW is performed in the following events:
1. Recording financial transactions (tr. FTR_CREATE).When you save the financial transaction, the system generates a list of records FQM_FLOW. The FQM_FLOW attributes are filled in the FQM_FQM_TRANS_IMP (include) => get_flows.
- Algorithm of filling the main attributes:
- This event occurs when saving a financial deals after performing various operations (create, change, settle, reverse).
- ORIGIN_DOCUMENT_ID. Concatenate Company code and transaction ID or company code and security account and security ID.
- TRANSACTION_DATE. Payment date of the flow (VTBFHAPO-DZTERM).
- CERTAINTY_LEVEL. Filled with the value TRM_D «Financial Instrument» (filling is performed in the method FQM_FQM_TRANS_IMP => construct) for all financial products besides options. For options, the value is TRM_O «Optional Financial Instrument».
- FLOW_TYPE. For flows with a negative amount (outgoing payments), the value is 900101 “Outgoing Bank Cash (TRM)”. Otherwise 900100 “Incoming Bank Cash (TRM)”. This logic is described in the method FQM_FQM_TRANS_IMP (include) => GET_PAYMENT_FLOW_CAT.
- In the BADI BADI_FQM_DERIVE_LQITEM_TRM (method UPDATE_FLOW_TYPE) you can change the default logic filling FLOW_TYPE. For TRM it is impossible to change the logic of filling FLOW_TYPE using the settings.
- HOUSE_BANK and HOUSE_BANK_ACCOUNT. Copied from the settings of the “Payment details” of the financial deal.
- LIQUIDITY_ITEM. First, the system tries to determine the liquidity Item using BADI ES_FQM_DERIVE_LQITEM_TRM (method DERIVE). If after BADI’s liquidity item were not filled, there will be a standard algorithm for determining the liquidity item.This logic is described in the method FQM_FQM_TRANS_IMP (include) => get_complete_flow.
- PLANNING_LEVEL. The planning level is filled in accordance with Table T036V “Allocation of planning levels for Financial Assets Mgmt”. If the flow is filled with your own bank and account in your own bank, the value is taken from the FDLEVSK field. Otherwise, from the field FDLEVPK. This logic is described in the method FQM_FQM_TRANS_IMP (include) => derive_cash_attributes.
- The system first tries to determine the liquidity item based on the queries. If after executing the queries, the liquidity item remained not filled, the system attempts to determine the liquidity item on the basis of assign of GL accounts.
- PLANNING_GROUP. If the cash flow from TRM has no house bank account, the system tries to determine a planning group instead. To do so, it takes the business partner (for example the counterparty in a money market transaction), reads the corresponding customer (from database table CVI_CUST_LINK), and takes the planning group from the corresponding company-code-dependent data (database table KNB1). If no customer exists for this business partner, or if the customer has no planning group assigned to the given company code, the cash flow is updated with an empty planning group. The planning group is then also empty in cash management. This logic is described in the method FQM_FQM_TRANS_IMP (include) => derive_cash_attributes.
- AMOUNT. Payment amount in the payment currency (VTBFHAPO-BZBETR).In case of changing previously created FQM_FLOW records, the system marks them for deletion (FQM_FLOW-DELETED = ‘X’) and instead creates new entries. A deletion flag is performed in the method FQM_TRD_FQM_PROCESSOR_IMP => process_transactions.
In case of changing previously created FQM_FLOW records, the system marks them for deletion (FQM_FLOW-DELETED = ‘X’) and instead creates new entries. A deletion flag is performed in the method FQM_TRD_FQM_PROCESSOR_IMP => process_transactions.
In the method BADI_FQM_FLOW_ADJUST_CORE=>ADJUST_FLOWS possible to change flows before save to the FQM_FLOW.
2. Post flows (tr. TBB1).Setting deletion flag is done in the method FQM_TRD_FQM_PROCESSOR_IMP => process_transactions.
- When flow posts system fill attribute FQM_FLOW-DELETED with the value ‘X’ (for records FQM_FLOW relevant flows TRM).
3. Reversal of flows (tr. TPM10).
- At the moment the reversal FI document (created on the basis of flows TRM) has no effect on FQM_FLOW. I think that’s probably a mistake, because in this case, the system must recover in FQM_FLOW record (previously marked for deletion).
For more information on updating FQM_FLOW based on the TRM can be found in the following sources:
- Help.sap.com: https://uacp2.hana.ondemand.com/doc/0f7c7e573452a96be10000000a4450e5/3.6/en-US/frameset.htm
- Documentation for BADI BADI_FQM_DERIVE_LQITEM_TRM.
Excellent explanation. Thank you for the care in explain it in detail.