2009 Feb 08 5:27 AM
hai sir ,
i have displayed on list using alv function module . but ,i want to select one or more record from the list.
and press any function key it shoud display the records which i was selected.how its possible give some idea.
2009 Feb 08 6:36 AM
Hello ,
U can get the selectedrows from the ALV listUsing GET_ELECTED_ROWS method CL_GUI_ALV_GRID , .Use Usercommand and press any key and within the method DOUBLE CLICK u can write the remaining code to dispolay the selected rows.
Here Fyi ...U have top use
Set handler Concepts of ALV grid .Search the forum for the same u can find many threads .
Regards
2009 Feb 08 5:55 AM
2009 Feb 08 5:55 AM
2009 Feb 08 6:36 AM
hi,
u can easily do ot using a alv grid control as follows
1.create a class with handle toolbar method by which u can create customized button .Here i have given the function code as DISPLAY.In the handle user commad u have to write the command for displaying the selected row.Using the get selected row methos ,u will get the selected row index so that u can read the internal table with that index to get the record.After getting the selected row u can display it as pop up by calling the function module POPUP_WITH_TABLE_DISPLAY
For enabling the selection in grid ,set the layout like this ls_layout-sel_mode = 'A'.
for pasiing it to set_table_for_first_display
*--->class defenition and implementation
*class defenition
CLASS cl_eventhandler DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm,
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id es_row_no.
ENDCLASS. "cl_eventhandler DEFINITION
*class implementation
CLASS cl_eventhandler IMPLEMENTATION.
METHOD handle_toolbar.
DATA: ls_toolbar TYPE stb_button.
CLEAR ls_toolbar.
MOVE 'DISPLAY' TO ls_toolbar-function.
MOVE icon_print TO ls_toolbar-icon.
MOVE 'Print warranty sheet' TO ls_toolbar-quickinfo.
MOVE 'Print warranty sheet' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
ENDMETHOD. "handle_toolbar
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'DISPLAY'.
CALL METHOD gr1->get_selected_rows
IMPORTING
et_index_rows = lt_rows.
ENDCASE.
ENDMETHOD. "handle_user_command
METHOD handle_hotspot_click .
READ TABLE it_alv INTO wa_alv INDEX e_row_id-index.
IF sy-subrc EQ 0.
CHECK NOT wa_alv-vbeln IS INITIAL.
SET PARAMETER ID '/DBM/ORDER_NUMBER' FIELD wa_alv-vbeln.
CALL TRANSACTION '/DBM/ORDER03' AND SKIP FIRST SCREEN.
ENDIF.
ENDMETHOD. "handle_HOTSPOT_CLICK
2009 Feb 08 6:36 AM
Hello ,
U can get the selectedrows from the ALV listUsing GET_ELECTED_ROWS method CL_GUI_ALV_GRID , .Use Usercommand and press any key and within the method DOUBLE CLICK u can write the remaining code to dispolay the selected rows.
Here Fyi ...U have top use
Set handler Concepts of ALV grid .Search the forum for the same u can find many threads .
Regards