Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

method grid1->get_selected_rows

Former Member
0 Kudos

where is the mistake in this coding

data: grid1 TYPE REF TO cl_gui_alv_grid.

MODULE user_command_0100 INPUT.

case ok_code.

MOVE: lips-vbeln TO wa_input-vbeln,

lips-posnr TO wa_input-posnr,

lips-sernr TO wa_input-sernr.

APPEND wa_input TO lt_input.

CALL METHOD grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'ZSERIALNO_INPUT'

is_layout = gs_layout

IT_TOOLBAR_EXCLUDING = LT_EXCLUDE

CHANGING

it_outtab = lt_zserialno_input

it_fieldcatalog = lt_fct

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

when 'DELETE'.

CALL METHOD grid1->get_selected_rows

IMPORTING

et_index_rows = lt_selected_rows.

endcase.

endmodule.

yesterday it worked but now the table lt_selected_rows is always initial.

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

while creating the Grid object did you set the

parameter to 'X'

create object grid
      exporting
         i_parent = custom_container
         i_appl_events = 'X'. "Set this...

if not Set it and Try it once.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Call the

method grid1->set_table_for_first_display

outside the Case andif it not works flush the layout each time.

CALL METHOD cl_gui_cfw=>flush.

Regards,

Nandha

former_member188685
Active Contributor
0 Kudos

while creating the Grid object did you set the

parameter to 'X'

create object grid
      exporting
         i_parent = custom_container
         i_appl_events = 'X'. "Set this...

if not Set it and Try it once.

0 Kudos

sorry it works. the mistake was that i habe to append the data in

case ok_code.

when space.

then append section.

then alv display.

etc.

the problem was that the system has a initial value in lt_selected_rows when the append section is direct under case ok_code without a case section.