cancel
Showing results for 
Search instead for 
Did you mean: 

Placing Cursor in a Table Cell (DropDownByIndex)

Former Member
0 Kudos

Hello Friends,

I am customizing a standard WDA Component. When the user clicks a button on the screen, a new table row is created. When this table row is created, I need to focus the cursor in a table cell (DropDownByIndex type).

I am using the following code to place the cursor, after getting the row index:

 DATA lt_receipts TYPE if_receipts=>elements_receipts.

  lo_node_receipts->get_static_attributes_table( IMPORTING table = lt_receipts ).

  READ TABLE lt_receipts TRANSPORTING NO FIELDS WITH KEY exp_type = ''.

  IF sy-subrc = 0.

    "An initial element exists already => Set lead selection

    lo_node_receipts->set_lead_selection_index( index = sy-tabix ).

  ELSE.

    "Create new initial element

    ro_elem_receipt = lo_node_receipts->create_element( ).

    lo_node_receipts->bind_element( new_item = ro_elem_receipt set_initial_elements = abap_false ). "Append new element

    wd_this->supply_receipt_elem( io_elem_receipt = ro_elem_receipt is_receipt = wd_this->ms_default ). "Fill with default values.

    "Set lead selection

    DATA lv_index TYPE i.

    lv_index = ro_elem_receipt->get_index( ).

    wd_this->select_receipt( iv_index = lv_index ).

  ENDIF.

'' Set cursor on table cell

    ro_elem_receipt->set_attribute(

                                            name =  `EXP_TYPE_NAME`

                                            value = 'ABAP_TRUE' ).

I am unable to get the cursor to be placed on the field. Can you please correct the mistake in my code.

Regards,

John.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please cehck this... find sarbejeet answer

cheers,

Kris.

Former Member
0 Kudos

Thanks kissnas for the link.

The solution provided by Sarbjeet helped solve my requirement.

Answers (0)