This question was closed Aug 29, 2019 at 02:12 PM by Luis Rodriguez for the following reason: Problem is not reproducible or outdated
Hi all,
When working with SE16, I can bring up a detail screen by just double-clicking one of the ALV’s lines. Similarly, when displaying an ALV from my own, a detail screen can be shown by either clicking the corresponding icon or by pressing CTRL+SHIFT+F3.
What I would like to know is how to display the detail screen in my (Z) program by just double clicking a particular line.
Thanks in advance,
Luis
hi
for your requirement pass function code of details screen to attribute of layout in alv.
for info, please see below simple code.
REPORT ZDEMO2.
TYPE-POOLS:SLIS.
TYPES:BEGIN OF TY_FINAL,
VBELN TYPE VBAK-VBELN,
KUNNR TYPE VBAK-KUNNR,
END OF TY_FINAL,
TT_FINAL TYPE STANDARD TABLE OF TY_FINAL.
DATA:GT_FINAL TYPE TT_FINAL,
GS_FINAL TYPE TY_FINAL.
DATA:GS_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA:GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
GS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
START-OF-SELECTION.
SELECT VBELN KUNNR FROM VBAK INTO TABLE GT_FINAL UP TO 700 ROWS.
END-OF-SELECTION.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'VBELN'.
GS_FIELDCAT-SELTEXT_L = 'SO Number'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'KUNNR'.
GS_FIELDCAT-SELTEXT_L = 'Customer Code'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_LAYOUT.
GS_LAYOUT-F2CODE = '&ETA'. " note here pass function code of details to layout attribute.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT
TABLES
T_OUTTAB = GT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF 1 = 4.
ENDIF.
Hi Luis,
If you are using CL_GUI_ALV_GRID in your custom program, the following are the steps to achieve it:
1. Register event handler method for double click, then this method is called for every double-click on particular line
2. In the event handler method, read the line using row id/index, and prepare details to be displayed
3. Finally, make a call to LVC_ITEM_DETAIL (FM) to display details
=
Regards,
Balaji
Add a comment