on 08-26-2014 11:36 AM
Dear friends
i entered in ovs help "gmr" in search criteria and then i pressed search ,
i dint get any thing in output
but i should get
"GMR Construction Pvt Ltd"
below is my select statement in business logic
SELECT lifnr name1 FROM lfa1 INTO CORRESPONDING
FIELDS OF TABLE lt_lfa1
WHERE lifnr LIKE lv_lifnr AND
name1 LIKE lv_name1.
could any one let me know what is missing in my select statement
Thanks
Srini
As kathik said add GMR* and write the code as per below code
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>-job_id.
REPLACE ALL OCCURRENCES OF '*' IN lv_short 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 )
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
ORDER BY short ASCENDING.
ELSEIF lv_short 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
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 = `JOB_ID`
value = <ls_selection>-short ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you need to add * in the OVS help input field and then replace those * with % and build a select query.
Write the below code in OVS phase2
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.
" Here <ls_query_params> contains the entered input value.
" U need to replace * with % while fetching from DB
replace all occurrences of '*' in <ls_query_params>-ename with '%'.
SELECT lifnr name1 FROM lfa1 INTO CORRESPONDING
FIELDS OF TABLE lt_lfa1
WHERE name1 LIKE <ls_query_params>-ename.
ovs_callback_object->set_output_table( output = lt_select_list ).
If you don't want to enter * in the input, then concatenate % at the start and end of the string value
hope this helps,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.