码迷,mamicode.com
首页 > 其他好文 > 详细

ABAP 实现内表自定义的F4功能

时间:2018-04-27 17:51:37      阅读:548      评论:0      收藏:0      [点我收藏+]

标签:pen   like   begin   ping   return   HERE   interface   abap   sea   

“实现多列内容的F4功能
REPORT Z_TAB_TEST.
 
TYPES: shlp_descr TYPE shlp_descr .
 
DATA: BEGIN OF itab OCCURS 0 ,
        matnr LIKE mara-matnr ,
        maktx LIKE makt-maktx ,
      END OF itab.
DATA: return_tab TYPE ddshretval OCCURS 0 .
 
PARAMETERS: p_matnr LIKE itab-matnr ,
            p_maktx LIKE itab-maktx .

INITIALIZATION.
  SELECT matnr maktx INTO TABLE itab FROM makt UP TO 20 ROWS
    WHERE spras = 1.
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr .
  PERFORM f4.
 
*&---------------------------------------------------------------------*
*&      Form  f4
*&---------------------------------------------------------------------*
FORM f4.
  CALL FUNCTION ‘F4IF_INT_TABLE_VALUE_REQUEST‘
    EXPORTING
      retfield         = ‘MATNR‘
      dynpprog         = sy-repid
      dynpnr           = sy-dynnr
      dynprofield      = ‘P_MATNR‘
      value_org        = ‘S‘
      callback_program = sy-repid
      callback_form    = ‘CB_FORM‘     
    TABLES
      value_tab        = itab
      return_tab       = return_tab
    EXCEPTIONS
      parameter_error  = 1
      no_values_found  = 2
      OTHERS           = 3.
ENDFORM.                    "f4
 
*&---------------------------------------------------------------------*
*&      Form  cb_form
*&---------------------------------------------------------------------*
FORM cb_form TABLES record_tab STRUCTURE seahlpres
              CHANGING shlp TYPE shlp_descr
                       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 = ‘P_MAKTX‘.
  APPEND interface TO shlp-interface.
ENDFORM.                    "bo_callback_form

ABAP 实现内表自定义的F4功能

标签:pen   like   begin   ping   return   HERE   interface   abap   sea   

原文地址:https://www.cnblogs.com/jxzhu/p/8963298.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!