SAP MM ME2M ME2L ME28 增强自定义字段

26 篇文章 7 订阅

 本人诚心接ABAP远程开发任务,价格公道,有需要的联系我,欢迎个人,甲方爸爸,乙方私信联系。

目前项目需要增强ME2L 去增加客制化的字段,一开始顾问要求是copy标准程序,然后增加字段,查阅资料之后发现,

SAP 预留了标准的增强出口去做增强:

SE18--> BADI ME_CHANGE_OUTTAB_CUS

然后代码如下

* When processing this source code, you activate the following functionality:
* The reporting transactions for purchasing documents provide three main views
* for display: basic list, delivery schedule, and account assignment. All
* three views contain a column "Material". If the material of a purchasing
* document item is a manufacturer part number (MPN) then this MPN is shown
* as "Material". The internal inventory managed material is not visible.
* The following source code replaces the MPN by the inventory managed material.
  DATA: LS_EKPO TYPE EKPO.
  FIELD-SYMBOLS: <FS_OUTTAB>   TYPE ANY,
                 <FS_EBELN>    TYPE EBELN,
                 <FS_EBELP>    TYPE EBELP,
                 <FS_MATERIAL> TYPE MATNR.
* check that a purchasing document view is displayed
  CHECK IM_STRUCT_NAME EQ 'MEREP_OUTTAB_PURCHDOC'   .    "view: basic list   
 "上面这个结构是ME2L的增强结构。可以往里面APPEND 结构 增加客制化字段
*  OR    im_struct_name EQ 'MEREP_OUTTAB_SCHEDLINES'      "view: delivery schedule
*  OR    im_struct_name EQ 'MEREP_OUTTAB_ACCOUNTING'.     "view: account assignment

* loop at the output table and assign a field symbol
  LOOP AT CH_OUTTAB ASSIGNING <FS_OUTTAB>.
  CLEAR:LV_ORMNG,LV_LFIMG.
*-- assign the purchasing document number to a field symbol
    ASSIGN COMPONENT 'EBELN' OF STRUCTURE <FS_OUTTAB> TO <FS_EBELN>.
    CHECK SY-SUBRC = 0.
*-- assign the purchasing document item number to a field symbol
    ASSIGN COMPONENT 'EBELP' OF STRUCTURE <FS_OUTTAB> TO <FS_EBELP>.
    CHECK SY-SUBRC = 0.
*-- assign the manufacturer part number to a field symbol
    ASSIGN COMPONENT 'EMATN' OF STRUCTURE <FS_OUTTAB> TO <FS_MATERIAL>.
    CHECK SY-SUBRC = 0.

    ASSIGN COMPONENT 'MENGE' OF STRUCTURE <FS_OUTTAB> TO <FS_MENGE>.
    CHECK SY-SUBRC = 0.

    ASSIGN COMPONENT 'MGLIEF' OF STRUCTURE <FS_OUTTAB> TO <FS_MGLIEF>.
    CHECK SY-SUBRC = 0.

**-- read the corresponding purchasing document item
*    CALL FUNCTION 'ME_EKPO_SINGLE_READ'
*      EXPORTING
*        PI_EBELN         = <FS_EBELN>
*        PI_EBELP         = <FS_EBELP>
*      IMPORTING
*        PO_EKPO          = LS_EKPO
*      EXCEPTIONS
*        NO_RECORDS_FOUND = 1
*        OTHERS           = 2.
*    CHECK SY-SUBRC = 0.


  ENDLOOP.

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值