這時可以用Call Transaction來達成這個目的
以下的例子是呼叫VA03來查詢SO單資料
*---------------------------------------------------------------------*
* FORM USER_COMMAND *
*---------------------------------------------------------------------*
FORM USER_COMMAND5 USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
L_SELFIELD = RS_SELFIELD.
CASE R_UCOMM.
WHEN '&SO2'.
READ TABLE GT_QRY10 INDEX L_SELFIELD-TABINDEX.
IF SY-SUBRC EQ 0.
IF GT_QRY10-VBELN IS NOT INITIAL.
SET PARAMETER ID 'AUN' FIELD GT_QRY10-VBELN.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. "USER_COMMAND
沒有留言:
張貼留言