cancel
Showing results for 
Search instead for 
Did you mean: 

How to check whether clicked on a hotspot

Former Member
0 Kudos

Hi,

I have a requirement for checking whether i have clicked on the hotspot or not in interactive ALV in WDA.

What is the sy-ucomm for that?

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

There won't be any sy-ucomm value in WDA. Take one attribute( flag ) in component controller and set it to X in on_click event of ALV. ( You need to create an event handler method for on_click event of ALV and set the flag inside the method ).

Hope this helps u.,

Regards,

Kiran.

Former Member
0 Kudos

Hi,

I have used the select-options for inputting vbeln field.

The primary listy of ALV contains header details of all vbeln field entered.

The secondary list should contain item details of each vbeln selected.

This was my requirement.

But if I enter vbeln as 51-55 as input.

The primary list is fine.

But when i click on 55 the item details of 51 will come.

When I click on 51 the details are fine.

So how to capture the vbeln value when iam clicking on the hotspot.

Below is the code which i used for on_click event for alv.

   method ACTIONON_CLICK .
DATA lo_nd_header TYPE REF TO if_wd_context_node.
  DATA lo_el_header TYPE REF TO if_wd_context_element.
  DATA ls_header TYPE wd_this->element_header.
  DATA lv_vbeln LIKE ls_header-vbeln.
* navigate from <CONTEXT> to <HEADER> via lead selection
  lo_nd_header = wd_context->get_child_node( name = wd_this->wdctx_header ).

* get element via lead selection
  lo_el_header = lo_nd_header->get_element(  ).

* get single attribute
  lo_el_header->get_attribute(
    EXPORTING
      name =  `VBELN`
    IMPORTING
      value = lv_vbeln ).


*    DATA lo_nd_header TYPE REF TO if_wd_context_node.
*    DATA lo_el_header TYPE REF TO if_wd_context_element.
*    DATA ls_header TYPE wd_this->element_header.
     DATA lt_header TYPE wd_this->elements_header.
*   navigate from <CONTEXT> to <HEADER> via lead selection
    lo_nd_header = wd_context->get_child_node( name = wd_this->wdctx_header ).

*   get element via lead selection
    lo_el_header = lo_nd_header->get_element(  ).

*   get all declared attributes
    lo_el_header->get_static_attributes(
      IMPORTING
        static_attributes = ls_header ).


  DATA lo_nd_item TYPE REF TO if_wd_context_node.
  DATA lo_el_item TYPE REF TO if_wd_context_element.
  DATA ls_item TYPE wd_this->element_item.
   DATA lT_item TYPE wd_this->elementS_item.
* navigate from <CONTEXT> to <ITEM> via lead selection
  lo_nd_item = wd_context->get_child_node( name = wd_this->wdctx_item ).

* @TODO handle not set lead selection
  IF lo_nd_item IS INITIAL.
  ENDIF.

* get element via lead selection
  lo_el_item = lo_nd_item->get_element(  ).

* @TODO handle not set lead selection
  IF lo_el_item IS INITIAL.
  ENDIF.




SELECT * FROM VBAP INTO TABLE LT_ITEM WHERE VBELN = lv_vbeln.

data:
  Node_cust type REF TO IF_WD_CONTEXT_NODE.
  Node_cust = wd_Context->get_Child_Node( Name = `ITEM` ).
* bind internal table to context node <SFLIGHT>
  Node_cust->Bind_Table( lt_ITEM ).

    wd_this->fire_secondary_list_plg(
    ).

endmethod.

former_member184578
Active Contributor
0 Kudos

Hi,

dont use get_attribute method to get the selected value. the selected value will be available in r_param->value

use ,

field-symbols <fv_vbeln> type vbeln.

  assign r_param->value->* to <fv_vbeln>.

Now <fv_vbeln> contains the clicked or selected value.

use the <fv_vbeln> and populate the item table.

Hope this helps u.,

Thanks & Regards,

Kiran.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks Kiran.

It worked.