ALV

Question:
Hi all,
can any one send me the code for my following requirement :: I have one ALV grid dislpalyed and i want that on double clicking on any of the cell i get the value of that cell and using that value i select another data from database and get that data displayed in ALV grid on another screen.
in another way i want the functionality of AT LINE-SELECTION in ALV GRID.
_________________
hardwork never killed anyone but why take risks.
Answer:
You must create an event handler class to handle the event DOUBLE_CLICK or HOTSPOT_CLICK of the CL_GUI_ALV_GRID class and register with to your ALV object. Within the event handling method you can call the GET_CURRENT_CELL method of the ALV object using the row and column numbers returned into your event handler to retrieve the cell's values. From there, call another screen or do anything else you want to process that value.
Many developers forgo this method and use the function module REUSE_ALV_GRID_DISPLAY function module for simple ALV lists. All the object handling is done for you within the function module, and to process user actions you simply pass a subroutine name in the "CALLBACK_USER_COMMAND" parameter. The cell properties and value are passed automatically to this subroutine when the user double-clicks a cell or single-clicks a hotspot.
Answer:
try using get_current_cell
check out the following link:

hope it helps
Answer:
DATA t_catalogo1 TYPE slis_t_fieldcat_alv.
DATA lt_events1 TYPE slis_t_event.
DATA fs_events TYPE slis_alv_event.
DATA lt_events1 TYPE slis_t_event.
DATA wa_catalogo TYPE slis_fieldcat_alv.
* Llenar catalogo>>>
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZPP_PRG_FRACC_01A'
i_internal_tabname = 'TDEF'
i_inclname = 'ZPP_PRG_FRACC_01A'
CHANGING
ct_fieldcat = t_catalogo1
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
wa_catalogo-seltext_l = 'grTec'.
MODIFY t_catalogo1 FROM wa_catalogo INDEX 12 TRANSPORTING seltext_l.
wa_catalogo-key = ''.
DO 12 TIMES.
MODIFY t_catalogo1 FROM wa_catalogo INDEX sy-index TRANSPORTING key.
ENDDO.
* Llamar reuse>>>
fs_events-name = 'TOP_OF_LIST'.
fs_events-form = 'ENCABEZADO_1'. "ver arriba
APPEND fs_events TO lt_events1.
* print-no_print_selinfos = 'X'.
* print-no_print_listinfos = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZPP_PRG_FRACC_01A'
i_callback_pf_status_set = hf_status
i_callback_user_command = 'USER_COMMAND'
i_save = 'X'
it_fieldcat = t_catalogo1
it_events = lt_events1[]
TABLES
t_outtab = tdef
EXCEPTIONS
program_error = 1
OTHERS = 2.
*&---------------------------------------------------------------------*
*& Form USER_COMMAND
*&---------------------------------------------------------------------*
* Evaluación de Comandos
*----------------------------------------------------------------------*
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* refrescar la vista con lo que pase acá...
CLEAR rs_selfield-refresh.
CASE r_ucomm.
WHEN '&IC1'.
rs_selfield-refresh = 'X'.
PERFORM detop1 USING rs_selfield.
WHEN 'RFSH'. "refrescar el reporte
rs_selfield-refresh = 'X'.
PERFORM entrada.
* WHEN 'ADDI'. "verificar adicionales
* rs_selfield-refresh = 'X'.
* PERFORM chkadds.
WHEN 'SNEW'. "traer nuevas ordenes que clasifican
rs_selfield-refresh = 'X'.
PERFORM actuali.
PERFORM chkadds.
PERFORM entrada.
WHEN 'VER'.
PERFORM detaufnr USING rs_selfield.
WHEN 'UPLO'.
rs_selfield-refresh = 'X'.
PERFORM upl_plano.
PERFORM entrada.
WHEN 'DELE '.
rs_selfield-refresh = 'X'.
PERFORM depurar USING rs_selfield.
PERFORM entrada.
ENDCASE.

More Articles:

Database tables of PP?
question for two abapers?
Accounting Period Function Module?
pop screen?
PRINT PAGE NUMBER?
negative value when sales order is saved?