Quantcast
Channel: SCN : Document List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 189

Search Result Enhancement with custom z fields

$
0
0

This document is about enhacing the search result structure with custom fields and updating those custom fields while search in BADI

 

Step1: First we need to enhance the search result structure with custom fields

find out structure name for the search Query result relation say for BTQRSrvReq attribute structure is CRMST_QUERY_R_SRV_REQ_BTIL

 

Search your Result structure in GENIL_MODEL_BROWSER

SR1.jpg

Go to the structure and click on append structure option and create new append structure with your custom fields and activate the structure

say ZZPERSON_RESP_ROLE is added in the append structure

 

SR2.jpg

 

Step2:We need to create new enhancement spot for ES_CRM_RF_Q1O_READ in Tcode SE18

 

SR3.jpg

 

 

Give the enhancement implementation name

 

SR4.jpg

 

Give BADI Implementation name and class name

 

SR7.jpg

 

After creating implementation we need to add filter data

 

click on filter and click on combination to create

 

SR8.jpg

 

After this double click on OBJ_IL and add the filetr values and activate the enhancement

 

SR9.jpg

 

 

After everything is done click on Implementation class

 

SR10.jpg

 

Step 3: We need to do code in READ method to fill the value in custom field

 

Click on the read method and call standard FM CRM_BSP_OIC_1O_READ_FROM_RF to get read standard field values in the structure

and then loop the table and populate your custom field value

 

  FIELD-SYMBOLS:<fwa_structure> TYPE crmt_bsp_scrstrucname,
                <ls_sc_structure>     TYPE any,
                <lt_screen_structure> TYPE table,
                <itf_ref_prod_gen>    TYPE any.


  CALL FUNCTION 'CRM_BSP_OIC_1O_READ_FROM_RF'
    EXPORTING
      it_object_key            = it_object_key
      iv_screen_structure_name = iv_result_structure_name
      iv_refresh_headeredition = ''
      iv_call_authority_badi   = 'X'
      iv_avoid_authorization   = ''
    IMPORTING
      et_screen_structure      = et_result_structure.

 

   LOOP AT et_result_structure ASSIGNING <ls_sc_structure>.
      CLEAR:,lv_role,lv_pers_resp.
      REFRESH:li_return,li_role,li_role_txt.


      CONCATENATE '<ls_sc_structure>' '-GUID' INTO lv_name.
      ASSIGN (lv_name) TO <itf_ref_prod_gen>.
      IF sy-subrc IS INITIAL.
        lv_guid = <itf_ref_prod_gen>.
        UNASSIGN <itf_ref_prod_gen>.
      ENDIF.


*person responsible role
      CONCATENATE '<ls_sc_structure>' '-PERSON_RESP' INTO lv_name.
      ASSIGN (lv_name) TO <itf_ref_prod_gen>.
      IF sy-subrc IS INITIAL.
        lv_pers_resp = <itf_ref_prod_gen>.
        UNASSIGN <itf_ref_prod_gen>.
      ENDIF.

 

      CALL FUNCTION 'BUPA_ROLES_GET_2'
        EXPORTING
          iv_partner      = lv_pers_resp
        TABLES
          et_partnerroles = li_role
          et_return       = li_return.

      IF li_role IS NOT INITIAL.
        SELECT * FROM tb003t INTO TABLE li_role_txt FOR ALL ENTRIES IN li_role WHERE role = li_role-partnerrole AND spras = 'E'.
      ENDIF.


      LOOP AT li_role_txt INTO lwa_role_txt.
        CONCATENATE lv_role lwa_role_txt-rltxt  INTO lv_role SEPARATED BY ','.
      ENDLOOP.


      REPLACE FIRST OCCURRENCE OF ',' IN lv_role WITH space.
      CONCATENATE '<ls_sc_structure>' '-ZZPERSON_RESP_ROLE' INTO lv_name.
      ASSIGN (lv_name) TO <itf_ref_prod_gen>.
      IF sy-subrc IS INITIAL.
        <itf_ref_prod_gen> = lv_role.
        UNASSIGN <itf_ref_prod_gen>.
      ENDIF.


ENDLOOP.

 

 

Step 4: Add your custome field in configuration of the required component in this case SRQM_INCIDENT_S

 

 

Aftre this you can get the custom field value in the result where ever this query is executed

 

Regards,

Deepika.


Viewing all articles
Browse latest Browse all 189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>