Skip to Content

How to pass value to search help?

Hi, expert

I create a search help, use the codes as below:

LS_MAP-CONTEXT_ATTR = 'PRODUCT'.
  LS_MAP-F4_ATTR      = 'NAME_TXT'.
  APPEND LS_MAP TO: LT_INMAP, LT_OUTMAP.

  CREATE OBJECT RV_VALUEHELP_DESCRIPTOR
    TYPE
      CL_BSP_WD_VALUEHELP_F4DESCR
    EXPORTING
      IV_HELP_ID                  = 'ZHELP_ZYY_TEST_TBL'
      IV_HELP_ID_KIND             = IF_BSP_WD_VALUEHELP_F4DESCR=>HELP_ID_KIND_COMP
      IV_INPUT_MAPPING            = LT_INMAP
      IV_OUTPUT_MAPPING           = LT_OUTMAP
      IV_F4TITLE                  = ''    "#  EC NOTEXT

How can i pass a value to the search help? I want to use the value to filter the result.

Thanks.

Oliver.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 04, 2009 at 06:15 AM

    Hi Oliver,

    Plz check the method: GET_VALUEHELP_DESCR_VIA_BOL which is there in Class: CL_BSP_WD_CONTEXT_NODE

    It may help you.

    Regard's,

    Lokesh Banakar.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 05, 2009 at 02:38 AM

    Hi, Lokesh

    Thanks for your reply. I have a problem now.

    I have ctreate a enhance field in BT131I_SLS via AET, and we bind a search help to the enhanced field.

    Now we want to pass value to the search help to filter data.

    We have create the GET-V_ method for the field([A problem about AET .|A problem about AET .]),

    but it doesn't work.

    It looks like that the AET field call the search help via other method.

    Thanks.

    Oliver.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 05, 2009 at 05:00 AM

    Hi,

    Now i have define the GET-V method as below:

    method GET_V_ZZZFLD00000E.
      DATA:
      ls_map TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
      lt_inmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
      lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.
    
      LS_MAP-CONTEXT_ATTR = 'ZZZFLD000000E'.
      LS_MAP-F4_ATTR      = 'VSTEL'.
      APPEND LS_MAP TO: LT_OUTMAP.
    
      LS_MAP-CONTEXT_ATTR = 'BTPARTNER/STRUCT.REF_PARTNER_NO'.
      LS_MAP-F4_ATTR = 'I_PARTNER_NO'.
       APPEND LS_MAP TO: LT_INMAP.
    
      CREATE OBJECT RV_VALUEHELP_DESCRIPTOR
        TYPE
          CL_BSP_WD_VALUEHELP_F4DESCR
        EXPORTING
          IV_HELP_ID                  = 'ZHELP_ZSAZYD'
          IV_HELP_ID_KIND             = IF_BSP_WD_VALUEHELP_F4DESCR=>HELP_ID_KIND_COMP
          IV_INPUT_MAPPING            = LT_INMAP
          IV_OUTPUT_MAPPING           = LT_OUTMAP
          IV_F4TITLE                  = ''."# u3002EC NOTEXT
    endmethod.

    Now we can't get the value from the node of the custom controller, just like codes as below:

    LS_MAP-CONTEXT_ATTR = 'BTPARTNER/STRUCT.REF_PARTNER_NO'.

    if the attribute belongs to the same node of ZZZFLD00000E,

    we can use the name of the attribute to get its value, like codes as below:

    LS_MAP-CONTEXT_ATTR = 'STRUCT.REF_PARTNER_NO'.

    But STRUCT.REF_PARTNER_NO belongs to another node, how can i get its value?

    Thanks.

    Oliver.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 10, 2009 at 05:42 AM

    Hi,

    I found a way to solve the probelm. Codes as below:

    method GET_V_ZZZFLD00000Z.
    
      DATA: current TYPE REF TO if_bol_bo_property_access.
    
      data: entity  TYPE REF TO cl_crm_bol_entity,
            coll    TYPE REF TO if_bol_bo_col,
            lv_partner_no TYPE string,
            lv_shipping TYPE string,
            dref TYPE REF TO data.
    
      entity ?= me->collection_wrapper->get_current( ).
      coll = entity->get_related_entities( iv_relation_name = 'BTItemPartnerSet' ).
      current = coll->get_current( ).
      IF current IS NOT BOUND.
        RETURN.
      ENDIF.
    
      entity ?= current.
      coll = entity->get_related_entities( iv_relation_name = 'BTPartner_00000035_MAIN' ). "#EC NOTEXT
      current = coll->get_current( ).
      IF current IS NOT BOUND.
        RETURN.
      ENDIF.
    
      TRY.
          dref = current->get_property( 'PARTNER_NO' ).         "#EC NOTEXT
        CATCH cx_crm_cic_parameter_error.
      ENDTRY.
      lv_partner_no = if_bsp_model_util~convert_to_string( data_ref = dref
                                      attribute_path = 'PARTNER_NO' ).
    
      entity ?= me->collection_wrapper->get_current( ).
      coll = entity->get_related_entities( iv_relation_name = 'BTItemShippingSet' ).
      current = coll->get_current( ).
      IF current IS NOT BOUND.
        RETURN.
      ENDIF.
    
      TRY.
          dref = current->get_property( 'SHIP_COND' ).          "#EC NOTEXT
        CATCH cx_crm_cic_parameter_error.
      ENDTRY.
      lv_shipping = if_bsp_model_util~convert_to_string( data_ref = dref
                                      attribute_path = 'SHIP_COND' ).
    
      DATA:
        LS_MAP    TYPE IF_BSP_WD_VALUEHELP_F4DESCR=>GTYPE_PARAM_MAPPING,
        LT_INMAP  TYPE IF_BSP_WD_VALUEHELP_F4DESCR=>GTYPE_PARAM_MAPPING_TAB,
        LT_OUTMAP TYPE IF_BSP_WD_VALUEHELP_F4DESCR=>GTYPE_PARAM_MAPPING_TAB.
    
      LS_MAP-CONTEXT_ATTR = 'EXT.ZZZFLD00000Z'.
      LS_MAP-F4_ATTR      = 'VSTEL'.
      APPEND LS_MAP TO: LT_OUTMAP.
    
    *  LS_MAP-CONTEXT_ATTR = 'EXT.ZZZFLD00000X'.
    *  LS_MAP-F4_ATTR      = 'PARTNER'.
    *  APPEND LS_MAP TO LT_INMAP.
    
      DATA lv_bp_format TYPE string.
      CONCATENATE '\''' lv_partner_no '\''' INTO lv_bp_format.
      ls_map-context_attr = lv_bp_format.
      ls_map-f4_attr = 'PARTNER'.
      APPEND ls_map TO lt_inmap.
    
      LS_MAP-CONTEXT_ATTR = 'STRUCT.ORDERED_PROD'.
      LS_MAP-F4_ATTR      = 'PRODUCT'.
      APPEND LS_MAP TO LT_INMAP.
    
    *  LS_MAP-CONTEXT_ATTR = 'EXT.ZZZFLD000015'.
    *  LS_MAP-F4_ATTR      = 'SHIPPING'.
    *  APPEND LS_MAP TO LT_INMAP.
    
      DATA lv_shipping_format TYPE string.
      CONCATENATE '\''' lv_shipping '\''' INTO lv_shipping_format.
      ls_map-context_attr = lv_shipping_format.
      ls_map-f4_attr = 'SHIPPING'.
      APPEND ls_map TO lt_inmap.
    
      IF SY-SUBRC  = 0.
      ENDIF.
    
      CREATE OBJECT RV_VALUEHELP_DESCRIPTOR
        TYPE
          CL_BSP_WD_VALUEHELP_F4DESCR
        EXPORTING
          IV_HELP_ID                  = 'ZHELP_ZSAZYD'
    *      IV_HELP_ID_KIND             = IF_BSP_WD_VALUEHELP_F4DESCR=>HELP_ID_KIND_COMP
          IV_HELP_ID_KIND             = IF_BSP_WD_VALUEHELP_F4DESCR=>HELP_ID_KIND_NAME
          IV_INPUT_MAPPING            = LT_INMAP
          IV_OUTPUT_MAPPING           = LT_OUTMAP
    *      iv_trigger_submit           = abap_true
    *      IV_F4TITLE                  = ''"#    EC NOTEXT
           .
    endmethod.

    Best regards.

    Oliver.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Oliver,

      I am new to ABAP and CRM and facing similar problem ,so posting my query here.

      I need to add two custom field 'Plant' and 'Storage Location' under Service orders at Item level in component BT140I_SRVP.

      One field 'Storage Location' is required to have the input search help f4 and autopopulates the second field 'Plant'.

      After implementing the suggested SAP note, I am able to see the getter and setter methods.

      I have created the enhanced fields without the search help from AET in the node BTAdminI with names Plant(ZZPLANT) and Storage Location(ZZStoarge_Loc).

      Now I am facing below problem:

      Since Plant needs to autopopulated by Storage Location (search Help ZOFI_SHLP_STORAGE_LOC having parametrs Storage_Loc and Plant),So I need to Implement Getter setter method.

      I have written below code into Get_V_ZZStorage_Loc Method:

      method GET_V_ZZSTORAGE_LOC.

      DATA:

      ls_map TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,

      lt_inmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,

      lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.

      ls_map-context_attr = 'ZZSTORAGE_LOC'.

      ls_map-f4_attr = 'STORAGE_LOC'. (Storage_loc is the parameter defined in search help)

      APPEND ls_map TO: lt_inmap, lt_outmap.

      CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_f4descr

      EXPORTING

      iv_help_id = 'ZOFI_SHLP_STORAGE_LOC1'

      iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_callback

      iv_input_mapping = lt_inmap

      iv_output_mapping = lt_outmap.

      endmethod.

      But its not working.Should I write some code in Get_P_XX or some other method also?

      Kindly suggest .

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.