cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve data using Date Range from MDM API Query Method?

Former Member
0 Kudos

Hi All,

Iam using MDM 7.1 , and I tried using MDM API Query Method for getting the data within the Date range, but i am getting all the records which are outside of that date range also.

  text-content = '20120301000000.000000'.
  w_query-parameter_code = 'ZDATETIMESTAMP_FIELD'.
  w_query-dimension_type =
mdmif_search_dim_field.
  w_query-operator = 'GT'.
  w_query-constraint_type =
mdmif_search_constr_date.
  GET REFERENCE OF text INTO w_query-value_low.
  APPEND w_query TO it_query.

  text-content = '20120319000000.000000'.
  w_query-parameter_code = 'ZDATETIMESTAMP_FIELD'.
  w_query-dimension_type =
mdmif_search_dim_field.
  w_query-operator = 'LT'.
  w_query-constraint_type =
mdmif_search_constr_date.
  GET REFERENCE OF text INTO w_query-value_low.
  APPEND w_query TO it_query.

   CALL METHOD  api->mo_core_service->query
        EXPORTING
          iv_object_type_code      = 'MAIN_TABLE'
          it_query                 = it_query
        IMPORTING
          et_result_set            = t_result_set.

I Used it_search_group exporting parameter in that query method by passing AND operator also, still i am getting all the records.

I need to get the records which are within that date range only.Please help me on this regard.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Suresh,

Your code appears fine to me.

Which version of MDM are you using?

See the note:

http://www.saptechno.com/sap-notes.html?view=sapnote&id=1603924

Search Group will work for Queries only in MDM 7.1 Sp08.if yours is Sp08 then we need to think in some different direction.

Regards,
Neethu Joy

Former Member
0 Kudos

Hi Neethu,

Thanks for your qucik response.

But we are using MDM 7.1 SP08 only.Please let me know if there is any alternative solution.

Former Member
0 Kudos

Hi Suresh,

Also please confirm that the correction for MDM_TECH is as per the note.

Thanks,

Ravi