F4IF_INT_TABLE_VALUE_REQUESThtml
效果圖:ide
本例子代碼:spa
*&-------------------------------------------------------------------orm
REPORT zlm_test_044.htm
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.blog
PARAMETERS: p_matnr TYPE matnr.圖片
SELECTION-SCREEN END OF BLOCK b1.it
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.form
PERFORM frm_f4.class
*&---------------------------------------------------------------------*
*& Form frm_f4
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM frm_f4.
"這裏定義的字段都會顯示出來
TYPES: BEGIN OF values,
werks TYPE werks_d,
matnr TYPE matnr,
maktx TYPE maktx,
END OF values.
DATA: values_tab TYPE TABLE OF values.
SELECT marc~werks makt~matnr makt~maktx
FROM makt
INNER JOIN marc ON marc~matnr = makt~matnr
INTO CORRESPONDING FIELDS OF TABLE values_tab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'MAKTX'
value_org = 'S'
callback_program = sy-repid
callback_form = 'FRM_LIST' "Form for callback before F4 start (-> long docu)
TABLES
value_tab = values_tab.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "frm_f4
*&-------------------------------------------------------------------
*& 設置顯示模式
*&-------------------------------------------------------------------
FORM frm_list TABLES record_tab STRUCTURE seahlpres
CHANGING shlp TYPE shlp_descr
callcontrol LIKE ddshf4ctrl.
DATA: ls_intdescr LIKE shlp_intds.
shlp-intdescr-dialogtype = 'C'. "設置顯示模式
callcontrol-no_maxdisp = ''.
callcontrol-maxrecords = '50'. "最大顯示數量
ENDFORM. "FRM_LIST
另一個F4加強的例子,也是添加篩選字段:
http://blog.sina.com.cn/s/blog_c0978c9b0101h1qf.html