cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass the default value to search help selection screen

Former Member
0 Kudos

Hi

I need to push a certain value as a default value based on a condition to the slection screen of search help in web UI.

Could you please let me know how can we do this?

When we try to open the 'F4' help in web ui then it should populate a certain value as a default value to the selection screen of this 'F4' help. We will get this default value based on condition.

Regards

Anil

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

    DATA:
       lv_title        TYPE string,
       lv_attribute    TYPE string,
       lv_model        TYPE string,
       lv_event_string TYPE string.
     DATA lr_cnode         TYPE REF TO cl_bsp_wd_context_node.
     DATA lr_current       TYPE REF TO if_bol_bo_property_access.
     DATA lr_dquery        TYPE REF TO cl_crm_bol_dquery_service.
     DATA lr_col           TYPE REF TO if_bol_bo_col.

     cl_chtmlb_config_utility=>outbound_plug_event_info(
     EXPORTING
       iv_event_string = lv_event_string
     IMPORTING
       ev_model_name   = lv_model
       ev_index      = gv_index
       ev_attribute    = lv_attribute ).

     lv_title = 'XXXXXX'.
     IF ischevaluehelp_popup IS NOT BOUND.
*    lv_title = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT/IB_SEARCH' ).

       ischevaluehelp_popup = comp_controller->window_manager->create_popup(
       iv_interface_view_name = 'MainWindow'
       iv_usage_name = 'CUISCHEValueHelp'
       iv_title = lv_title ).
     ENDIF.

     ischevaluehelp_popup->set_on_close_event( iv_view = me iv_event_name = 'SEL_ISCHE' ).
     ischevaluehelp_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).
     ischevaluehelp_popup->open( ).

*-----------------------------------------------------------------------------------------------------------

     "Set Default Value To the Search Help Component
     lr_cnode = ischevaluehelp_popup->get_context_node( iv_cnode_name = 'BTQACT' ).
     CHECK lr_cnode IS BOUND.

     lr_dquery ?= lr_cnode->collection_wrapper->get_current( ).
     CHECK lr_dquery IS BOUND.

     lr_dquery->add_selection_param( iv_attr_name = 'PROCESS_TYPE' iv_low = 'ZSC1' iv_sign = 'I' iv_option = 'EQ' ).

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

This depends on whether you are using search help objects or calling BSP components as popup. BSP components meant to act as search helps usually accept data via inbound plugs in their interface window controller. In case of search help objects, go to se11 and see what input fields it is accepting and you have to include them in your "inmap" parameter.

Regards,

Arun Prakash

Former Member
0 Kudos

Hi Arun

I'm using SE11 search help.I'm giving you my code for your reference here.

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,

lr_qs TYPE REF TO cl_crm_bol_dquery_service,

lr_current TYPE REF TO if_bol_bo_property_access,

lv_category TYPE STRING.

ls_map-context_attr = 'struct.zzattr_i_1'.

ls_map-f4_attr = 'ATTRIBUTE'.

APPEND ls_map TO: lt_inmap,lt_outmap.

CLEAR ls_map.

ls_map-context_attr = 'struct.zzattr_i_1'.

ls_map-f4_attr = 'SERVICE_LINE'.

APPEND ls_map TO: lt_inmap.

CREATE OBJECT rv_valuehelp_descriptor

TYPE

cl_bsp_wd_valuehelp_f4descr

EXPORTING

iv_help_id = 'ZATTR1'

iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name

iv_trigger_submit = abap_true

iv_input_mapping = lt_inmap

iv_output_mapping = lt_outmap.

Here 'ZATTR1' is my search help name in SE11 and the field which is having 'F4' help is 'ATTRIBUTE'.

Now when I press 'F4' on 'ATTRIBUTE' then it will give a popup and this popup is having 3 fields..

1.'ATTRIBUTE'

2.'SERVICE_LINE'

3.Description of 'SERVICE_LINE' and hence by pressing 'F4' i should get a value in the field 'SERVICE_LINE' based on

a condition.

However, if there is a value for ATTRIBUTE on the screen and when we press 'F4' on this then in the popup the value of

ATTRIBUTE which is there on the screen is appearing in the 'ATTRIBUTE' field and the same value is being copied to

'SERVICE_LINE' field in the popup.

Please guide me how do we populate the value to 'SERVICE_LINE' field inside the search help popup of 'ATTRIBUTE'.

Best Regards

Anil

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

Notice this part of your code.


CLEAR ls_map.
ls_map-context_attr = 'struct.zzattr_i_1'.
ls_map-f4_attr = 'SERVICE_LINE'.
APPEND ls_map TO: lt_inmap.

You are passing the same attribute of your context node "zzattr_i_i" to both "ATTRIBUTE" and "SERVICE_LINE". That's why, if this field has any values it is copied to both the fields in the search help. Instead of struct.zzattr_i_1, you have to pass a different attribute from the same context node that you wish to pass to the f4 screen.

Regards,

Arun Prakash

Arno-Meyer
Advisor
Advisor
0 Kudos

Hello!

Have you already checked this Note:

[Note 1381285 - Prefilling of search attr. in the UI (eg. Contact search)|https://service.sap.com/sap/support/notes/1381285]

This explains how to default a value in a search.

Best regards

Arno

Former Member
0 Kudos

Can you answer my question...

Best Regards

Anil

Edited by: ANILKUMAR M on Mar 31, 2010 5:34 PM

Former Member
0 Kudos

Have you tried search help exit.

You may have to find a way to read Web UI data from search help exit. Try SET/GET FMs or static methods.

Former Member
0 Kudos

Hi All

Could you please answer my question.

Former Member
0 Kudos

Hi,

You can write the logic in GET_VALUE1 method of the context node to default the search value.

Regards,

S Reddy

Former Member
0 Kudos

Hi Reddy

I have a search help for the field 'Service type' in opportunity item.Now the requirement is to give a default

value to the selection screen of this search help when we press 'F4'.

Now as per your reply i didn't find 'GET_VALUE1 ' method in the context 'BTCUSTOMERI ' of 'BT130I_OPPT' component.

Also,fyi..this is a custom field.

I'm trying with the search help exit associated with this search help to push the default value but it is not working..

If search help exit is correct solution then can you please guide me how to do this or if there is other way please

let me know.

Regards

Anil

Former Member
0 Kudos

HI Reddy

Could you please help me out.

Former Member
0 Kudos

Hi All

Could you please help me out....here (pl see my above question in the previous threads)selection screen is nothing but

input parameters of search help...

Regards

Anil

Edited by: ANILKUMAR M on Dec 17, 2009 6:29 AM

Former Member
0 Kudos

Hi Anil,

Please check with the below code snippet:

1. Redefine the method GET_DQUERY_DEFINITIONS if it has already not been done so.

2. CALL METHOD super->get_dquery_definitions

RECEIVING

rt_result = rt_result.

3. LOOP AT rt_result ASSIGNING <rl_result> WHERE field = '.........'. (Here specify your selection attribute field name)

lw_ddlb_options11-key = <key1>.

lw_ddlb_options11-value = <value to be defaulted>.

INSERT lw_ddlb_options INTO <rl_result>-ddlb_options INDEX 1.

ENDLOOP.

Data types: lw_ddlb_options TYPE crms_thtmlb_search_ddlb_nvp,

FIELD-SYMBOLS: <rl_result> TYPE crms_thtmlb_search_field_info.

Hope this would help you.

Thanks and Regards,

Radhika

Former Member
0 Kudos

Hi Radhika

It seems your answer is wrt the search criteria but my requrement is related to the search help.

When we press F4 we will get a popup where in we will have few input parameters(input fields)

to enter values..now in this input fields i need to push a default value (dynamic value not the constant value).

Component: BT130I_OPPT

View : BT130I_OPPT/ItemDetails

Could you please suggest me..

Regards

Anil