写点什么

ABAP 简易弹出输出 / 输入框

作者:Jasen Ye
  • 2022 年 3 月 28 日
  • 本文字数:1262 字

    阅读完需:约 4 分钟

ABAP  简易弹出输出/输入框

1.弹出确认框

标准函数:POPUP_TO_CONFIRM_STEP


2.弹出单选/复选框

标准函数:POPUP_TO_DECIDE_LIST


***************************  注释:单选或多选对于选中行字段selflag会打上标识 'X'*       单选时返回的answer值为选中值行编号**************************    CALL FUNCTION 'POPUP_TO_DECIDE_LIST'      EXPORTING*       CURSORLINE         = 1        mark_flag          = i_mark_flag   "空为单选,'X'为复选        mark_max           = i_mark_max    "最大可选数        start_col          = 10        start_row          = 5        textline1          = i_textline*       TEXTLINE2          = ' '*       TEXTLINE3          = ' '        titel              = 'SAP'*       DISPLAY_ONLY       = ' '      IMPORTING        answer             = o_answer      TABLES        t_spopli           = it_spopli      EXCEPTIONS        not_enough_answers = 1        too_much_answers   = 2        too_much_marks     = 3        OTHERS             = 4.    IF sy-subrc = 0 AND o_answer <> 'A'.      CLEAR ot_spopli.      APPEND LINES OF it_spopli TO ot_spopli.    ENDIF.-------------------示例-------------------t_spopli = VALUE #( ( varoption = '香蕉' ) ( varoption = '菠萝' ) ( varoption = '荔枝' ) ).zcl_devp_tools=>get_instance( )->user_decide( EXPORTING i_mark_max  = lv_mark_max                                                          i_mark_flag = lv_mark_flag                                                          it_spopli   =  t_spopli                                                          i_textline  = '选择框测试'                                                IMPORTING o_answer    = lv_char                                                          ot_spopli   =  t_spopli ).
复制代码


3.弹出输入框

标准函数:POPUP_GET_VALUES / POPUP_GET_VALUES_USER_HELP


      CALL FUNCTION 'POPUP_GET_VALUES'        EXPORTING*         NO_VALUE_CHECK  = ' '          popup_title     = '输入信息'          start_column    = '5'          start_row       = '5'        IMPORTING          returncode      = lv_returncode        TABLES          fields          = et_sval        EXCEPTIONS          error_in_fields = 1          OTHERS          = 2.      IF lv_returncode EQ 'A'. ”取消输入
ENDIF. ----------------------示例---------------------t_sval = VALUE #( ( tabname = 'SKA1' fieldname = 'SAKNR' value = '1122070000' ) ( tabname = 'KNA1' fieldname = 'KUNNR' ) ).zcl_devp_tools=>get_instance( )->user_input( EXPORTING it_sval = t_sval IMPORTING et_sval = t_sval ).
复制代码


发布于: 刚刚阅读数: 2
用户头像

Jasen Ye

关注

还未添加个人签名 2022.03.23 加入

还未添加个人简介

评论

发布
暂无评论
ABAP  简易弹出输出/输入框_Input_Jasen Ye_InfoQ写作平台