Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata


The purpose of this page is to clarify the understanding of the new functionality Relative Dates in Advanced Search and how to enable it. We will also list all common issues and related KBAs in this WIKI page to help you to resolve the relevant issues.


This Relative Dates new functionality is provided from CRM7.0 Ehp1. In transactions such as opportunities, quotes, orders, etc., the date fields in the Advanced Search criteria will support fixed values in the drop down list such as the Next 5 days, Next 30 days and The 7 previous days. The relative dates values section will only be visible and work for selection if the operator value is "is". This will better support users creating saved searches without adjusting dates.  i.e. Quotes expiring in Next 7 days, and  Opportunities with follow up date within Next 30 days. The relative dates in advanced search looks like below.

  1. When you set cursor on date field with operator value is "is".

  2. When you click calendar button on date field with operator value is "is".

How to enable Relative Dates in Advanced Search


  • Either you Install the corresponding support package mentioned in SAP Note 2419728 Relative Dates in Advanced Search - User Interface
  • Or implement the below notes in the following order:

    BEFORE IMPLEMENTING following NOTES 1) - THROUGH 5), MAKE SURE THAT YOUR WEBCUIF COMPONENT IS AT AN SP LEVEL AS STATED BY THE NOTE 2419728. (please always check the latest up-to date information in this note.)

     1) 2404110 - Relative Dates in Advanced Search - Database Objects, DDIC, Handler BAdI

     2) 2403349 - Relative Dates in Advanced Search - Runtime/BOL/GenIL Core Modification

     3) 2404161 - Relative Dates in Advanced Search - Customizing

     4) 2403445 - Relative Dates in Advanced Search - Runtime/BOL/GenIL

     5) 2404153 - Relative Dates in Advanced Search - Default Handler

     6) Then, implement the main note 2419728 (Includes Manual Pre-Implement steps)

     7) Finally, implement the note 2504791 and 2510202.

    WARNING: Make sure to clear the server and browser cache before retesting, because above Notes contain JavaScript code. If you do not have Note 1855979 and 1920638 or equivalent SP installed, then please do not forget to erase your browser cache (temporary internet files) and server cache, and close all local browser instances before restarting the application again. To delete caches, please check with Note 2050322.


After you have installed the corresponding support package or all related notes mentioned in above section "Requirement", you need to do following customizing steps to enable relative dates in advance search. Following introduces the main customizing steps, you can also download the attachment PDF attached to SAP Note 2419728 to understand more details. 

  1. Run T-code: WCF_CUST=>UI Framework=>Generic Interaction Layer/Object Layer=>Component Specific Settings=>Define Relative Dates, if you can't find this customizing path, then this means you applied notes instead of support package to includes this new functionality. Please read following KBA to understand where to do the same customizing.

    KBA 2523635 - Relative Dates customizing is missing even after applied Note 2419728

  2. In folder "Relative Date Description", you will see all standard delivered Relative Date Descriptions.
  3. You need to define relative date in folder "Relative Date Definition".
  4. In folder "Dynamic Queries", we define the dynamic query object name. In following screenshots, we take opportunity search for example to tell you how to find the relevant dynamic query object name.

    First, we need to find the technical information of the view, context node by setting your cursor on relevant date value field in the opportunity searching view and clicking F2 button on the keyboard.

    We run T-code: bsp_wd_cmpwb and display the relevant view and context node "SEARCH" to find out the dynamic query object BTQOpp for opportunity.

    After we find the dynamic query object BTQOpp, we customize it in folder "Dynamic Queries".
  5. In folder “Default Relative Dates for Dynamic Query”, we assign the default Relative Dates to Dynamic Query. If you want to customize exceptions, you can customizing in folder "Exceptions per Dynamic Query Attribute". If in this steps you see Error: CRM_GENIL_CUST229 Relative date operator is not allowed for this object, please refer to KBA 2670955.

Common Issues

  1. The relative date should be only visible and used with "Is" search operator, but you find it remains in other operator "Is Between".
    SAP Note 2510202 Relative dates list displaying for operators other than "is"
    SAP Note 2672988 - Relative Date: Selection not disappear after operator change
  2. You clicked date picker value help button, the expected date picker popup is not displayed.
    SAP Note 2645509 - WUI: Date picker does not open
  3. The relative date isn't working for a second roundtrip in custom application. (Customer component/view)
    Solution:  Please adjust your code in the DO_CONFIG_DETERMINATION method of the customer view implementation class to set the Object type. For an example about how to do it,  you can refer to CL_AJTPLH_T_ACCOUNTHIERAR_IMPL=>DO_CONFIG_DETERMINATION.

    To verify the fix before you do any code change, you can set a breakpoint in CL_THTMLB_ADVANCEDSEARCH=>IF_BSP_ELEMENT~DO_AT_BEGINNING on line 1464 (IF statement) as following, and set value of lv_ui_object_type to the corresponding one every time you stop at the breakpoint during the execution to see if all searches will be carried off successfully.


      IF lv_ui_object_type IS NOT INITIAL.
    *   Cancel-Search relevant attributes
    *   Needs to be available on the frontend for successful external navigation
        CONCATENATE `<script type="text/javascript">`
                    `thtmlbGetTopWindow().thtmlbBusinessRole = "` lv_business_role `";`
                    `thtmlbGetTopWindow().currentUIObjectType = "` lv_ui_object_type `";`
                    'thtmlbGetTopWindow().objectType_Conf = "' lv_conf_object_type '";'
                    'thtmlbGetTopWindow().objectSubType_Conf = "' lv_conf_object_subtype '";'
               INTO lv_html.                                    "#EC NOTEXT

        me->print_stringLV_HTML ).

Related Content

Related SAP Notes/KBAs

  1. SAP Note 2419728 - Relative Dates in Advanced Search - User Interface
  2. SAP Note 2504791 Relative dates list not displaying in Advanced Search page
  3. KBA 2523635 Relative Dates customizing is missing even after applied Note 2419728
  4. KBA 2670955 Error CRM_GENIL_CUST229 Relative date operator is not allowed for this object



  • No labels