cancel
Showing results for 
Search instead for 
Did you mean: 

Search help

Former Member
0 Kudos

Hi,

There is no input help to one of my parameters which i added to the selection screen using ADD_PARAMETER_FIELD. I want to provide a search help for that.

Please provide me any solution.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Dande,

If your parameter fields are of data dictionary type then search help is available to you automatically, or you will have to design custom search help for those fields. So you could go for OVS or freely progarmmed input help.

Regards,

Srini Gollakaram.

Former Member
0 Kudos

Is it a Data dictionary search help ?

Former Member
0 Kudos

Hi,

I want to define customizing search help

Former Member
0 Kudos

Hi Dande,

Below code will help you regarding dictionary/customizing search help.

data: rt_handler type ref to IF_WD_SELECT_OPTIONS.

* Create range table for the field
  lt_range_table = rt_handler->create_range_table( i_typename = 'ATTR_DOM_NAME' ). 
  rt_handler->add_parameter_field(
                 i_id           = 'ATTR_NAME'
                 it_result      = lt_range_table 
                 i_read_only    = read_only
                 I_description  = 'Description'
* this is for customizing value help
                 i_value_help_type = if_wd_value_help_handler=>co_prefix_ovs  
                 i_no_intervals = abap_true ).

After this, you will have to define method for OVS event of SELECT OPTION usage

*****************************************

similarly if you want to given dictionary help, few parameters have to be changed as below.

rt_handler->add_parameter_field(
                 i_id           = 'ATTR_NAME'
                 it_result      = lt_range_table 
                 i_read_only    = read_only
                 I_description  = 'Description'
* this is for disctionary value help
                 i_value_help_id = 'SEARCH_HELP_NAME' "from dictionary
                 i_value_help_type = if_wd_value_help_handler=>co_prefix_searchhelp
                 i_no_intervals = abap_true ).
Regards,

Manne.

Former Member
0 Kudos

Hi,

How to use OVS help in ADD_SELECTION_FIELD method

Former Member
0 Kudos

Hi,

Most of the parameter fields are common for both the methods ADD_SELECTION_FIELD & ADD_PARAMETER_FIELD. Any how below are the steps to use OVS value help for ADD_SELECTION_FIELD.

1. Declare the usage of WD component WDR_SELECT_OPTIONS in the PROPERTIES tab of VIEW

2. Write the below code in the WDINIT method to initialize the selection field

data: rt_handler type ref to IF_WD_SELECT_OPTIONS.
* Create range table for the field
  lt_range_table = rt_handler->create_range_table( i_typename = 'ATTR_DOM_NAME' ). 
  rt_handler->add_selection_field(
                 i_id           = 'ATTR_NAME'
                 it_result      = lt_range_table 
                 I_description  = 'Description'
" this is for customizing value help using OVS
                 i_value_help_type = if_wd_value_help_handler=>co_prefix_ovs  
                 i_no_intervals = abap_true ).

3. Create a method for value help with name 'TEST_NAME' subscribing to ON_OVS event of SELECT_OPTIONS

4. Now inside this 'TEST_NAME' method, write a code to display pop up contents & to select values as shown below.

"Check for which selection field this method was called
if I_OVS_DATA-M_SELECTION_FIELD_ID = 'ATTR_NAME'.
 " here the actual OVS code to get value help pop up & for selecting values
 " the format of dummy code with proper comments will already be generated and
 " you have to write code by just following the generated comments.
endif..

Hope this helps.

Regards,

Manne.

Former Member
0 Kudos

Hi,

I have created one blog regarding OVS Help in WDA.You can refer that.

[OVS Help in WDA|/people/shruti.rathour/blog/2008/05/05/ovs-help-in-web-dynpro-abap ]

Regards

Shruti

Former Member
0 Kudos

Hi,

I am using the following code in wd_init

LT_RANGE_TABLE = WD_THIS->M_HANDLER->CREATE_RANGE_TABLE(

I_TYPENAME = 'RCF_APPL_SOURCE' ).

  • add a new field to the selection

WD_THIS->M_HANDLER->ADD_SELECTION_FIELD(

I_ID = 'RCF_APPL_SOURCE'

i_value_help_type =

if_wd_value_help_handler=>co_prefix_ovs

  • I_VALUE_HELP_ID = 'ON_OVS'

  • I_VALUE_HELP_STRUCTURE = 'HRP5132'

  • I_VALUE_HELP_STRUCTURE_FIELD = 'APPL_SOURCE'

IT_RESULT = LT_RANGE_TABLE I_READ_ONLY = READ_ONLY ).

i created method on_ovs subscribing to select -options and the code is below.

TYPES:

BEGIN OF LTY_STRU_INPUT,

  • add fields for the display of your search input here

APPSRC TYPE STRING,"rcf_appl_source,

DESCRIPTION TYPE STRING,"rcf_appl_source_txt,

END OF LTY_STRU_INPUT.

TYPES:

BEGIN OF LTY_STRU_LIST,

  • add fields for the selection list here

SHORT TYPE SHORT_D,

STEXT TYPE STEXT,

END OF LTY_STRU_LIST.

DATA: LS_SEARCH_INPUT TYPE LTY_STRU_INPUT,

LT_SELECT_LIST TYPE STANDARD TABLE OF LTY_STRU_LIST,

LS_TEXT TYPE WDR_NAME_VALUE,

LT_LABEL_TEXTS TYPE WDR_NAME_VALUE_LIST,

LT_COLUMN_TEXTS TYPE WDR_NAME_VALUE_LIST,

LV_WINDOW_TITLE TYPE STRING,

LV_GROUP_HEADER TYPE STRING,

LV_TABLE_HEADER TYPE STRING.

FIELD-SYMBOLS: <LS_QUERY_PARAMS> TYPE LTY_STRU_INPUT,

<LS_SELECTION> TYPE LTY_STRU_LIST.

DATA : LV_SHORT TYPE STRING,

LV_STEXT TYPE STRING.

CASE OVS_CALLBACK_OBJECT->PHASE_INDICATOR.

WHEN IF_WD_OVS=>CO_PHASE_0. "configuration phase, may be omitted

  • in this phase you have the possibility to define the texts,

  • if you do not want to use the defaults (DDIC-texts)

LS_TEXT-NAME = `APPSRC`. "must match a field name of search

LS_TEXT-VALUE = `Application Source`. "wd_assist->get_text( `001` ).

INSERT LS_TEXT INTO TABLE LT_LABEL_TEXTS.

LS_TEXT-NAME = `DESCRIPTION`. "must match a field in list structure

LS_TEXT-VALUE = `Application Source Description`. "wd_assist->get_text( `002` ).

INSERT LS_TEXT INTO TABLE LT_COLUMN_TEXTS.

LS_TEXT-NAME = `SHORT`. "must match a field in list structure

LS_TEXT-VALUE = `Application Source`. "wd_assist->get_text( `002` ).

INSERT LS_TEXT INTO TABLE LT_COLUMN_TEXTS.

LS_TEXT-NAME = `STEXT`. "must match a field in list structure

LS_TEXT-VALUE = `Application Source Description`. "wd_assist->get_text( `002` ).

INSERT LS_TEXT INTO TABLE LT_COLUMN_TEXTS.

  • lv_window_title = wd_assist->get_text( `003` ).

  • lv_group_header = wd_assist->get_text( `004` ).

  • lv_table_header = wd_assist->get_text( `005` ).

OVS_CALLBACK_OBJECT->SET_CONFIGURATION(

LABEL_TEXTS = LT_LABEL_TEXTS

COLUMN_TEXTS = LT_COLUMN_TEXTS

GROUP_HEADER = LV_GROUP_HEADER

WINDOW_TITLE = LV_WINDOW_TITLE

TABLE_HEADER = LV_TABLE_HEADER

COL_COUNT = 2

ROW_COUNT = 20 ).

WHEN IF_WD_OVS=>CO_PHASE_1. "set search structure and defaults

  • In this phase you can set the structure and default values

  • of the search structure. If this phase is omitted, the search

  • fields will not be displayed, but the selection table is

  • displayed directly.

  • Read values of the original context (not necessary, but you

  • may set these as the defaults). A reference to the context

  • element is available in the callback object.

OVS_CALLBACK_OBJECT->CONTEXT_ELEMENT->GET_STATIC_ATTRIBUTES(

IMPORTING STATIC_ATTRIBUTES = LS_SEARCH_INPUT ).

  • pass the values to the OVS component

OVS_CALLBACK_OBJECT->SET_INPUT_STRUCTURE(

INPUT = LS_SEARCH_INPUT ).

WHEN IF_WD_OVS=>CO_PHASE_2.

  • If phase 1 is implemented, use the field input for the

  • selection of the table.

  • If phase 1 is omitted, use values from your own context.

IF OVS_CALLBACK_OBJECT->QUERY_PARAMETERS IS NOT BOUND.

                • TODO exception handling

ENDIF.

ASSIGN OVS_CALLBACK_OBJECT->QUERY_PARAMETERS->*

TO <LS_QUERY_PARAMS>.

IF NOT <LS_QUERY_PARAMS> IS ASSIGNED.

                • TODO exception handling

ENDIF.

  • call business logic for a table of possible values

  • lt_select_list = ???

LV_SHORT = <LS_QUERY_PARAMS>-APPSRC.

LV_STEXT = <LS_QUERY_PARAMS>-DESCRIPTION.

REPLACE ALL OCCURRENCES OF '*' IN LV_SHORT WITH '%' .

REPLACE ALL OCCURRENCES OF '*' IN LV_STEXT WITH '%' .

IF LV_SHORT NE ' ' AND LV_STEXT NE ' '.

SELECT SHORT STEXT

FROM HRP1000

INTO TABLE LT_SELECT_LIST

WHERE PLVAR = '01'

AND OTYPE = 'C'

AND LANGU = 'EN'

AND ENDDA GE SY-DATUM

AND ( SHORT LIKE LV_SHORT

AND STEXT LIKE LV_STEXT )

ORDER BY SHORT ASCENDING.

ELSEIF LV_SHORT EQ ' '

AND LV_STEXT NE ' '.

SELECT SHORT STEXT

FROM HRP1000

INTO TABLE LT_SELECT_LIST

WHERE PLVAR = '01'

AND OTYPE = 'C'

AND LANGU = 'EN'

AND ENDDA GE SY-DATUM

AND STEXT LIKE LV_STEXT

ORDER BY SHORT ASCENDING.

ELSEIF LV_SHORT NE ' '

AND LV_STEXT EQ ' '.

SELECT SHORT STEXT

FROM HRP1000

INTO TABLE LT_SELECT_LIST

WHERE PLVAR = '01'

AND OTYPE = 'C'

AND LANGU = 'EN'

AND ENDDA GE SY-DATUM

AND SHORT LIKE LV_SHORT

ORDER BY SHORT ASCENDING.

ENDIF.

OVS_CALLBACK_OBJECT->SET_OUTPUT_TABLE( OUTPUT = LT_SELECT_LIST ).

WHEN IF_WD_OVS=>CO_PHASE_3.

  • apply result

IF OVS_CALLBACK_OBJECT->SELECTION IS NOT BOUND.

                • TODO exception handling

ENDIF.

ASSIGN OVS_CALLBACK_OBJECT->SELECTION->* TO <LS_SELECTION>.

IF <LS_SELECTION> IS ASSIGNED.

OVS_CALLBACK_OBJECT->CONTEXT_ELEMENT->SET_ATTRIBUTE(

NAME = `APPSRC`

VALUE = <LS_SELECTION>-SHORT ).

OVS_CALLBACK_OBJECT->CONTEXT_ELEMENT->SET_ATTRIBUTE(

NAME = `DESCRIPTION`

VALUE = <LS_SELECTION>-STEXT ).

  • ovs_callback_object->context_element->set_attribute(

  • name = `COLUMN1`

  • value = <ls_selection>-column1 ).

  • or

  • ovs_callback_object->context_element->set_static_attributes(

  • static_attributes = <ls_selection> ).

ENDIF.

ENDCASE.

please correct me

Former Member
0 Kudos

Hi,

It would have been good if you copied the code in the code editor. The current format is tough to understand. Any how you can refer to standard webdynpro test component for select options WDR_TEST_SELECT_OPTIONS->MAIN_VIEW.

In the above view, check method ONACTIONON_ADD_FIELD to see how to add different kinds of selection fields and one of them will be OVS.

For OVS coding, check method ON_OVS to see how to code using ovs to get desired value help popup.

Regards,

Manne.