• SAP 自定义弹框(dynpro屏幕定义下拉框)


    1.创建一个屏幕,自定义输入框

    2.代码:

    设置窗口屏幕坐标:http://www.baidusap.com/abap/dialog/6038

    report ztest3.
    
    data:xlk type string,
         save_ok type sy-ucomm,
         ok_code type sy-ucomm.
    
    call screen 100 starting at 8 5 ending at 50 10.  "设置屏幕坐标
    
    *&---------------------------------------------------------------------*
    *& Module STATUS_0100 OUTPUT
    *&---------------------------------------------------------------------*
    *&
    *&---------------------------------------------------------------------*
    MODULE STATUS_0100 OUTPUT.
     SET PF-STATUS 'STATUS1'.     "创建GUI  回车键ENTRY
    * SET TITLEBAR 'xxx'.
    
      TYPE-POOLS vrm.
      data :name type vrm_id value 'XLK', "屏幕上绑定的下拉框也是这个名字
            list type vrm_values,
            value like line of list.
    
        REFRESH list.
        Value-key = '键1'.
        Value-text = '值1'.
        APPEND value TO list.
    
        Value-key = '键2'.
        Value-text = '值2'.
        APPEND value TO list.
    
        CALL FUNCTION 'VRM_SET_VALUES'
          EXPORTING
            id     = Name
            values = list.
    ENDMODULE.
    *&---------------------------------------------------------------------*
    *&      Module  USER_COMMAND_0100  INPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE USER_COMMAND_0100 INPUT.
      clear save_ok.
      save_ok = ok_code.
      clear ok_code.
    
      CASE save_ok.
        WHEN 'KEY_VALUE'.
        WHEN 'YES' or 'ENTRY'.
          LEAVE PROGRAM.
        WHEN 'NO'.
          LEAVE PROGRAM.
        WHEN OTHERS.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.
    View Code

    3.结果

  • 相关阅读:
    [poj 1741]Tree 点分治
    [bzoj 3251]树上三角形
    [bzoj 3687]简单题 bitset的运用
    HDU [P5015] 233 Matrix
    POJ 3233
    洛谷 [P3629] 巡逻
    POJ 2728 Desert King
    洛谷 [P2886] 牛继电器Cow Relays
    POJ 1734 Sightseeing trip
    洛谷 [P3008] 道路与航线
  • 原文地址:https://www.cnblogs.com/freeandeasy/p/14068824.html
Copyright © 2020-2023  润新知