SAP CRM | Add timeframes
In CRM you may want to add timeframes, to use them for searching transactions. For example, you want to see activities of the last 12 months. Say, today is 1st of July 2012. Standard SAP has predefined timeframes for last year (which would be 2011), this year (2012) and next year (2013).But there is no timeframe for the last 12 months (July 2011 – July 2012). So this timeframe is not fixed to a year, but to the number of months.
This timeframe was/is also used in the classic WinGui locators of business transactions.
It is possible to add your own timeframes with flexible parameters.
Part 1: Define timeframe
SE16: Table TSCTFGROUP (not defined in SPRO)
Add a new entry. Notice the following:
For APPL_NAME always use value CRM_1O_LOC.
TIMEENTITY and LENGTH support very dynamic logic.
The parameter length defines the length of course, but there are special options:
Adding a timeframe for the last 12 months is defined by
Check the SORT_ORDER field. Add the next free number, or use another free value.
Part 2: Add description to timeframe
Tx: SE16: Table TSCTFGRT (not available in SPRO)
Now we add descriptions. Use the same key fields when adding records.
Be aware, the new entries maintained via SE16 are not transported by standard. You could add them to transports by adding keys in an existing transport request, add object R3TR/TABU for both table names and the corresponding keys.
After this customizing the timeframe is already available.
Part 3: Default timeframe in customer overview (optional)
In the account overview page a couple of transaction overviews are shown (without any visible selection criteria). In the background a timeframe is used to limit the number of results. In customizing you can set the default timeframe for this selection.
(SPRO: CRM > Master data > Businesspartner > Specify display options business transactions)
You can leave the user role (authorization role, not business role) empty for a generic access.
Important: the number of hits in the result list is by default limited to 100 (max_hit). The selection is not sorted upfront. To increase this number of max. hits, use enhancement spot CRM_UIU_BP_ENHANCEMENT and implement a BADI for definitie CRM_BP_UIU_BT. In method IF_CRM_BP_UIU_BT~CHANGE_SELECTION you could implement something like this:
cv_max_hits = 500.
But be aware of any performance impact in case such a long list is retrieved!