SAP Function RM_RH_BUFFER_RULE_FOR_CR - Structure of Rule Buffer with Historical Exchange Rate Changes

Parameter Reference Type Length Default Optional Text
AKTDAT D D 8
KURSTYP ATSYC-KURSTM C 4
REGELTYP JBRREG-REGELTYP N 2
W_HSDEF JBRIHSDEF u 46

Parameter Reference Length Optional Text
T_JBRRHBLT TVRM_BLTTAB 0

Functionality
Filling the rule buffer with historical shift factors for bid rates andask rates separately. To do this the FORM routine GET_HISTORY_FOR_CR iscalled and this implements the following algorithms:
A historical "shift factor vector" is set up for all end nodes of therisk hierarchy with the relevant currency pair (indicated by the nodeID). The calculation basis for the shift factor for the i-th componentsof this vector is the reference date (current) and the reference dateminus the holding period (predecessor). The current vector index refersto the current date.
The shift factor is the quotient of the exchange rate for the currentdate (more recent date) and the predecessor date (date further in thepast), that is the reference date minus the holding period.
The rule ID describes only one shift factor and is made up of the nodeID for the relevant end node and the relevant component for thehistorical shift factor vector.
Sample indexing for the shift vector, assumption: trade date = calendardate.
Index Shift factor for holding period = n > 0 trade dates-----------------------------------------------------------------------
1 Rate(today) / Rate(today - n)
2 Rate(today - 1) / Rate(today - n - 1)
i Rate(today - i +1) / Rate(today - n - i +1)
Structure of risk factor levels:
To continue processing the function module you have to select the nodesfor which net present value routines have to be called (rule filter).
The "risk factor level" is calculated for the node selection. The riskfactor level of a node is defined as the number of direct subordinates(successor nodes) that are either a relevant risk factor themselves, orare direct or indirect superordinates (predecessor nodes) of at leastone relevant risk factor.
Another function module (TV_FILL_HISTORY_RULES) uses this information todraw up a list or rules for which the net present value calculator iscalled.
Algorithms to calculate the risk factor level:
An increment is set to one. Starting from the end node for the currencypair and continuing to the market risk level an increment is added tothe risk factor level for each node and the system checks whether thelevel is > 1 (in other words that the node is already contained inanother path). The increment is then set to zero.