自定义搜索帮助:AT SELECTION-SCREEN ON VALUE-REQUEST 和 PROCESS ON VALUE-REQUEST、返回多个搜索帮助字段值

1、选择屏幕字段搜索帮助AT SELECTION-SCREEN ON VALUE-REQUEST

2、自定义屏幕字段搜索帮助PROCESS ON VALUE-REQUEST

结合BAPI: F4IF_INT_TABLE_VALUE_REQUEST 实现搜索帮助功能

 

其中AT SELECTION-SCREEN ON VALUE-REQUEST用法参考如下文章

https://blog.csdn.net/wangjolly/article/details/80075531

 

PROCESS ON VALUE-REQUEST使用方法如下:

客制化屏幕PAI后面

PROCESS AFTER INPUT.

PROCESS ON VALUE-REQUEST.

       FIELD 需要搜索帮助的字段 MODULE 实现模块.

TYPES: BEGIN OF ty_bank_info,
         zskzh  TYPE zfis009-zskzh,
         zskylh TYPE zfis009-zskylh,
         zskmc  TYPE zfis009-zskmc,
         xezer  TYPE lfbk-xezer,
         bkont  TYPE lfbk-bkont,
       END OF ty_bank_info.

MODULE sh_get_zskzh INPUT.
  PERFORM frm_sh_get_zskzh.
ENDMODULE.

FORM frm_sh_get_zskzh .

   DATA: lt_value TYPE STANDARD TABLE OF ty_bank_info,
         ls_value LIKE LINE OF lt_value.
   DATA: lt_return_value TYPE STANDARD TABLE OF ddshretval.
   DATA: lt_lfbk TYPE STANDARD TABLE OF lfbk.
   DATA: ls_lfbk LIKE LINE OF lt_lfbk.
   DATA: ls_bnka TYPE bnka.
   DATA: lv_bkont TYPE lfbk-bkont.
   DATA: lv_line TYPE i.
   GET CURSOR LINE lv_line.
   "lt_value 搜索帮助数据集
   IF lt_value[] IS NOT INITIAL.
     CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
         retfield         = 'ZSKZH'
         dynpprog         = sy-repid
         dynpnr           = '9000'
         dynprofield      = 'GS_ITEMS-ZSKZH'
         value_org        = 'S'
         callback_program = sy-repid
         callback_form    = 'FRM_CB_FORM'
       TABLES
         value_tab        = lt_value
         return_tab       = lt_return_value.
     READ TABLE lt_return_value INTO DATA(ls_return_value) INDEX 1.
     IF sy-subrc = 0.
       gs_items-zskzh = ls_return_value-fieldval.
     ENDIF.
   ENDIF.

 ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  FRM_CB_FORM
*&---------------------------------------------------------------------*
 FORM frm_cb_form TABLES record_tab STRUCTURE seahlpres
               CHANGING shlp TYPE shlp_descr_t
                        callcontrol LIKE ddshf4ctrl.

   DATA: interface LIKE LINE OF shlp-interface.

   READ TABLE shlp-interface INTO interface INDEX 1.
   interface-shlpfield+4(1) = '2'.
   interface-valfield = 'GS_ITEMS-ZSKYLH'.
   APPEND interface TO shlp-interface.

 ENDFORM.                    "bo_callback_form

子例程:FORM frm_cb_form搜索帮助返回多个值,实现字段:GS_ITEMS-ZSKZH和GS_ITEMS-ZSKYLH同时返回

 

 

 

 

 

 

 

 

发布了183 篇原创文章 · 获赞 128 · 访问量 96万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览