http://wenku.baidu.com/view/3afb7f350b4c2e3f572763ed.html
2.在TABLE GB01中添加reason code字段
SAP所有模块的替代字段都由表GB01控制。
所谓release fields for substitution,就是在对应的BOOLCLASS中添加该字段,或者将该字段的GB01-BEXCLUDE = 'X'改为GB01-BEXCLUDE = ' '。
BOOLCLASS(Boolean class)对于FI/CO,BOOLCLASS对应的是调用点:
BOOLCLASS = 008 at callup point 1
BOOLCLASS = 009 at callup point 2
BOOLCLASS = 015 at callup point 3
对于调用点3,SAP缺省的是未激活即release所以的字段,因为有如下entries:
BOOLCLASS CLASSTYPE BCLTAB BCLFIELD BEXCLUDE
15 S BKPF * X
15 S BSEG * X
所以,你会得到如此信息-"此事件可以不替换任何字段"。
解决步骤如下:
1. 确认你已经阅读并了解Note 42615- Substitution in FI和391309 - GB01 Boolean class 015: FI subst. forcall-up point 3。
2. 尝试你需要替代的字段是否可以在调用点1或2实现。
3. 如果step2 failed,修改表BG01,删除相应记录:
如果是抬头字段,删除“15 S BKPF * X”,添加所需字段;
如果是行项字段,删除“15 S BSEG * X”,添加所需字段。
由于表GB01不可(通过配置)修改,你需要写一段小程序完成以上修改。
4. 运行程序RGUGBR00重新激活替代。
5. 重新维护OBBH。
代码:SAP Substitution(How to add substitution fields)
1.Se38
REPORT ZINSERT_GB01.
tables: gb01.
parameters:p_BCLTAB like gb01-BCLTAB.
parameters:p_FIELD like gb01-BCLFIELD.
parameters:p_BEXCL like gb01-bexclude.
gb01-BOOLCLASS = '009'.
gb01-CLASSTYPE = 'S'.
gb01-bcltab = p_bcltab.
GB01-BCLFIELD = P_FIELD.
GB01-BEXCLUDE = P_BEXCL.
MODIFY GB01.
2.Se16 OR Se16N &sap_edit
3.Type "/H" in Command Line toDebug SE16.
mainprogram : “SAPLSETB”,source code : “LSETBF01”.
Line 25: if code = 'SHOW', Modify the value of code with "Edit",andpress F8.
总结:
配置:TCODE:OBBH
EXIT:
1.APPEND EXIT
2.写个Form.(用到ABAP Memory , 因为传入参数bseg是一行一行传进去的,要记录数据)
set text to vendor name for bank or cash account
DATA:
ls_bseg TYPE bseg,
lrec_adrc TYPE adrc.
IF bkpf-tcode = 'F110'
AND bseg-shkzg = 'H'
AND sy-batch = 'X'.
bseg-rstgr = '004'."12购买商品、接受劳
IMPORT ls_bseg-lifnr FROM MEMORY ID 'KUKA_LIFNR'.
SELECT SINGLE *
INTO ls_lfa1
FROM lfa1
WHERE lifnr = ls_bseg-lifnr.
SELECT SINGLE name1
name2
name3
name4
langu
country
region
INTO CORRESPONDING FIELDS OF lrec_adrc
FROM adrc
WHERE addrnumber = ls_lfa1-adrnr "Address no.
AND nation = 'C'."CHINA
CONCATENATE lrec_adrc-name1
lrec_adrc-name2
lrec_adrc-name3
lrec_adrc-name4
INTO bseg-sgtxt.
IF bseg-sgtxt IS INITIAL.
CONCATENATE ls_lfa1-name1
ls_lfa1-name2
ls_lfa1-name3
ls_lfa1-name4
INTO bseg-sgtxt.
ENDIF.
ELSEIF bkpf-tcode = 'F110' AND bseg-shkzg = 'S'.
IF bseg-lifnr IS NOT INITIAL.
ls_bseg-lifnr = bseg-lifnr.
ENDIF.
EXPORT ls_bseg-lifnr TO MEMORY ID 'KUKA_LIFNR'.
ENDIF.