Skip to Content
author's profile photo Former Member
Former Member

problem in get_selected_rows

hi

REFRESH gt_selected_rows.

CALL METHOD g_alv->get_selected_rows

IMPORTING et_index_rows = gt_selected_rows.

IF NOT gt_selected_rows[] IS INITIAL.

CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'

EXPORTING

textline1 = text-114

titel = text-115 "#EC NOTEXT

start_column = 25

start_row = 6

cancel_display = ''

IMPORTING

answer = lv_flag.

IF lv_flag EQ 'J'.

PERFORM selected_rows .

ELSE.

  • MESSAGE WHEN NO LINES SELECTED!!!

MESSAGE i113(z2).

ENDIF.

in this code my get_selected_row FM is gettin value onle once.Being in the same screen if i again select the rows the value returned by the FM is initial.....

wat should i do...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 11:25 AM

    Hi Neha ,

    The get selected rows should be in somewhere event please send me the whole code .

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi

      actually wat i mdoin is i m usin cl_gui_alv_grid.its having reset button so after selecting the perticular field i press reset button it does some processin. so in this situation the get_selected works fine first time the next time witout exiting i select some more rows n press reset the get_selected is not workin

      CLASS lcl_reset_event_receiver DEFINITION.

      PUBLIC SECTION.

      METHODS :

      • To add new functional buttons to the ALV toolbar

      handle_toolbar_0100

      FOR EVENT toolbar OF cl_gui_alv_grid

      IMPORTING e_object e_interactive,

      • To implement user commands

      handle_user_command

      FOR EVENT user_command OF cl_gui_alv_grid

      IMPORTING e_ucomm,

      • Double-click in screen 0100

      handle_double_click

      FOR EVENT double_click OF cl_gui_alv_grid

      IMPORTING e_row .

      ENDCLASS. "class lcl_reset_event_receiver definition.

      ===========================================================

      CLASS lcl_reset_event_receiver IMPLEMENTATION .

      METHOD handle_toolbar_0100.

      ENDMETHOD.

      METHOD handle_user_command .

      CLEAR lv_flag.

      • get selected rows

      REFRESH gt_selected_rows.

      CALL METHOD g_alv->get_selected_rows

      IMPORTING et_index_rows = gt_selected_rows.

      IF NOT gt_selected_rows[] IS INITIAL.

      CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'

      EXPORTING

      textline1 = text-114

      titel = text-115 "#EC NOTEXT

      start_column = 25

      start_row = 6

      cancel_display = ''

      IMPORTING

      answer = lv_flag.

      IF lv_flag EQ 'J'.

      PERFORM selected_rows USING

      CHANGING gt_success.

      ELSE.

      • MESSAGE WHEN NO LINES SELECTED!!!

      MESSAGE i113(z2).

      ===========================================================

      MODULE user_command_0100 INPUT.

      CASE sy-ucomm.

      WHEN 'BACK' .

      LEAVE PROGRAM.

      WHEN 'RESET'.

      SET HANDLER gv_event_handler->handle_user_command FOR g_alv.

      ENDCASE.

      ENDMODULE. " USER_COMMAND_0100 INPUT

      ENDIF.

      ENDIF. "IF gt_selected_rows[] IS INITIAL

      ENDMETHOD.

      ===============================================

      plz help me wid this

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 12:09 PM

    Neha ,

    Your problem is solved I feel

    Just change this code .

    MODULE user_command_0100 INPUT.

    CASE sy-ucomm.

    WHEN 'BACK' .

    LEAVE PROGRAM.

    ********************Comment the code .

    WHEN 'RESET'. -

    *************End comment

    ENDCASE.

    ENDMODULE. " USER_COMMAND_0100 INPUT

    ENDIF.

    ENDIF. "IF gt_selected_rows[] IS INITIAL

    Now when you have displayed the ALV GRID

    AFTER that

    write this code .

    SET HANDLER gv_event_handler->handle_user_command FOR g_alv.

    so the solution you have code set handlet only once.

    and in the method user_command

    check e_ucomm = 'RESET'.

    Try this it will work.

    Please reward if useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2007 at 01:38 PM

    Hi,

    You might ahve selected only one row from the ALV.

    MAke sure whether you are using multiple selection of rows in ALV.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.