Skip to Content
author's profile photo Former Member
Former Member

set default value in help value, from Outbound Plug of SRQM_INCIDENT_H

Very good morning,

I wanted to call a search help, and pass default values. In the call(from my Outbound Plug), I try to use lr_col for to pass the default value. But the first time dont work, and the next time the field are duplicated,but with default value.


I know that is possible to do it from other places of help value component(), but i want to use from my componet ' SRQM_INCIDENT_H'. The help value name is 'PRD01QR'. My code es:

lr_context_node = productvaluehelp_popup->get_context_node( iv_cnode_name = 'SEARCH' ).
lr_query_service ?= lr_context_node->collection_wrapper->get_current( ).
IF lr_query_service IS NOT BOUND.
lr_query_service = cl_crm_bol_dquery_service=>get_instance( 'ProdAdvSearchRgProducts' ).
ENDIF.

CALL METHOD lr_query_service->add_selection_param
EXPORTING
iv_attr_name = 'PRODUCT_ID'
iv_sign = 'I'
iv_option = 'EQ'
iv_low = ''.

CALL METHOD lr_query_service->add_selection_param
EXPORTING
iv_attr_name = 'DESCRIPTION'
iv_sign = 'I'
iv_option = 'EQ'
iv_low = ''.

CALL METHOD lr_query_service->add_selection_param
EXPORTING
iv_attr_name = 'CATEGORY_ID'
iv_sign = 'I'
iv_option = 'EQ'
iv_low = 'Z0003'.

CALL METHOD lr_query_service->add_selection_param
EXPORTING
iv_attr_name = 'CATEGORY_DESC'
iv_sign = 'I'
iv_option = 'EQ'
iv_low = ''.

lr_col = lr_query_service->get_selection_params( ).
productvaluehelp_popup->open( iv_inbound_plug = gv_refproduct_search_ip iv_collection = lr_col )

1000 thanks!!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 29, 2014 at 09:47 AM

    Hi Victor,

    Try this code

    DATA:

    lr_col TYPE REF TO if_bol_bo_col,

    lr_qs TYPE REF TO cl_crm_bol_dquery_service.

    CONSTANTS lc_query_name TYPE crmt_ext_obj_name VALUE 'ProdAdvSearchRgProducts'.

    CALL METHOD cl_crm_bol_dquery_service=>get_instance

    EXPORTING

    iv_query_name = lc_query_name

    RECEIVING

    rv_result = lr_qs.

    lr_qs->add_selection_param(

    EXPORTING

    iv_attr_name = 'CATEGORY_ID'

    iv_sign = 'I'

    iv_option = 'EQ'

    iv_low = 'Z0003'.

    ).

    "Pass the dquery object to the collection.

    IF lr_col IS NOT BOUND.

    CREATE OBJECT lr_col TYPE cl_crm_bol_bo_col.

    ELSE.

    lr_col->clear( ).

    ENDIF.

    lr_col->add( lr_qs ).


    productvaluehelp_popup->open( iv_inbound_plug = 'SEARCHPRODUCTS' iv_collection = lr_col ).




    Regards JP

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      You're on the right way , JP

      it works fine but just the first time, the second time the field appears duplicated, i change a litle bit your code por the second time

      thanks and Greetings.

      lr_context_node = productvaluehelp_popup->get_context_node( iv_cnode_name = 'SEARCH' ).



      lr_query_service ?= lr_context_node->collection_wrapper->get_current( ).

      IF lr_query_service IS NOT BOUND.

      lr_query_service = cl_crm_bol_dquery_service=>get_instance( 'ProdAdvSearchRgProducts' ).

      CALL METHOD lr_query_service->add_selection_param

      EXPORTING

      iv_attr_name = 'CATEGORY_ID'

      iv_sign = 'I'

      iv_option = 'EQ'

      iv_low = 'Z0003'.

      ENDIF.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.