REPORT zdemo16.
INCLUDE zdemo16_alv.
DATA:BEGIN OF gs_itab,
matnr TYPE makt-matnr,
maktx TYPE makt-maktx,
END OF gs_itab,
gt_itab LIKE TABLE OF gs_itab.
START-OF-SELECTION.
SELECT matnr maktx INTO TABLE gt_itab
FROM makt
UP TO 10 ROWS.
m_build_fcat :'MATNR' '物料编码' 'MATNR' 'MARA' '' ''.
m_build_fcat :'MAKTX' '物料描述' '' '' '' ''.
gs_event-name = 'USER_COMMAND'.
gs_event-form = 'FRM_USER_COMMAND'.
APPEND gs_event TO gt_event.
CLEAR gs_event.
gs_event-name = 'PF_STATUS_SET'.
gs_event-form = 'FRM_PF_STATUS_SET'.
APPEND gs_event TO gt_event.
CLEAR gs_event.
PERFORM frm_out_data TABLES gt_itab.
*&---------------------------------------------------------------------*
*& Form FRM_USER_COMMAND
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM frm_user_command USING pv_ucomm LIKE sy-ucomm
ps_selfield TYPE slis_selfield.
CASE pv_ucomm.
WHEN '&IC1'.
IF ps_selfield-fieldname EQ 'MATNR'.
READ TABLE gt_itab INTO gs_itab INDEX ps_selfield-tabindex.
IF sy-subrc EQ 0.
SET PARAMETER ID 'MAT' FIELD gs_itab-matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. "FRM_USER_COMMAND
*&---------------------------------------------------------------------*
*& Form pf_status_set
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->PT_EXTAB text
*----------------------------------------------------------------------*
FORM frm_pf_status_set ##called
USING pt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZDEMO16' EXCLUDING pt_extab.
ENDFORM. "PF_STATUS_SET
阅读(1620) | 评论(0) | 转发(0) |