cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning search help to Table UI

former_member185241
Active Participant
0 Kudos

Hi All,

I have a table ui element having three column item_no, price, description.

In all three column user have to enter data.

I have attached a search help on item_no which shows item_no, price, and description.

So user can do F4 on item_no and all available item with price and description will appear.

Now when user select any item all the information should get inserted in the table UI Element.

Here i am able to do F4. but when any row is selected how to place selected item detail into table row.

Please give your suggestion.

Thanks and Regards

Abhishek

Accepted Solutions (1)

Accepted Solutions (1)

chengalarayulu
Active Contributor
0 Kudos

Hi Abhishek,

if it is standard SHLP, just track this to your custom SHLP(Search Help) i.e. OVS/FreelyProgrammed etc...

there you can easily fill multiple columns/filed values.

if you use OVS, that will make you very easy. there in PHASE-3 you can set all (item_no, price, description) even more.

thaks.

former_member185241
Active Participant
0 Kudos

Hi Cheng,

I am using OVS first time .

I edited the code. but it is showing dump..
check no . my code..

method ON_OVS .

* declare data structures for the fields to be displayed and

* for the table columns of the selection list, if necessary

  types:

    begin of lty_stru_input,

*   add fields for the display of your search input here

      field1 type string,

    end of lty_stru_input.

  types:

    begin of lty_stru_list,

*   add fields for the selection list here

*      column1 type string,

      item_no TYPE zitem_no,

      descp   TYPE zdescription,

      brand   TYPE zbrand,

      price   TYPE zprice,

    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,

        lv_item          TYPE zitem_no.

  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.  "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 = `FIELD1`.  "must match a field name of search

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

*      insert ls_text into table lt_label_texts.

*

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

*      ls_text-value = `MYTEXT2`. "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 = ???

* Read the context 'Item_no' to get the value of the Item_no

CALL METHOD ovs_callback_object->context_element->get_attribute

    EXPORTING

      name = 'ITEM_NO'

    IMPORTING

      value = lv_item .

SELECT SINGLE *

    FROM  zzproduct

    INTO CORRESPONDING FIELDS OF TABLE lt_select_list

    WHERE item_no  =  lv_item .

      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.

      CALL METHOD ovs_callback_object->context_element->get_attribute

    EXPORTING

      name = 'ITEM_NO'

    IMPORTING

      value = lv_item .

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

      if <ls_selection> is assigned.

        ovs_callback_object->context_element->set_attribute(

                               name  = 'DESCRIPTION'

                               value = <ls_selection>-descp ).

*      or

*        ovs_callback_object->context_element->set_static_attributes(

*                               static_attributes = <ls_selection> ).

      endif.

  endcase.

endmethod.

Thanks

Former Member
0 Kudos

Put an external breakpoint on the method and see where the code is giving dump.

chengalarayulu
Active Contributor
0 Kudos

Try with the below code:

   * declare data structures for the fields to be displayed and

* for the table columns of the selection list, if necessary

TYPES:

*    BEGIN OF lty_stru_input,

*   add fields for the display of your search input here

*      field1 TYPE string,

*    END OF lty_stru_input.

  TYPES:

    BEGIN OF lty_stru_list,
      item_no TYPE zitem_no,
      descp   TYPE zdescription,
      brand   TYPE zbrand,
      price   TYPE zprice,
    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,
        lv_item          TYPE zitem_no.


  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.  "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 = `FIELD1`.  "must match a field name of search

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

*      insert ls_text into table lt_label_texts.

*

      ls_text-name = `ITEM_NO`"must match a field in list structure
      ls_text-value = `Item No.`. "wd_assist->get_text( `002` ).

      INSERT ls_text INTO TABLE lt_column_texts.

      ls_text-name = `DESCP`"must match a field in list structure
      ls_text-value = `Description`. "wd_assist->get_text( `002` ).

      INSERT ls_text INTO TABLE lt_column_texts.

      ls_text-name = `BRAND`"must match a field in list structure
      ls_text-value = `Brand`. "wd_assist->get_text( `002` ).

      INSERT ls_text INTO TABLE lt_column_texts.

      ls_text-name = `PRICE`"must match a field in list structure
      ls_text-value = `Price`. "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    = 4
                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 = ???

* Read the context 'Item_no' to get the value of the Item_no

      CALL METHOD ovs_callback_object->context_element->get_attribute
        EXPORTING
          name  = 'ITEM_NO'
        IMPORTING
          value = lv_item.

      SELECT SINGLE *
          FROM  zzproduct
          INTO CORRESPONDING FIELDS OF TABLE lt_select_list
          WHERE item_no  =  lv_item .

      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  = 'DESCRIPTION'
                               value = <ls_selection>-descp ).

        ovs_callback_object->context_element->set_attribute(
                               name  = 'ITEM_NO'
                               value = <ls_selection>-item_no ).

        ovs_callback_object->context_element->set_attribute(
                               name  = 'PRICE'
                               value = <ls_selection>-price ).

        ovs_callback_object->context_element->set_attribute(
                               name  = 'BRAND'
                               value = <ls_selection>-brand ).

      ENDIF.

  ENDCASE.

former_member185241
Active Participant
0 Kudos

Thank you Cheng Sir... 🙂

You Are Genius..

Thanks alot..

🙂 It is working correctly

Answers (1)

Answers (1)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Try using OVS search help and then in phase3, do the assignment as required.