CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM      = g_repid
      i_callback_user_command = 'USER_CALLBACK'
      I_STRUCTURE_NAME        = 'T_OUTPUT'
      I_GRID_TITLE            = 'Document List'
      is_layout               = gs_layout
      is_variant              = g_variant
      I_DEFAULT               = 'X'
      I_SAVE                  = 'A'
      it_fieldcat             = gt_fieldcat[]
      it_sort                 = gt_sort[]
      it_events               = gt_events[]
    TABLES
      T_OUTTAB                = IT_OUTPUT
    EXCEPTIONS
      PROGRAM_ERROR           = 1
      OTHERS                  = 2.
ENDFORM.                    "DISPLAY_DATA


FORM
 
USER_CALLBACK USING rf_ucomm TYPE sy-ucomm
                         rs_selfield TYPE slis_selfield.
  CASE rf_ucomm.
    WHEN '&IC1'.
      READ TABLE IT_OUTPUT INDEX rs_selfield-tabindex ASSIGNING <FS_OUTPUT>.
      IF SY-SUBRC = 0.
        SET PARAMETER ID'BLN' FIELD <FS_OUTPUT>-BELNR. "
PARAMETER ID通过F1->technical information->Parameter id可以获得
        SET PARAMETER ID'BUK' FIELD <FS_OUTPUT>-BUKRS.
        SET PARAMETER ID'GJR' FIELD <FS_OUTPUT>-GJAHR.
        CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN ."
SKIP FIRST SCREEN 忽略selection screen
      ENDIF.
  ENDCASE.
ENDFORM.                    "USER_CALLBACK


posted on 2009-08-03 21:58  levin  阅读(345)  评论(0编辑  收藏  举报