【ABAP】F4搜索帮助带出描述等

TYPES: shlp_descr_t TYPE shlp_descr .
DATA: BEGIN OF itab OCCURS 0 ,
        matnr LIKE mara-matnr ,
        maktx LIKE makt-maktx ,
        meins LIKE mara-meins,
      END OF itab.
DATA: return_tab TYPE ddshretval OCCURS 0 .
PARAMETERS: p_matnr LIKE itab-matnr ,
            p_maktx LIKE itab-maktx ,
            p_meins LIKE mara-meins.

INITIALIZATION.
  SELECT a~matnr a~maktx b~meins INTO TABLE itab FROM makt AS a INNER JOIN mara AS b ON a~matnr = b~matnr 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    = 'FRM_GET_TEXT'
    TABLES
      value_tab        = itab
      return_tab       = return_tab
    EXCEPTIONS
      parameter_error  = 1
      no_values_found  = 2
      OTHERS           = 3.
ENDFORM.                    "f4

*&---------------------------------------------------------------------*
*&      Form  cb_form
*&---------------------------------------------------------------------*
FORM frm_get_text 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 = 'P_MAKTX'.
  APPEND interface TO shlp-interface.
  READ TABLE shlp-interface INTO interface INDEX 1.
  interface-shlpfield+4(1) = '3'.
interface-valfield = 'P_MEINS'.
  APPEND interface TO shlp-interface.
ENDFORM.                    "bo_callback_form

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

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

2021-7-29 15:02:13

ABAPSAP

【ABAP】SUBMIT调用程序返回数据

2021-8-11 19:22:02

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