SAP 跳转到指定事务代码界面 的实现方法
DEFINE SET_FIELDCAT.
GS_FCAT-FIELDNAME = &1.
GS_FCAT-SCRTEXT_L = &2.
GS_FCAT-SCRTEXT_M = &2.
GS_FCAT-SCRTEXT_S = &2.
GS_FCAT-REPTEXT = &2.
GS_FCAT-REF_TABLE = &3.
GS_FCAT-REF_FIELD = &4.
IF GS_FCAT-FIELDNAME EQ 'MATNR'.
GS_FCAT-NO_ZERO = 'X'.
ENDIF.
IF GS_FCAT-FIELDNAME EQ 'REMARK'.
GS_FCAT-EDIT = 'X'.
ENDIF.
IF GS_FCAT-FIELDNAME = 'PLNUM'.
GS_FCAT-HOTSPOT = 'X'.
ENDIF.
APPEND GS_FCAT TO GT_FCAT.
CLEAR: GS_FCAT.
END-OF-DEFINITION.
FORM FRM_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: L_GRID TYPE REF TO CL_GUI_ALV_GRID.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = L_GRID.
CALL METHOD L_GRID->CHECK_CHANGED_DATA.
RS_SELFIELD-REFRESH = 'X'.
CASE R_UCOMM.
WHEN 'ZSAVE'.
PERFORM FRM_SAVE_DATA.
WHEN '&IC1'. "双击
READ TABLE GT_ALV INTO DATA(LS_ALV) INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
CASE RS_SELFIELD-FIELDNAME.
WHEN 'PLNUM'.
IF LS_ALV-PLNUM IS NOT INITIAL.
SET PARAMETER ID 'PAF' FIELD LS_ALV-PLNUM.
CALL TRANSACTION 'MD13' AND SKIP FIRST SCREEN.
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDIF.
ENDCASE.
ENDFORM.