abap alv双击事件
作者:互联网
TABLES:MARA.
TYPE-POOLS: SLIS.
SELECT-OPTIONS:MATNR FOR MARA-MATNR OBLIGATORY.
DATA:LT_MARA TYPE TABLE OF MARA WITH HEADER LINE,
FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
LAYOUT TYPE SLIS_LAYOUT_ALV,
W_REPID LIKE SY-REPID.
START-OF-SELECTION.
SELECT * FROM MARA INTO TABLE LT_MARA
WHERE MATNR IN MATNR.
W_REPID = SY-REPID.
- 定义热键显示字段,使双击事件有效
FIELDCAT-REF_TABNAME = ‘LT_MARA’.
FIELDCAT-FIELDNAME = ‘MATNR’.
FIELDCAT-HOTSPOT = ‘X’.
APPEND FIELDCAT.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
I_CALLBACK_PROGRAM = W_REPID "定义回执程序
IS_LAYOUT = LAYOUT
I_STRUCTURE_NAME = ‘MARA’
I_CALLBACK_USER_COMMAND = ‘ALV_USER_COMMAND’ "定义执行事件
IT_FIELDCAT = FIELDCAT[]
TABLES
T_OUTTAB = LT_MARA.
---------------------------------------------------------------------
-
事件触发子程序 *
---------------------------------------------------------------------
FORM ALV_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN ‘&IC1’.
- 获取当前ALV所在行数据
READ TABLE LT_MARA INDEX RS_SELFIELD-TABINDEX.
SET PARAMETER ID: ‘MAT’ FIELD LT_MARA-MATNR.
CALL TRANSACTION ‘MM03’ AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM.
作者:兔宝
来源:CSDN
原文:https://blog.csdn.net/szlaptop/article/details/8252093
版权声明:本文为博主原创文章,转载请附上博文链接!
标签:MATNR,MARA,FIELDCAT,LT,ALV,abap,alv,TYPE,双击 来源: https://blog.csdn.net/jiechongl/article/details/91953930