cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with STARTDATE of opportunity in search criteria

Former Member
0 Kudos

HI

I have added a field called 'STARTDATE' of the table 'CRMD_OPPORT_H' to search criteria of Opportunity.

I have added this field to below structures

CRMST_QUERY_OPP_BTIL & CRMST_QUERY_R_OPP_BTIL.

Also I have selected few operators in 'CRMVC_DQ'.

But when I'm trying to search opportunities system is throwing the below error and this error is appearing for all the operators

except for 'IS'( EQ).

"The operator 'EQ' is the only one supported for the single value field STARTDATE".

Could you please let me know why this error is appearing ?

Best Regards

Anil Kumar

Accepted Solutions (1)

Accepted Solutions (1)

CarstenKasper
Active Contributor
0 Kudos

Hi Anil,

the reason is you named your CUSTOM field in the name space of SAP. There already is a field called STARTDATE in the OneOrder Search. In table CRMC_Q1O_FIELDS it is marked as SINGLE_VALUE. The search logic checks this table and sees: This field should only contain 'EQ' as OPTION and throws the error message you mentioned.

Rename your custom field in customer namespace and you will be fine. Additionally you will need to take care of the rest of the search logic for this field to work...

Probably you should use the EEWB/AET to make additions to the tables and searches. It will take care of all the necessary things.

cheers Carsten

Former Member
0 Kudos

Hi Carsten

Thank you so much.

My requirement is " I should have 'Created On' field in the Opportunity search hence for this I have added a field called

'CREATED_AT_DATE' field to structure 'CRMST_QUERY_OPP_BTIL' but after adding this field the search is not working perfectly.

So I have deleted the field 'CREATED_AT_DATE' and added a field called 'STARTDATE' of the table 'CRMD_OPPORT_H to

CRMST_QUERY_OPP_BTIL and this is s standard field.

But this is giving the error.

So as per you this field will allow only 'EQ'? If yes then could you please let me know what is the correct field for 'Created On' ?

Best Regards

Anil

CarstenKasper
Active Contributor
0 Kudos

Hi Anil,

have a look at the table I mentioned. I suppose that START_DATE_RANGE may be an appropriate field in your case. Another one could be CHANGED_AT_RANGE. However I do not know if any problems occur if you just add them to your search. SAP might have had reasons not to include them...

If you are adding a custom search criteria there are, as already mentioned, two possibilities:

1. Add it using the EEWB/AET. It will take care of everything.

2. Do it manually. When choosing this option you should know what you are doing.

cheers Carsten

former_member192716
Contributor
0 Kudos

Hi,

To add a new field to the search criteria, you just have to add the field to the structure 'CRMST_QUERY_OPP_BTIL' . But if it is a only certain operators are supported like EQ, BT, LT and GT. Since 'STARTDATE' is a custom field, check the search criteria by debugging the on_search event of the controller class and check the operator.

Search must be manually implemented by creating an implementation for BADI CRM_BADI_RF_Q1O_SEARCH with filter criteria as BTQOPP = OBJ_IL.

Regards,

Arun

CarstenKasper
Active Contributor
0 Kudos

Arun,

Since 'STARTDATE' is a custom field

The field STARTDATE is one of the fields defined in SAP Standard for the Reporting Framework. If you add this field to a search structure for a BOL object where the corresponding search implementation class is using the Reporting Framework you have to play by the rules of the framework.

Custom fields should be marked with a Z or a customer namespace. Otherwise you will run in exactly this kind of problems.

Implementing the BAdI, as mentioned by you, will not do any good. I suppse the framework coding will throw the error even before the BAdI implementation is called. By all means, completely reimplementing the search with this BAdI is way too much work for such a simple task. (You can not call the RFW function module as it will definitely treat the field STARTDATE otherwise...)

cheers Carsten

former_member192716
Contributor
0 Kudos

Hi Carsten,

Adding 'STARTDATE' to search structure is considered as a custom field addition provided it follows the customer namespace (ZSTARTDATE). I assumed it is prefixed with Z. In this case only the standard data element is reused which won't cause any problem, and in order to implement the search the badi must be implemented. This will be a simple solution, i agree with you if the field added doesnt follow customer namespace.

Regards,

Arun

Answers (0)