ABAP自定义F4帮助

  tables:t001w.
data:begin of t_value occurs 0,
      field(40) type c,
     end of t_value.
data:gt_fields like table of help_value with header line.

initialization.
  perform init.

  parameters:p_werks(4) type c.

at selection-screen on value-request for p_werks.
  perform get_werks using p_werks text-002.
*&---------------------------------------------------------------------*
*&      Form  init
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form init.
  gt_fields-tabname = 'T001W'.
  gt_fields-fieldname = 'WERKS'.
  gt_fields-selectflag = 'X'.
  append gt_fields.
  gt_fields-tabname = 'T001W'.
  gt_fields-fieldname = 'NAME1'.
  gt_fields-selectflag = space.
  append gt_fields.
  gt_fields-tabname = 'T001W'.
  gt_fields-fieldname = 'STRAS'.
  gt_fields-selectflag = space.
  append gt_fields.

  select from t001w.
    t_value-field = t001w-werks.
    append t_value.
    t_value-field = t001w-name1.
    append t_value.
    t_value-field = t001w-stras.
    append t_value.
  endselect.
endform.                    "init
*&---------------------------------------------------------------------*
*&      Form  get_werks
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_WERKS    text
*      -->P_TEXT     text
*----------------------------------------------------------------------*
form get_werks using p_werks p_text.
  call function 'HELP_VALUES_GET_WITH_TABLE'
    EXPORTING
      fieldname            = 'WERKS'
      tabname              = 'T001W'
      title_in_values_list = p_text
    IMPORTING
      select_value         = p_werks
    TABLES
      fields               = gt_fields
      valuetab             = t_value.
endform.                    "get_werks

你可能感兴趣的:(list,table)