SAP CRM | Add timeframes

Introduction

 

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.

 

TIMEENTITY

Explanation

D

Day

W

Week

M

Month

Y

Year

MN

Named Month

YD/MD/WD

The same day in another period (year, month, week)

+/*

Time entities D, W, M and Y can be used together with a ‘+’ or ‘*’.

Examples:

Y+= Only ‘this’ year

W*= Weeks in the past and weeks in the future

 
  

 

The parameter length defines the length of course, but there are special options:

 

LENGTH

Explanation

1 to 999

-1 to -99

The number of periods. When a minus is set at the beginning, it means in the past.

A

Active (‘this’) period

I

Infinite towards the future

I-

Infinite towards the past

E

Till the end of

(space)01 to (space)12

In combination with timeunit MN the month is defined by the number. (‘ 08’ is August for example)

 
  

 

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.

Table: CRMT_ACC_1O_CUST

(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:

 

method IF_CRM_BP_UIU_BT~CHANGE_SELECTION.
cv_max_hits = 500.
endmethod.

 

But be aware of any performance impact in case such a long list is retrieved!

Delen
Share on LinkedInTweet about this on TwitterShare on Facebook
Top