‎2007 Oct 13 9:28 AM
hi in alv's list by clicking on a field i have to go some other trans.
here what i want is if i click on field1 i need all that recod details that to that field is numreic field how the coding will be can u pls give me the sampel code .
‎2007 Oct 13 9:42 AM
Hi
You can keep Some selection button or a check box as first field in the ALV list
then Write code such that in DO..ENDDO loop read that SY-LISEL (LINE SELECTED) and offsetting for that field to be captured into another variable
and with that variable read all the record fields
Mostly we select a key field of that record here and with that we read
Or see the SY-UCOMM based interactive coding
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'PICK'. " Double click line
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'VBELN'.
Read data table, using index of row user clicked on
READ TABLE t_disp_tab INTO wa_item_tab INDEX
rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'VL' FIELD wa_item_tab-vbeln.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
Regards
Anji
‎2007 Oct 13 12:31 PM
HI,
Just give ur report code and d field u wanna display and i will help u out in it through internal tables. here is d small sample code for ur problem:-
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'VBELN'.
Read data table, using index of row user clicked on
READ TABLE ITSO INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD ITSO-VBELN.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
hope u find it helpful and try to give information about what u want represent in ur alv report and i will deinately help u out.
REGARDS ,
RIC.S
‎2007 Oct 13 4:49 PM
Hi,
You can try on this.
1) Write event handler for Event Double Click.
2) Get the Index of the selected row and fetch the details based on the Index from the Main Data Table that was passed to the ALV For DIsplay.
3) Use the Data and call the required Transaction Code.
Regards,
Aj