cancel
Showing results for 
Search instead for 
Did you mean: 

issue with a event click in a table row

Former Member
0 Kudos

good morning!

I have a 'Z-assiment block', as you can see on screen. I have created a search help in a field. I have a problem, when I click on the help of search in row 1, the  result is show in row 2.

please, you know how can I fix it ?

million thanks

Accepted Solutions (1)

Accepted Solutions (1)

deepika_chandrasekar
Active Contributor
0 Kudos

Hi

Before you raise a popup take the row line from event if you are raising from outpound plug use the code

=>outbound_plug_event_info( EXPORTING iv_event_string = lv_event_string

                                                     
IMPORTING ev_index        = gv_index ).

and in close event from collection wrapper take entity using gv_index and then set the value.

lr_cw = me->typed_context->contextnodename->get_collection_wrapper( ).

      lr_it     
= lr_cw->get_iterator( ).

      lr_current
= lr_it->get_by_index( iv_index = gv_index )

lr_curren->set_property( iv_attr_name = 'Attrname' value = value ).

Regards,

Deepika.

Former Member
0 Kudos

thanks Deepika

very good idea,
but I do not know where to put your code.

regards

method GET_V_END_USER_ID.
  create object rv_valuehelp_descriptor
    type     cl_bsp_wd_valuehelp_navdescr
    exporting
      iv_outbound_plug = 'OP_SEL_USER '.

endmethod.

method OP_SEL_USER.
  data: lv_title type string,
          lr_cn    TYPE REF TO cl_bsp_wd_context_node_tv.

  lv_title = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT/EMPLOYEE_SEARCH' ).
  bpsearch_employee_popup = comp_controller->window_manager->create_popup(
                                                iv_interface_view_name = 'SearchHelpWindow'
                                                iv_usage_name = gv_emp_resp_search_usage
                                                iv_title = lv_title                        ).

  bpsearch_employee_popup->set_on_close_event( iv_view = me iv_event_name = 'SELBI_EMPL_RESP' ).

* set display mode
  bpsearch_employee_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).

* Open the Popup
  bpsearch_employee_popup->open( iv_inbound_plug = 'CLEAR_ALL' ).
endmethod.

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

You need to take gv_index in OP_SEL_USER beginning using

cl_chtmlb_config_utility=>outbound_plug_event_info( EXPORTING iv_event_string = lv_event_string

                                                     
IMPORTING ev_index        = gv_index ).

. then in close event 'SELBI_EMPL_RESP'  you need to take entity using gv_index and you need to set the value.

Regards,

Deepika.

Former Member
0 Kudos

thanks Deepika

but the data 'gv_index', where is declared?. it's a public  attribute of  the context class or the view class or in other site?

regards

deepika_chandrasekar
Active Contributor
0 Kudos

You need to declare global variable gv_index in implementation class as instance attribute so that u can use it in Outpound plug and close event.

Regards,

Deepika.

Former Member
0 Kudos

thanks Deepika

it works perfect

Answers (2)

Answers (2)

former_member211707
Active Participant
0 Kudos

Hello victor,

Please send your searchhelp close event handler code.

Thanks,

Amit

Former Member
0 Kudos

hello  Amit and thanks,

the code is:

  DATAlr_context_node                TYPE REF TO cl_bsp_wd_context_node,
         lr_current                                TYPE REF TO if_bol_bo_property_access,
         lr_entity                                   TYPE REF TO if_bol_bo_property_access,
         lv_outbound_plug                   TYPE seocmpname,
         lv_username                           TYPE string.

  lv_outbound_plug = bpsearch_employee_popup->get_fired_outbound_plug( ).
  CHECK lv_outbound_plug = 'TOOVERVIEW'.

  lr_context_node = bpsearch_employee_popup->get_context_node( iv_cnode_name = 'EMPLOYEE' ).

  lr_current = lr_context_node->collection_wrapper->get_current( ).

  CHECK lr_current IS BOUND.
  lv_username = lr_current->get_property_as_string( iv_attr_name = 'USERNAME' ).
  lr_entity  ?= me->typed_context->addrecord->collection_wrapper->get_current( ).
  lr_entity->set_property_as_string( iv_attr_name = 'END_USER_ID'
                                     iv_value     = lv_username ).

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

Here instead of taking collection->get_current take lr_current using

lr_cw = me->typed_context->contextnodename->get_collection_wrapper( ).

      lr_it     
= lr_cw->get_iterator( ).

      lr_current
= lr_it->get_by_index( iv_index = gv_index )

lr_curren->set_property( iv_attr_name = 'Attrname' value = value ).

Regards,

Deepika.

kumar5
Active Contributor
0 Kudos

Hi

How had you added the search help.

Have you used  below code to add search help


create object rv_valuehelp_descriptor type CL_BSP_WD_VALUEHELP_F4DESCR
exporting
*      iv_help_id        = 'CRMST_ADDRESS_BUIL-REGION'
iv_help_id        = '  '   “ search help name
iv_help_id_kind   = IF_BSP_WD_VALUEHELP_F4DESCR=>HELP_ID_KIND_NAME
iv_input_mapping  = lt_inmap
iv_output_mapping = lt_outmap.

there might be some problem with index . It seems that system is using the Index of second row when it comes back from the f4 help.

Former Member
0 Kudos

kumar thanks ,
I put the code in the other answers

regards

kumar5
Active Contributor
0 Kudos

Hi,

You need to put the code in the event (SELBI_EMPL_RESP) that is being called on POPUP  close

it will look like:

   lr_context_node = prodsearch_popup->get_context_node( iv_cnode_name = 'PRD' ).

       lr_current = lr_context_node->collection_wrapper->get_current( ).

      lr_cw      = get_collection_wrapper( context node name ).

       lr_it      = lr_cw->get_iterator( ).

       lr_current = lr_it->get_by_index( iv_index = gv_index ).

       lr_current->set_property( iv_attr_name = 'PRODUCT' iv_value = lr_product_guid->* ).