cancel
Showing results for 
Search instead for 
Did you mean: 

DQUERY result is being initial

Former Member
0 Kudos

Hello gurus,

I am facing problem with BOL Code written in a method of my custom class. when I am trying to fetch activity using BTQ1Order or BTQAct by passing object_id, dquery result is being initial. If I checked the same in GENIL_BOL_BROWSER, I can the entity is being fetched. I developed a report with the above code, dquery result is having entity.

I am not able to understand why the data is not being fetched in custom class method..

Please help me out.

Thanks in advance.

Regards,

Magana

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello gurus,

I call another component from quatation. In this cust. component I search an order. I have very similar problem now like in this topic. The search result is initial.

The smal deference is that it works when I navigate to my order (quotation) from direct link "recent items" from navigation bar.

When I search the order (quotation) and navigate there from search mask it doesn't work.

Does everybody know what is the deference whether I come to order from "recent items" or from search page? or What I can do that the search always works independs where I call my methode?

   DATA: lr_bol_core             TYPE REF TO   cl_crm_bol_core,
        lr_result               TYPE REF TO   if_bol_entity_col,
        lr_query                TYPE REF TO   cl_crm_bol_dquery_service,
        lr_iterator             TYPE REF TO   if_bol_entity_col_iterator,
        lr_entity_col           TYPE REF TO if_bol_entity_col,
        lv_low                  TYPE          string.

  lv_low = iv_quotation_id.
* BOL instance
  lr_bol_core = cl_crm_bol_core=>get_instance( ).
  lr_bol_core->start_up('ALL').
* BOL components
*  lr_bol_core->load_component('BT').
* BOL query
  lr_query = cl_crm_bol_dquery_service=>get_instance( 'BTQ1Order' ).
  lr_query->add_selection_param( iv_attr_name = 'OBJECT_ID'
                                 iv_sign      = 'I'
                                 iv_option    = 'EQ'
                                 iv_low       lv_low  ).  " here I pass the product ID I want

  lr_result = lr_query->get_query_result( ). "Here the result is EQ to 0
  lr_iterator = lr_result->get_iterator( ).
  er_quotation = lr_iterator->get_first( ). " and my entity IS INITIAL

Regards

HoroSh

Former Member
0 Kudos

By building of "where" I have  CRMD_ORDER_INDEX~STAT_QUOT = 'Y'

But 'Y' is not allowed...

Former Member
0 Kudos

Hi Megana,

You need to provide some more details on what you are doing.

Are you using BTQR1Order as Result Object?

Regards,

Pratheek

Former Member
0 Kudos

Hello Pratheek,

yeah. I am using BTQR1Order as query result object. but it is being initial in my custom class method and entity is being fetched in  report program for the same code.

lv_core = cl_crm_bol_core=>get_instance( ).

lv_core->start_up( 'ONEORDER').

  lv_dquery = cl_crm_bol_dquery_service=>get_instance( 'BTQ1Order' ).

   lv_dquery->add_selection_param( iv_attr_name = 'OBJECT_ID'

                                   iv_sign = 'I'

                                   iv_option = 'EQ'

                                   iv_low = lv_obj_id ).

   lv_result = lv_dquery->get_query_result( ).

   IF lv_result IS BOUND.

     lv_entity = lv_result->get_first( ).

     IF lv_entity IS  BOUND.

lv_entity is being initial.


thanks,

magana

Former Member
0 Kudos

Hi magana,

hope you are doing this in Compoent Workbench(bsp_wd_cmpwb). in that case following code will help you

DATA: lr_query_service TYPE REF TO cl_crm_bol_dquery_service,

           lr_result             TYPE REF TO if_bol_bo_col.

**** Here btq1order is your Search Node as you mentioned in question****

lr_query_service ?= me->typed_context->btq1order->collection_wrapper->get_current( ).

**** After getting the Current entity of your Search Node call get_dquery_result method***

**** Here Search Node will have all the Search Criteria that you entered from UI***

lr_result = lr_query_service->get_query_result( ).

CHECK lr_result is BOUND.

****btqr1order is you your result node****

me->typed_context->btqr1order->set_collection( lr_result ).

hope I got your problem right.

Regards,

Pratheek

Former Member
0 Kudos

Thanks for your quick reply..

I am not working with component work bench.

written code in utility class that is used in my fm

now I am able to fetch the day, instead of START_UP( ), I used LOAD_COMPONENT_SET( ).