Wednesday, April 17, 2013

SAP CRM Advanced Query




  CALL METHOD cl_crm_advs_qheader_list=>create
    EXPORTING
      is_header_data = ls_qheader
    IMPORTING
      ev_guid        = lv_qid.

  ls_qterm-fieldname ='PROSPECT'."'CURR_PHASE'.
  ls_qterm-sign = 'I'.
  ls_qterm-operator = 'EQ'.
  ls_qterm-low = '1'.

  CALL METHOD cl_crm_advs_qterm_list=>create
    EXPORTING
      iv_header_guid = lv_qid
      is_attributes  = ls_qterm.


  DATA lv_catguid TYPE comt_category_guid.

  SELECT SINGLE category_guid FROM comv_cat_hiernew
         INTO lv_catguid
         WHERE category_id = ls_selected_pr-dkey.
  IF sy-subrc IS INITIAL.
    ls_qterm-fieldname ='PROD_HIERARCHY'.
    ls_qterm-sign = 'I'.
    ls_qterm-operator = 'EQ'.
    ls_qterm-low = lv_catguid.

    CALL METHOD cl_crm_advs_qterm_list=>create
      EXPORTING
        iv_header_guid = lv_qid
        is_attributes  = ls_qterm.

  ENDIF.

  CALL METHOD cl_ppm_dyns_filter_impl=>fire_query
    EXPORTING
      iv_queryid    = lv_qid
    IMPORTING
      ev_bol_entity = lr_opp_col.

No comments:

Post a Comment