zoukankan      html  css  js  c++  java
  • 如何在选择画面中创建下拉列表(drop down list)-as list box

    下面介绍一下如何在选择画面中创建下拉列表字段(drop down list box),语法使用到parameter中的as list box,如下:

    下拉列表创建完毕后,使用函数VRM_SET_VALUES填入下拉列表值。

    例子代码如下:

    REPORT ztest_dropdown_list.
    
    PARAMETERS:p_prtmv TYPE char25 AS LISTBOX VISIBLE LENGTH 25.
    
    INITIALIZATION.
      PERFORM frm_init.
    
    *&---------------------------------------------------------------------*
    *&      Form  FRM_INIT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM frm_init .
    
      DATA: l_field     TYPE vrm_id,
            lit_listbox TYPE vrm_values,
            lwa_listbox LIKE LINE OF lit_listbox.
    
    
    * Do not print
      lwa_listbox-key  = 'A'.
      lwa_listbox-text = 'Do not print'.
      APPEND lwa_listbox TO lit_listbox.
    
    * Print
      lwa_listbox-key  = 'B'.
      lwa_listbox-text = 'Print'.
      APPEND lwa_listbox TO lit_listbox.
    
    * Print and move stock
      lwa_listbox-key  = 'C'.
      lwa_listbox-text = 'Print and move stock'.
      APPEND lwa_listbox TO lit_listbox.
    
      l_field = 'P_PRTMV'.
    
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = l_field
          values = lit_listbox.
    
    ENDFORM.

    运行如下:

    以上。

  • 相关阅读:
    HDU 1348 Wall
    HDU 2202 最大三角形
    HDU 2215 Maple trees
    HDU 1147 Pick-up sticks
    HDU 1392 Surround the Trees
    风语时光
    HDU 1115 Lifting the Stone
    HDU 1086 You can Solve a Geometry Problem too
    HDU 2108 Shape of HDU
    HDU 3360 National Treasures
  • 原文地址:https://www.cnblogs.com/datie/p/11433281.html
Copyright © 2011-2022 走看看