본문 바로가기

SAP ABAP

get_selected_rows from alv after handler PAI logic

커스텀 screen 9100 에 salv 컨테이너를 올린다음에 row 선택된 데이타를 index로 확인해서 처리하려고 하였으나 index인식이 안되는 문제가 발견되었다.

 

click event발생시 선택된 row의  index정보를 읽어와야 되는데 안읽어져 올때 아래구문을 참고하면된다.

 

Register selection when show ALV:

  ...
  lo_selections = go_alv_dms->get_selections( ).
  lo_selections->set_selection_mode( if_salv_c_selection_mode=>row_column ).
  lo_events = go_alv_dms->get_event( ).
  CREATE OBJECT go_handler.
  SET HANDLER go_handler->on_user_command2 FOR lo_events.

 

 

Method on_user_command:

    case gv_ok_0100.
      when 'OK'.
         ...
         lt_rows = go_alv_dms->get_selections( )->get_selected_rows( ).
         ...
    ENDCASE.

 

->아래구문 필요함

DATA gr_alv TYPE REF TO cl_salv_table.
DATA it_rows TYPE salv_t_row.
... 
gr_alv->get_metadata( ). " Call this method before getting selected rows
it_rows = gr_alv->get_selections( )->get_selected_rows( ).

 

https://community.sap.com/t5/application-development-discussions/get-selected-rows-returns-nothing/m-p/4423910

 

get_selected_rows returns nothing

Hello, I'm trying to use the ALV Object model. I've added the option for the user to select multiple rows (via set_selection_mode ROW_COLUMN). However, after the user has selected rows and pushes the continue button, I don't find any data with the method g

community.sap.com