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

ABAP DIALOG POV F4搜索帮助

时间:2019-04-23 17:47:56      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:size   reset   date   lin   ram   ons   values   href   mamicode   

 

 在tablecontrol中根据输入的MATNR,得到VBELN和POSNR的搜索帮助,选择后,同时填入vbeln和posnr

技术图片

1、获取matnr的值

https://www.cnblogs.com/CtrlS/p/10755592.html

2、获取数据

定义STRUCTURE(SE11)

DATA: LT_STRU TYPE TABLE OF <STRUCTURE> WITH HEADER LINE.

SELECT ....

 如果取不到数,请注意字段的前导零是否正确(CONVERSION_EXIT_ALPHA_OUTPUT)

3、调用 F4IF_INT_TABLE_VALUE_REQUEST  获取F4选择的订单号和行项目

L_DSELC-FLDNAME = VBELN.
L_DSELC-DYFLDNAME = VBELN.
APPEND L_DSELC.
L_DSELC-FLDNAME = POSNR.
L_DSELC-DYFLDNAME = POSNR.
APPEND L_DSELC.

CALL FUNCTION F4IF_INT_TABLE_VALUE_REQUEST
  EXPORTING
    DDIC_STRUCTURE         = Z51_STCT"structure名称
    RETFIELD               = VBELN
*   PVALKEY                = ‘ ‘
    DYNPPROG               = SY-REPID
    DYNPNR                 = SY-DYNNR
    DYNPROFIELD            = GW_TAB-VBELN
*   STEPL                  = 0
    WINDOW_TITLE           = 订单号选择
*   VALUE                  = ‘ ‘
    VALUE_ORG              = S"Structure
*   MULTIPLE_CHOICE        = ‘ ‘
*   DISPLAY                = ‘ ‘
*   CALLBACK_PROGRAM       = ‘ ‘
*   CALLBACK_FORM          = ‘ ‘
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
  TABLES
    VALUE_TAB              = LT_VBELN[]
    FIELD_TAB              = L_DFIES[]
    RETURN_TAB             = L_DDSHRETVAL[]
    DYNPFLD_MAPPING        = L_DSELC[]
  EXCEPTIONS
    PARAMETER_ERROR        = 1
    NO_VALUES_FOUND        = 2
    OTHERS                 = 3.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
  READ TABLE L_DDSHRETVAL WITH KEY FIELDNAME = VBELN.
  L_VBELN = L_DDSHRETVAL-FIELDVAL.
  READ TABLE L_DDSHRETVAL WITH KEY FIELDNAME = POSNR.
  L_POSNR = L_DDSHRETVAL-FIELDVAL.
ENDIF.

 

4、DYNP_VALUES_READ返回订单号和行项目到屏幕

 

CLEAR:dynpfields[],L_LINES_VB.

GET CURSOR LINE L_LINES_VB."获取当前操作行数

DYNPFIELDS-FIELDNAME   = GW_TAB-VBELN.
DYNPFIELDS-STEPL       = L_LINES_VB."当前操作行数
DYNPFIELDS-FIELDVALUE  = L_VBELN.
DYNPFIELDS-FIELDINP    = X.
APPEND DYNPFIELDS.
DYNPFIELDS-FIELDNAME   = GW_TAB-POSNR.
DYNPFIELDS-STEPL       = L_LINES_VB."当前操作行数
DYNPFIELDS-FIELDVALUE  = L_POSNR.
DYNPFIELDS-FIELDINP    = X.
APPEND DYNPFIELDS.

CALL FUNCTION DYNP_VALUES_UPDATE
  EXPORTING
    DYNAME                     = SY-REPID
    DYNUMB                     = SY-DYNNR
  TABLES
    DYNPFIELDS                 = DYNPFIELDS[].

 

 

 

 

 

 

ABAP DIALOG POV F4搜索帮助

标签:size   reset   date   lin   ram   ons   values   href   mamicode   

原文地址:https://www.cnblogs.com/CtrlS/p/10757431.html

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