SD 模块的几个增强
SD模塊的幾個增強
VA01-VA03,VA41,VA42,VA43這三個事務代碼的增強直接寫在他們的程序里面,這里的增強有點特殊要注意首先要讓他顯示出來,而后才能修改,
程序名:SAPMV45A增強的點在:includemv45afzb.和includemv45afzz. 雙擊進去后點擊編輯菜單里面的增強,如下圖:
然后對準里面的增強點寫相應的代碼。
2.在寫VL01N和VL02N發貨過賬的增強的時候要進去程序相應的點調試然后去找到增強,主要在包含里面:FV50XF0B_BELEG_SICHERN
3.在寫VF01退出的時候抬頭文本更新時候在包含里面:MV60AF0B_BELEG_SICHERN,在程序里面必須等待幾秒才能進行操作,用 WAIT UP TO 2 SECONDS.
4.vl01n點發貨過賬以后的增強點在程序SAPMV50A里面的es_fv50xf0b_beleg_sichern這里的第六個增強點
5.VF01點擊保存后的增強點在程序SAPMV60A里面的enhancement-section beleg_sichern_11 spots es_sapmv60a.
” 把發貨單的抬頭文本和行項目文本帶到發票,此處增強是VL01N直接點擊發貨過賬按鈕的時候執行的
type-pools: tpit.
“BREAK ABAP_02.
data: tbseg type bseg,
it_errtab type tpit_t_errdoc with header line,
rt_buztab type tpit_t_buztab with header line,
fldtab type tpit_t_fname with header line.
data: wa_bkpf type bkpf.
data: l_bseg type table of bseg with header line.
data: name type thead-tdname.
data: l_belnr type bkpf-belnr.
data: lines type table of tline with header line.
data: it_texts type table of tline with header line.
data: it_bseg type table of bseg with header line.
data: wa_stxh type stxh.
data: wa_stxl type stxl.
data wa_thead type thead.
data: str type string.
break abap_02.
if sy-tcode eq ‘VL01N’ or sy-tcode eq ‘VL02N’.
select max( belnr ) into l_belnr from bkpf where xblnr eq likp-vbeln .”ORDER BY BLDAT.
select single * into wa_bkpf from bkpf where xblnr eq likp-vbeln and belnr eq l_belnr .”AND BLDAT EQ LIKP-FKDAT.
if wa_bkpf is not initial.
“先寫入抬頭文本
name = wa_bkpf-xblnr.”likp-vbeln.
select single * into wa_stxh from stxh where tdname eq name.
if wa_stxh is not initial.
call function ‘READ_TEXT’
exporting
* CLIENT = SY-MANDT
id = wa_stxh-tdid”‘0001′
language = ‘1′
name = name
object = ‘VBBK’
tables
lines = lines
read table lines index 1.
wa_bkpf-bktxt = lines-tdline.
modify bkpf from wa_bkpf.
endif.
endif.
“寫入行項目文本
select * into corresponding fields of table l_bseg from bseg where bukrs eq wa_bkpf-bukrs and belnr eq wa_bkpf-belnr.
concatenate wa_bkpf-xblnr ‘000010′ into wa_thead-tdname.
select single * into wa_stxl from stxl where tdname eq wa_thead-tdname.
if wa_stxl is not initial.
call function ‘READ_TEXT’
exporting
id = wa_stxl-tdid”‘0001′”wa_thead-tdid
language = ‘1′
name = wa_thead-tdname
object = ‘VBBP’
tables
lines = it_texts.
read table it_texts index 1.
clear str.
loop at it_texts.
concatenate str it_texts-tdline into str.
endloop.
if strlen( str ) 50.
str = str+0(50).
endif.
loop at l_bseg.
clear: rt_buztab,fldtab.
l_bseg-sgtxt = str.”it_texts-TDLINE.
move-corresponding l_bseg to rt_buztab.
rt_buztab-bstat = ”.
rt_buztab-mwskz = ”.
rt_buztab-flaen = ‘X’.
append rt_buztab.
fldtab-fname = ‘SGTXT’.
fldtab-aenkz = ‘X’.
append fldtab.
call function ‘FI_ITEMS_MASS_CHANGE’
exporting
s_bseg = l_bseg
importing
errtab = it_errtab
tables
it_buztab = rt_buztab
it_fldtab = fldtab
exceptions
bdc_errors = 1
others = 2.
if sy-subrc = 0.
wait up to 2 seconds.
endif.
endloop.
endif.
endif.
總結
以上是生活随笔為你收集整理的SD 模块的几个增强的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【转】SAP采购订单屏幕增强
- 下一篇: 【转】CLASS ALV(CL_GUI_