cancel
Showing results for 
Search instead for 
Did you mean: 

OVS in Table

Former Member
0 Kudos

Hi Guru's

I used table in webdynpro component. I created ovs for one column .

while running application it showing f4 window when i select  data its not displaying in table.

Regards,

Meena.R

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi meenachi,.

Here the problem is with the quotes ( 'CUST_MAT_CODE' )

your code should be like this

  ovs_callback_object->context_element->set_attribute(


                               name  = ( `CUST_MAT_CODE` ) instead u write this 'CUST_MAT_CODE '


                               value = <ls_selection>-this should be a field name on which field u r using F4 button ).

Thanks and regards,

Vijay

Former Member
0 Kudos

did you try to bind value in table

Former Member
0 Kudos

TYPES : BEGIN OF ty_inv,

          matnr type matnr,
          END OF ty_inv.



  DATA : lt_inv TYPE STANDARD TABLE OF ty_inv,

         wa_inv TYPE ty_inv.



* Logic to Enable Table Control Columns

  DO 10 TIMES.

    APPEND wa_inv TO lt_inv.

  ENDDO.



  DATA lo_nd_complaint TYPE REF TO if_wd_context_node.

  lo_nd_complaint = wd_context->get_child_node( name = wd_this->wdctx_complaint_items ).

  lo_nd_complaint->bind_table( new_items = lt_inv set_initial_elements = abap_true ).

I wrote this code in my doinit..

actually this code to enable table rows.. is it correct?

Meena.R

Former Member
0 Kudos

In phase_3 you should modify particular row  from table with ovs result and again bind it with node.

Former Member
0 Kudos

In phase_3 you should modify particular row  from table with ovs result and again bind it with node.

Former Member
0 Kudos

  In phase 3 i wrote this coding..

WHEN if_wd_ovs=>co_phase_3.

        ASSIGN ovs_callback_object->selection->* TO <ls_selection>.

        IF <ls_selection> IS ASSIGNED.

        ovs_callback_object->context_element->set_attribute(

                               name  = `CUST_MAT_CODE`

                               value = <ls_selection>-CUST_MAT_CODE ).

whether i need to bind again?
Meena

Former Member
0 Kudos

there instead of

ovs_callback_object->context_element->set_attribute(

                               name  = `CUST_MAT_CODE`

                               value = <ls_selection>-CUST_MAT_CODE ).

you have to get table row from which ovs is executed. modify that particular row and bind it again with node

steps to do this :-

1. get element based on lead selection. by using if_wd_context_node method get_lead_selection.

2. get row by using if_wd_context_element method get_static_attribute.

3. modify this row .

4. bind agiain with element.

reward point if helpful

amy_king
Active Contributor
0 Kudos

Hi Meena,

Your phase 3 code looks correct. The object ovs_callback_object->context_element is the context element which requested the OVS input help, so you don't need to read the lead selection manually. Perhaps it is a problem with the quotes as Vijay suggested. Try retyping 'CUST_MAT_CODE' with single quotes from the keyboard instead of a copy-paste from elsewhere. If that doesn't work, try setting a break-point and seeing what happens inside the call to

ovs_callback_object->context_element->set_attribute; it sounds like maybe it isn't finding context attribute 'CUST_MAT_CODE'. And if that doesn't work, could you please post the whole of your on_ovs method?

If it is helpful, you can also check your component usage and on_ovs code against this document, .

Cheers,

Amy

amy_king
Active Contributor
0 Kudos

Hi Meena,

Yes, I use this same approach to append initial rows to a table that is ready for user input. You can also shorten the code by using APPEND INITIAL LINE and eliminate the need for an explicit workarea...

method supply_table .

   data lt_table type wd_this->elements_table.

   do 5 times.
     append initial line to lt_table.
   enddo.

   node->bind_table(
     new_items                 = lt_table
     set_initial_elements = abap_true ).

endmethod.

Cheers,

Amy

Former Member
0 Kudos

Dear Amy,

Thanks for reply..

Here is my code .. i tried as you said but still its not selecting to row

types:  begin of lty_stru_input,

          field1 type string,

        end of lty_stru_input.



types:    BEGIN OF lty_stru_list,

              cust_mat_code TYPE knmt-kdmat,

*              FEN_MAT_CODE TYPE knmt-matnr,

          END OF lty_stru_list.



types: begin of lty_empty,

        text(40) type c,

        end of lty_empty.



DATA:   lt_select_list   TYPE STANDARD TABLE OF lty_stru_list,

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



DATA :       lo_nd_header     TYPE REF TO if_wd_context_node,

             lo_el_header     TYPE REF TO if_wd_context_element,

             lv_userid        TYPE        wd_this->element_header-user_id,

             lt_mat_bapisditm TYPE TABLE OF bapisditm,

             ls_mat_bapisditm TYPE        bapisditm,

             lv_tabix         TYPE        sy-tabix.





FIELD-SYMBOLS: <ls_query_params> type lty_stru_input,

                <ls_selection> TYPE lty_stru_list.



CASE ovs_callback_object->phase_indicator.



   WHEN if_wd_ovs=>co_phase_0.



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

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

      INSERT ls_text INTO TABLE lt_label_texts.

      CLEAR ls_text.



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

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

      INSERT ls_text INTO TABLE lt_column_texts.

      clear ls_text.

      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.


      lo_nd_header = wd_context->get_child_node( name = wd_this->wdctx_header ).

      lo_el_header = lo_nd_header->get_element(  ).

      lo_el_header->get_attribute(

        EXPORTING

          name =  `USER_ID`

        IMPORTING

          value = lv_userid ).



      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

        EXPORTING

          input  = lv_userid

        IMPORTING

          output = lv_userid.



SELECT kdmat FROM knmt INTO TABLE lt_select_list WHERE kunnr = lv_userid.



             ovs_callback_object->set_output_table( output = lt_select_list ).



    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  = 'CUST_MAT_CODE'

                               value = <ls_selection>-cust_mat_code ).



ENDIF.

  ENDCASE.

Former Member
0 Kudos

hi amy,

Not only for this field for entire row f4 is not working..

Meena

Former Member
0 Kudos

hey Amy,

Thanks. It was working now.

The issue is due to context binding in table control

Meena