【ABAP】常用模板三(选择屏幕下拉框)

*&---------------------------------------------------------------------*
*& Report YH_DEMO3
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT YH_DEMO3.
PARAMETERS:p_dbname TYPE tabname16 AS LISTBOX VISIBLE LENGTH 20 OBLIGATORY.

INITIALIZATION.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dbname.
  PERFORM p_set_selection.

START-OF-SELECTION.

  WRITE p_dbname.
*&---------------------------------------------------------------------*
*&      Form  P_SET_SELECTION
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM p_set_selection .
  TYPES:BEGIN OF ty,
          key   TYPE tabname16,
          value TYPE char80,
        END OF ty.
  DATA:itab TYPE TABLE OF ty.

  itab = VALUE #(
                            ( KEY = 'ZEMPLOYEE' VALUE = '招聘信息表')
                            ( KEY = 'SPFLI' VALUE = '航班表')
                            ).

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*     DDIC_STRUCTURE         = ' '
      retfield               = 'KEY'
*     PVALKEY                = ' '
     DYNPPROG               = SY-repid
     DYNPNR                 = SY-DYNNR
     DYNPROFIELD            = 'KEY'
*     STEPL                  = 0
     WINDOW_TITLE           = 'WINDOW-TITLE'
*     VALUE                  = ' '
    VALUE_ORG              = 'S'
*     MULTIPLE_CHOICE        = ' '
     DISPLAY                = 'F'
    CALLBACK_PROGRAM       = SY-repid
*     CALLBACK_FORM          = ' '
*     CALLBACK_METHOD        =
*     MARK_TAB               =
*   IMPORTING
*     USER_RESET             =
    tables
      value_tab              = itab
*    FIELD_TAB              = FIELD_TAB
*     RETURN_TAB             =
*     DYNPFLD_MAPPING        =
   EXCEPTIONS
     PARAMETER_ERROR        = 1
     NO_VALUES_FOUND        = 2
     OTHERS                 = 3
            .
  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.

给TA买糖
共{{data.count}}人
人已赞赏
ABAPSAP

【ABAP】常用模板二

2021-7-14 16:09:07

ABAPSAP

【ABAP】DIALOG表控件回车后其他行可编辑

2021-7-29 15:02:13

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索