03-31-2006 5:08 PM
Hi Friends,
1) I have an output in Grid format(using reuse_alv_grid_displlay). I have 3 push buttons on the menu bar(for ex.. Approve, reject and forward). The user will select multiple lines on the ALV output and hits either one of these push buttons. My question is how do I capture the multiple selected output lines.
2) This question has been asked before..and I tried to implement the answer. The problem I am facing is ..I need a function key to say that everytime I select a line(single click)..it should modify the internal tabel with CHECK = 'X'.
Any help is kindly appreciated.
03-31-2006 5:32 PM
Hi
If you should have in your output table a field for MARK, the system'll set this field for every selected fields.
DATA: BEGIN OF T_OUTPUT,
FIELD1,....
...........
FIELDN,
MARK,
END OF T_OUTPUT
Before calling ALV GRID
You have to indicate tne name of field for selection:
gt_layout-box_fieldname = 'MARK'.
gt_layout-box_tabname = 'T_OUTPUT'.
So in your user command
LOOP AT T_OUTPUT WHERE MARK = 'X'.
ENDLOOP.
Max
03-31-2006 5:21 PM
Hi ,
Use this ALV Method to capture selected lines.
CALL METHOD alvgrid->get_selected_rows
IMPORTING
et_row_no = X_rows.
Laxman
03-31-2006 5:21 PM
Hi,
you can do this in two ways , one is using checkbox .
for that you will need to have one character field in your internal table. and then populate fieldcatalog and do it. or else you can do with the help of BOXfield of char 1 ,specify in layout , here if you want to select multiple lines then you need to take help of CTRL key in the key board and mark it.
and selection lines you can identify once user press the button , you need to handle it user_command.
in user_command event you need to loop at itab for check = 'X'. and capture lines you have selected.
Regards
vijay
03-31-2006 5:32 PM
Hi
If you should have in your output table a field for MARK, the system'll set this field for every selected fields.
DATA: BEGIN OF T_OUTPUT,
FIELD1,....
...........
FIELDN,
MARK,
END OF T_OUTPUT
Before calling ALV GRID
You have to indicate tne name of field for selection:
gt_layout-box_fieldname = 'MARK'.
gt_layout-box_tabname = 'T_OUTPUT'.
So in your user command
LOOP AT T_OUTPUT WHERE MARK = 'X'.
ENDLOOP.
Max