cancel
Showing results for 
Search instead for 
Did you mean: 

ovs help for multiple input fields

Former Member
0 Kudos

Hi All,

I have a requirement, i have two input fields by using OVS i have to display the description by the side of the input fields.

i done for the single input filed but for multiple fileds i tried alot but i can't,

can any one help me out from this issue.

Thanks & regards,

Madhan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI ,

In the event handler for ON_OVS event, there is a paramater named OVS_CALLBACK_OBJECT.

This is of type IF_WD_OVS.

Check this interface..There is a attribute named CONTEXT_ATTRIBUTE which will have the value of the Context Attribute binded to the input field on which F4 was pressed.

So put a conditional statement in the phase2 of OVS before populating table lt_select_list.

Somthing like this.

if ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ATTRIBUTE1'.
           select att1 from tab into TABLE lt_select_list.
      ELSEIF ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ATTRIBUTE2'.
          select att2 from tab into TABLE lt_select_list.
      endif.

should work.

Thanks,

Aditya.

Former Member
0 Kudos

Hi Aditya,

Thanks for ur replay.

the code which is given me helps me but when i am selecting 2nd input fields f4 help also coming but values sits in 1st input field and showing the text for 1st fields not for the 2nd.

i am attaching code which i used can u check n reply me

types:BEGIN OF lty_stru_input,

zznmvgr5 type tvm5t-MVGR5, " product code

TV_PRODUCTVODE TYPE tvm5t-BEZEI,

ZZNKDGRP TYPE T151T-KDGRP,

TV_CUSTGRP type T151T-KTEXT,

end of lty_stru_input.

TYPES : BEGIN OF lty_stru_list,

zznmvgr5 type tvm5t-MVGR5, " product code

TV_PRODUCTVODE TYPE tvm5t-BEZEI,

ZZNKDGRP TYPE T151T-KDGRP,

TV_CUSTGRP type T151T-KTEXT,

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 : zznmvgr5 type TVM5T-MVGR5, " product code

TV_PRODUCTVODE TYPE TVM5T-BEZEI.

DATA : ZZNKDGRP TYPE T151T-KDGRP,

TV_CUSTGRP type T151T-KTEXT.

DATA : node_name 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 = `ZZNMVGR5`. "must match a field name of search

ls_text-value = `Product Code`. "wd_assist->get_text( `001` ).

insert ls_text into table lt_label_texts.

ls_text-name = `ZZNKDGRP`. "must match a field name of search

ls_text-value = `Customer Grp`. "wd_assist->get_text( `001` ).

insert ls_text into table lt_label_texts.

ls_text-name = `TV_PRODUCTVODE`.

ls_text-value = `Description`.

insert ls_text into table lt_column_texts.

ls_text-name = `TV_CUSTGRP`. "must match a field in list structure

ls_text-value = `Description`. "wd_assist->get_text( `002` ).

insert ls_text into table lt_column_texts.

lv_window_title = 'Description'.

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.

when if_wd_ovs=>co_phase_2.

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.

*DATA : ls_select_list TYPE lty_stru_list.

if ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNMVGR5'.

SELECT MVGR5 BEZEI FROM tvm5t INTO TABLE lt_select_list.

ELSEIF ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNKDGRP'.

SELECT KDGRP KTEXT FROM T151T INTO TABLE lt_select_list.

endif.

ovs_callback_object->set_output_table( output = lt_select_list ).

when if_wd_ovs=>co_phase_3.

  • apply result

  • when if_wd_ovs=>co_phase_3.

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 = `ZZNMVGR5`

value = <ls_selection>-zznmvgr5 ).

ovs_callback_object->context_element->set_attribute(

name = `TV_PRODUCTVODE`

value = <ls_selection>-TV_PRODUCTVODE ).

endif.

assign ovs_callback_object->selection->* to <ls_selection>.

if <ls_selection> is assigned.

ovs_callback_object->context_element->set_attribute(

name = `ZZNKDGRP`

value = <ls_selection>-ZZNKDGRP ).

ovs_callback_object->context_element->set_attribute(

name = `TV_CUSTGRP`

value = <ls_selection>-TV_CUSTGRP ).

endif.

endcase.

ashish_shah
Contributor
0 Kudos

Hi,

>

> when if_wd_ovs=>co_phase_2.

> 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.

> *DATA : ls_select_list TYPE lty_stru_list.

>

> if ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNMVGR5'.

> SELECT MVGR5 BEZEI FROM tvm5t INTO TABLE lt_select_list.

>

> ELSEIF ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNKDGRP'.

> SELECT KDGRP KTEXT FROM T151T INTO TABLE lt_select_list.

> endif.

>

> ovs_callback_object->set_output_table( output = lt_select_list ).

Here you have written the correct logic to call the correct query based on Field Selected.

You need to write the same logic while passing data back to your input field.

> when if_wd_ovs=>co_phase_3.

> * apply result

>

> * when if_wd_ovs=>co_phase_3.

> 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.

Inserting the blow statement , will correct your problem.

if ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNMVGR5'.

> ovs_callback_object->context_element->set_attribute(

> name = `ZZNMVGR5`

> value = <ls_selection>-zznmvgr5 ).

ELSEIF ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNKDGRP'.

> ovs_callback_object->context_element->set_attribute(

> name = `TV_PRODUCTVODE`

> value = <ls_selection>-TV_PRODUCTVODE ).

ENDIF.

> endif.

>

>

>

> assign ovs_callback_object->selection->* to <ls_selection>.

>

> if <ls_selection> is assigned.

> ovs_callback_object->context_element->set_attribute(

> name = `ZZNKDGRP`

> value = <ls_selection>-ZZNKDGRP ).

> ovs_callback_object->context_element->set_attribute(

> name = `TV_CUSTGRP`

> value = <ls_selection>-TV_CUSTGRP ).

> endif.

>

>

> endcase.

Hope it helps.

Regards,

Ashish shah

Former Member
0 Kudos

HI ,

I guess in the last phase again you need to check which node(or rather attribute) is in question and bind the values according to that.

A conditional statement similar to phase2 is needed.

Thanks.,

Aditya.

Former Member
0 Kudos

Hi All,

Thanks for ur replay ,

Once again same problem 2nd input fields is showing me balnk up to phase1 it is working fine. after that values are not getting.

can u people help me out .

thanks ,

Madhan

ashish_shah
Contributor
0 Kudos

Did you write code that i suggested in Phase 3?

Can you explain what is Exactly happening?

Former Member
0 Kudos

hi ,

I used same code as u mention , for 1st input field every thing is fine.Bu for the 2nd input field upto selection it is working fine after selecting the specific one and clicking on ok data is not coming.

why it is happening lyk that.

thanks ,

madhan

Former Member
0 Kudos

hi ,

I used same code as u mention , for 1st input field every thing is fine.Bu for the 2nd input field upto selection it is working fine after selecting the specific one and clicking on ok data is not coming.

why it is happening lyk that.

thanks ,

madhan

Former Member
0 Kudos

Hi Madhan,

Put a breakpoint in the 'if' condition of Phase3 and check the value in <ls_selection>.

Also check the column names of ls_selection and check if you have used the proper column.

And also..please post your complete code once .

Thanks,

Aditya.

Edited by: Aditya Karanth on Apr 8, 2011 12:24 PM

Former Member
0 Kudos

Hi,

Can you do this test case. 1st try to select a value in 2nd input field...

then check for 1st input field. check wether you are getting the 2nd field's description up on 1st field selection.

As you have selected the value for 2nd field right.

If the ls_selection is assigned, try to unassign this field symbol at last and test it.

Regards,

Lekha.

Former Member
0 Kudos

hi all,

thanks for ur replies,

i found the bug why it is going to dump.but iam unable slove it. in phase 3 selection having a problem here i am attaching code can any one slove it .When i am selecting 2nd input it is going to 1st assinged one

assign ovs_callback_object->selection->* to <ls_selection>.

here is my code

when if_wd_ovs=>co_phase_3.

  • when if_wd_ovs=>co_phase_3.

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.

if ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNMVGR5'.

ovs_callback_object->context_element->set_attribute(

name = `ZZNMVGR5`

value = <ls_selection>-zznmvgr5 ).

ovs_callback_object->context_element->set_attribute(

name = `TV_PRODUCTVODE`

value = <ls_selection>-TV_PRODUCTVODE ).

endif.

endif.

if ovs_callback_object->selection is not bound.

                • TODO exception handling

endif.

assign ovs_callback_object->selection->* to <ls_selection1>.

if <ls_selection1> is assigned.

if ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNKDGRP'.

*

ovs_callback_object->context_element->set_attribute(

name = `ZZNKDGRP`

value = <ls_selection1>-ZZNKDGRP ).

ovs_callback_object->context_element->set_attribute(

name = `TV_CUSTGRP`

value = <ls_selection1>-TV_CUSTGRP ).

endif.

ENDIF.

Former Member
0 Kudos

Hi all,

Thanks for ur replies i solved it. with out u people it can't be solved

thanks for spending ur valuable time for my issue.

With Thanks & regards

Madhan

ashish_shah
Contributor
0 Kudos

Hi,

You need to understand what is your mistake in the code.

You are writing same code at two places without checking the proper conditions.

Following is the correct code:


when if_wd_ovs=>co_phase_3.

assign ovs_callback_object->selection->* to <ls_selection>.

if <ls_selection> is assigned.

if ovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNMVGR5'.

ovs_callback_object->context_element->set_attribute(
name = `ZZNMVGR5`
value = <ls_selection>-zznmvgr5 ).

elseifovs_callback_object->CONTEXT_ATTRIBUTE CS 'ZZNKDGRP'.

ovs_callback_object->context_element->set_attribute(
name = `TV_PRODUCTVODE`
value = <ls_selection>-TV_PRODUCTVODE ).

endif.

endif.

This should solve your problem.

Regards,

Ashish Shah

ashish_shah
Contributor
0 Kudos

Hi,

Please mark the thread as answered.

Regards,

Ashish Shah

Answers (1)

Answers (1)

Former Member
0 Kudos

thanks to ashish for giving idea to solve my issue by using attaributes

a very help full answer from him