Hi Amy
I want to mention that I call that input field (having ovs) by a link ie I have applied visibility on that input field .Can any problem by doing that? I have used the code as
METHOD POSITION_TEXT .
* declare data structures for the fields to be displayed and
* for the table columns of the selection list, if necessary
TYPES:
BEGIN OF T_STRU_INPUT,
* add fields for the display of your search input here
PLSTX TYPE STRING,
END OF T_STRU_INPUT,
BEGIN OF T_STRU_LIST,
* add fields for the selection list here
PLSTX TYPE STRING,
END OF T_STRU_LIST.
DATA: L_SEARCH_INPUT TYPE T_STRU_INPUT,
L_SELECT_LIST TYPE STANDARD TABLE OF T_STRU_LIST,
L_TEXT TYPE WDR_NAME_VALUE,
L_LABEL_TEXTS TYPE WDR_NAME_VALUE_LIST,
L_COLUMN_TEXTS TYPE WDR_NAME_VALUE_LIST,
L_WINDOW_TITLE TYPE STRING,
L_GROUP_HEADER TYPE STRING,
L_TABLE_HEADER TYPE STRING.
FIELD-SYMBOLS: <QUERY_PARAMS> TYPE T_STRU_INPUT,
<SELECTION> TYPE T_STRU_LIST.
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)
L_TEXT-NAME = `PLSTX`. "must match a field name of search
L_TEXT-VALUE = `PLSTX`. "wd_assist->get_text( `001` ).
INSERT L_TEXT INTO TABLE L_LABEL_TEXTS.
L_TEXT-NAME = `PLSTX`. "must match a field in list structure
L_TEXT-VALUE = `PLSTX`. "wd_assist->get_text( `002` ).
INSERT L_TEXT INTO TABLE L_COLUMN_TEXTS.
* l_window_title = wd_assist->get_text( `003` ).
* l_group_header = wd_assist->get_text( `004` ).
* l_table_header = wd_assist->get_text( `005` ).
OVS_CALLBACK_OBJECT->SET_CONFIGURATION(
LABEL_TEXTS = L_LABEL_TEXTS
COLUMN_TEXTS = L_COLUMN_TEXTS
GROUP_HEADER = L_GROUP_HEADER
WINDOW_TITLE = L_WINDOW_TITLE
TABLE_HEADER = L_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 = L_SEARCH_INPUT ).
* pass the values to the OVS component
* OVS_CALLBACK_OBJECT->SET_INPUT_STRUCTURE(
* INPUT = L_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 <QUERY_PARAMS>.
IF NOT <QUERY_PARAMS> IS ASSIGNED.
******** TODO exception handling
ENDIF.
* call business logic for a table of possible values
* l_select_list = ???
SELECT PLSTX FROM T528T INTO TABLE L_SELECT_LIST UP TO 10 ROWS WHERE SPRSL = SY-LANGU
.
OVS_CALLBACK_OBJECT->SET_OUTPUT_TABLE( OUTPUT = L_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 <SELECTION>.
IF <SELECTION> IS ASSIGNED.
OVS_CALLBACK_OBJECT->CONTEXT_ELEMENT->SET_ATTRIBUTE(
NAME = `PLSTX`
VALUE = <SELECTION>-PLSTX ).
* or
* ovs_callback_object->context_element->set_static_attributes(
* static_attributes = <selection> ).
ENDIF.
ENDCASE.
ENDMETHOD.