cancel
Showing results for 
Search instead for 
Did you mean: 

Opportunity Search for Status NE (is not) is not supported by SAP Standard

Former Member
0 Kudos


Hi experts,

due to wiki entry

Searching for business transactions in the web ui using the Status criteria - CRM - SCN Wiki

the opportunity search for a status with operator NE is not supported.

Is there any SAP proposal for an appropriate workaround?

Thank you and best regards

Vanessa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Finally it was not worth the effort to search for a status using operator NE. Instead it is a good advice to use another field apart from status field for the search. In our case we built a workaround this way:

- every time when status is saved (for example status "cancelled") we saved this information in another field implicitly as defined in our new ORDER_SAVE BAdI implementation

- the other field can be used in search without any restrictions and therefore there is no problem with operator NE

- put the field into your web ui confiuration for search screen

- search for the field and get all fields in resultlist where status is not "cancelled"

Hope this helps.

Best Regards

Vanessa

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Vanessa,

I had the same problem and I have developed a workaround for the sales order search. In general it works like this (unfortunately it is not possible to paste some coding here).

As a prerequisite I have allowed the option NE for my business query and criteria STATUS_COMMON in customizing IMG.

In the EH_ONSEARCH-method I do the following:

- Get the business query

- Get the selection paramters

- Loop over all selection parameters of type STATUS_COMMON and option NE

- Get a list of all documents with that status

- Add selection parameters of type OBJECT_ID and option NE for each retrieved document

- Call the super-methode for EH_ONSEARCH

- Remove again all previously added selection parameters.

Best regards,

Thomas

Former Member
0 Kudos

Hello Thomas,

thank you for the advice.

Unfortunately too many selection parameters are not supported. Therefore the resultlist does not have any results with too many parameters. Furthermore performance problems are occurring.

Any other ideas?

Former Member
0 Kudos

Hello Vanessa,

This is a fresh development for my current customer which is not yet completely tested. The last customer had the same requirement, created an OSS-message for it, SAP told him in standard it is not possible and gave up. I think I already heard that too many selection parameters are not supported but I haven't seen it yet in our project. But I have seen that with mabye 100000 excluded transactions there is a time out.

The alternative would be to create a sub-class of the GENIL-class (I think this is CL_CRM_QOPP_RUN_BTIL in your case - search for CL*OPP*IL* ) where the SQL-statement is triggered and redefine the relevant method (which is normally GET_DYNAMIC_QUERY_RESULT) and enhance the SQL-statement. Somewhere is customizing you have to replace the original class with the new class afterwards but right now I don't know where. I have not yet done this from scratch and I need to investigate this a little bit further.

The second alternative would be to modify the select statements in a BADI. I guess it is CRM_BADI_RF_Q1O_READ. But there I only the the possibility to change the STATUS_COMMON-criteria to OBJECT_ID criterias as still STATUS_COMMON NE is not supported in the SQL-statement of the GENIL-class.

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

already tried to turn the select parameters for status into positive selection, I mean reading entire v-getter DDL and excluding the status currently set to NE. In my case it turned out that SAP standard did not support to search for too many parameters (I tried with about 40 parameters). Resultlist was not shown due to an error message in UI.

Probably it is the best way to create an entire workaround for status selection. Implementing an own new selection for NE status selection on GenIL level is not worth the effort from my point of view.

Best regards

Vanessa

Former Member
0 Kudos

Hello Vanessa,

I agree with you. What also makes the search for status difficult ist that a trnsaction can have multiple statuses like status A and status B. If you don't want the ones with status B and turn it in a selection for EQ status A then you still get the ones which have status A and status B.

With NE OBJECT_ID I had no WebUI error with the number of parameters yet but sometimes a timeout.

Best regards,

Thomas

Former Member
0 Kudos

Probably depends on the number of existing opportunities in system. Compared to positive status selection parameters, the number of object IDs to select would be way to high in my case. Therefore this approach is unfortunately not suitable.

Best regards

Vanessa