20170520 BADI增强学习


一、要求:
Tcode:FF_5 导入数据运行时,产生财务凭证之前修改某些字段值。
Exmp:
FEBRE-VWEZW
BKPF-XBLNR
FEBEP-CHECT
BSEG-ZUONR

 

there is a business Add-in(BADI) with the definition name FEB_BADI
that
is called immediately before the standart posting in program
RFEBBU00.
In the case, you can change the procedure of the standard posting
or make additional account assignments by changing the tables that
are to be transferred to the posting interface( FTPOST,FTCLEAR. )

To do this ,go to the sap menu and follow the path tools
->ABAP->Workbench->business Add-ins,
create an enhancement that you assing to the FEB_BADI Badi
and then implement and enhancement that
you activate the BADI, you receive a message ,

telling you that active the BADI, you receive a message ,telling you
that active implementation of this BADI already exists ,


步骤:
1.SE18: FEB_BADI
基本视图中 TYPE - with in SAP 没有打勾,
表明:自建BADI 是不可直接用的。

 

二、BADI 增强。
有的存在于标准程序出口,是使用的类,
我们创建的程序都是其中的方法。它有一些系统标准的东西,每当使用的时候,
系统可以给它很多参数。

测试:
1.SE19 创建Classic BADI: LE_SHP_DELIVERY_PROC
2.输入自定义名称 Implementation Name: Z_SW_TEST

3.保存出现:已移植试试Z_SW_TEST(参阅指令的长文本)
表示自动把创建的badi使用新技术,创建到new badi 中,所以需要输入自己定义的要使用的new badi 的名


4.新建一个新的技术增强点, 点击create,

5.新技术增强点名称 Enhancement Implementation z_save_test

6.再回到这个屏幕后可以选择自己建立的增强点来保存 badi,


编程注意点:1.由于使用新技术, 在定义数据或者使用语句时候不支持旧ABAP
语言。
必须使用新的定义方法或者取数据方法。

进入之后的显示界面,如果没有显示出来可以使用的内表,需要点击Signature,
可以使用的内表全是取出的数据,
不用再自己查询,
如果没有的再查数据库,

尽量使用X的,不使用Y的。例如使用IT_XLIKP,不使用IT_YLIKP,X的表示最新的数据。


SE19:
classic badi:ZEH_DELIVER_SAVE
New badi: ZEH_DELIVER_SAVE_N

 

转载于:https://www.cnblogs.com/rainysblog/p/6911230.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值