cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a custom partner Z field as a complaint search criteria

Former Member
0 Kudos

Hello,

i would like to define an existing custom Z field ZZFLD000054 from CRMD_PARTNER as the complaints' search criteria (component = BT120S_CPL, view = AdvSearchCompIEF). If the user enters a value into this new search field, SAP should return a list of complaints, that include partners that have this value in the Z field.

I added this Z field into a SEARCH node of the view (Add Model Attribute, BOL entity = BTPartner, BOLAttribute = ZZFLD000054), but the problem is the field is not available in the Configuration.

Please help!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Is the Z field in the AET marked as relevant for search?

Former Member
0 Kudos

Sadly no.

Is there a way around it ?

former_member190077
Participant
0 Kudos

in this way???

Best Regard,

JMP.

Former Member
0 Kudos

This would work if the Z field would be part of header data (CRMD_ORDERADM_H). I need to enable searching based on a Z field as part of partner data (CRMD_PARTNER).

I found out that structure with complaints' search criteria is called CRMST_QUERY_COMPL_BTIL. I appended the Z field ZZFLD000054 to it and it became available in the view configuration. I added it to the view. Using the field returns "PROBLEM_WITH_QUERY" exception.

Please, anybody ?

former_member190077
Participant
0 Kudos

Please review this links:

You can help...

Former Member
0 Kudos

Hi Jose,

sorry for the late reply. Thank you very much for the links, the 2nd link (Enhancing Search Screen) has almost all the information i need.

I followed these steps:

1. Append the structure 'CRMST_QUERY_COMPL_BTIL' with new field and make that field available in UI.

2. Copy the class 'CL_CRM_QCOMPL_RUN_BTIL' to a z class . and make the required changes in method 'GET_DYNAMIC_QUERY_RESULT' for the newly added field.

3 . Now define this newly created Z class for your search object 'BTQCompl' in SPRO under path :-

SPRO->CRM->CRM Cross-Application Components->Generic Interaction Layer/Object Layer->Component-Specific Settings->Business Transactions->Define Custom Handler Classes for Business Transaction Model Nodes.

This way my new Z class ZCL_CRM_QCOMPL_RUN_BTIL is correctly called and i can implement the search logic in the IF_CRM_QUERY_RUNTIME_BTIL~GET_DYNAMIC_QUERY_RESULT method. Do you perhaps have an idea how could i do this most elegantly ? The main standard search is done with this code:

CALL METHOD lr_1o_search->get_result_values

     EXPORTING

       iv_max_hits = is_query_params-max_hits

     IMPORTING

       et_results  = <compl_order_tab>

       et_return   = lt_return.

Can i use this same method for my new ZZFLD000054 search field (part of CRMD_PARTNER) ?

Currently without any code implementation, i get an exception when searching complaints using this field:

  • The following error occurred in system CRR : Exception condition "PROBLEM_WITH_QUERY" raised.
  • The error occurred on application server guediscrr_CRR_50 and in work process 4 .
  • The termination type was: RABAX_STATE
  • The ABAP call stack was:
    Method: MAKE_INSTANCE_VALID of program CL_CRM_REPORT_ACCRULE=========CP
    Method: MAKE_INSTANCE_VALID of program CL_CRM_REPORT_ACCRULE_ONEORDERCP
    Method: GET_INSTANCE of program CL_CRM_REPORT_ACCRULE=========CP
    Method: CREATE_ACCRULE of program CL_CRM_REPORT_QUESTION========CP
    Method: CONSTRUCTOR of program CL_CRM_REPORT_QUESTION========CP
    Function: CRM_BSP_OIC_1O_SEARCH_FROM_RF of program SAPLCRM_BSP_OIC_1O_SEARCH
    Method: GET_RESULT_GUIDS of program CL_CRM_Q1O_SEARCH=============CP
    Method: GET_RESULT_VALUES of program CL_CRM_Q1O_SEARCH=============CP
    Method: IF_CRM_QUERY_RUNTIME_BTIL~GET_DYNAMIC_QUERY_RESULT of program ZCL_CRM_QCOMPL_RUN_BTIL=======CP
    Method: EXECUTE_DYNAMIC_QUERY of program CL_CRM_INTLAY_BTIL============CP