Application Development and Automation 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: 
Read only

about selecting record from a list

Former Member
0 Likes
768

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.

1 ACCEPTED SOLUTION
Read only

shishupalreddy
Active Contributor
0 Likes
733

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

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.

4 REPLIES 4
Read only

faisalatsap
Active Contributor
0 Likes
733

Hi,

In the Following Thread Please Test the Sample Code in the Last Reply.

[Clasic ALV - POP UP TO SELECT|;

Please Reply if any Issue,

Kind Regards,

Faisal

Read only

Former Member
0 Likes
733

Hi,

You can use Hierarchial ALV List or LIST BLOCKS

REUSE_ALV_HIERSEQ_DISPLAY-hierar

REUSE_ALV_BLOCK_LIST_APPEND-List Block

REUSE_ALV_LIST_DISPLAY

Also check out this link

Regards,

jaya

Read only

Former Member
0 Likes
733

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

Read only

shishupalreddy
Active Contributor
0 Likes
734

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