文章目录
1 Introduction
The function is that we click some field and get the detail from document.
2 Code
**双击行字段读取明细表
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM "返回鼠标操作的指令
RS_SELFIELD1 TYPE SLIS_SELFIELD. "返回鼠标的所在单元格的各项属生,如:行号、列号、名称等
READ TABLE GT_OUT INTO GS_OUT INDEX RS_SELFIELD1-TABINDEX. "读取内表中你鼠标或者选择行的数据
IF SY-SUBRC = 0.
CASE RS_SELFIELD1-FIELDNAME.
WHEN 'BELNR1 '.
SET PARAMETER ID 'BLN' FIELD GS_OUT-BELNR1.
SET PARAMETER ID 'BUK' FIELD GS_OUT-BUKRS.
SET PARAMETER ID 'GJR' FIELD GS_OUT-GJAHR.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
WHEN OTHERS.
ENDCASE.
ENDIF.
ENDFORM.