TRM RAPI
If you want to create new TRM report according your requirements and standart reports are no use for you, even SAP Query reports can not help you and you don’t want/can not use Logical databases with LDB_PROCESS function module – there is another option: RAPI.
RAPI stands for Reporting API. Although it’s called API, actually it is a set of function modules. And all there modules are contained in in function group FTI_LDB_RAPI.
RAPI are based on the same selection algorithms as logical databases of TRM and it makes it very easy to work with!
List of function modules (list from EHP7, in earlier versions some modules might be absent):
- Transaction management data:
- FTI_LDB_GET_OTC_DEAL1_DATA OTC Single Transaction Reporting – Main Data + Flows
- FTI_LDB_GET_OTC_DEAL2_DATA OTC Single Transaction Reporting – Main Data Incl. Risk Figures + Flows
- FTI_LDB_GET_SECURITY_DEAL1 Single Transaction Reporting for Securities/Futures
- FTI_LDB_GET_SWAP_DETAILS Swap Details
- Position management:
- FTI_LDB_GET_POS_DATA TRL Single Position Reporting
- FTI_LDB_GET_POS_DATA_BY_UID Position Data using Position-GUID
- FTI_LDB_GET_SUBPOS_DATA_BY_UID SubPosition Data using SubPosition-GUID
- FTI_LDB_GET_LOAN_DATA Loan Reporting Position
- Hedge management:
- FTI_LDB_GET_HM_DATA_GENERAL Hedge Management – Generic Data Access
- FTI_LDB_GET_HM_DATA_BY_HEDGE Hedge Management – Hedging Relationship Single Access
- FTI_LDB_GET_THX_DATA_BY_HREL Hedge Management for FAM – Hedging Relationship Single Access
From function module description you can understand what data is selected.
The main selection parameters are Financial Transaction, Company code and Key data. If you don’t specify key data – system date will be used.
The other parameters is easy to understand.
Example:
REPORT zfti_ldb_rapi_example.
PARAMETERS p_bukrs TYPE bukrs.
PARAMETERS p_deal TYPE tb_rfha.
DATA: ls_deal_attr LIKE fti_ldb_tr_otc_deal_1,
lt_deal_flow TYPE fti_ldb_tr_deal_flows_t,
ls_err TYPE bapierr_t.
CALL FUNCTION 'FTI_LDB_GET_OTC_DEAL1_DATA'
EXPORTING
i_bukrs = p_bukrs
i_rfha = p_deal
i_flag_only_active_deal = 'X'
* I_FLAG_ONLY_EFFECTIVE_DEAL =
i_flag_with_flows = 'X'
* I_DATE =
IMPORTING
e_otc_deal1_attributes = ls_deal_attr
e_otc_deal1_flows = lt_deal_flow
e_error = ls_err
EXCEPTIONS
not_found = 1
duplicate_deal_entries = 2
deal_not_active = 3
no_otc_deal = 4
otc_deal_not_in_lifetime = 5
unspecified_selection_error = 6
OTHERS = 7
.
BREAK-POINT. "Check data ls_deal_attr and lt_deal_flow
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.