销售订单 交货单 行项目屏幕增强
销售订单行项目屏幕增强(有效做法)
直接附加vbap,屏幕加字段,pbo加一段
PROCESS BEFORE OUTPUT.
* Verarbeitung vor der Ausgabe
*{ INSERT DEVK926128 1
MODULE 8459_pbo_disable_fields .
*} INSERT
include MV45A_8459_PBO_DISABLE_FIELO01
MODULE 8459_pbo_disable_fields OUTPUT.
IF sy-tcode = 'VA03'OR sy-tcode = 'VA43'.
LOOP AT SCREEN.
screen-input = '0'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE. " 8459_pbo_disable_fields OUTPUT
销售订单行项目屏幕增强(我的做法)
se11-vbap-附加结构,SAPMV45A找到屏幕 8459,直接编辑屏幕(画屏幕时字段一定参考vbap,否则默认写入读取都是从vbap的),插入pbo module,放入MV45AOZZ
module get_data output.
if sy-tcode = 'VA01' and vbap-posnr > gv_posnr.
select single name1 telf1
into (vbap-zzywyxm,vbap-zzywylxfs)
from kna1
inner join knvp on kna1~kunnr = knvp~kunn2
where knvp~kunnr = vbak-kunnr and knvp~parvw = 'Z1'.
select single str_suppl3 roomnumber building
into (vbap-zzshdz,vbap-zzroomnumber,vbap-zzbuilding)
from adrc
inner join kna1 on adrc~addrnumber = kna1~adrnr
where kunnr = vbak-kunnr.
gv_posnr = vbap-posnr.
endif.
endmodule.
在MV45ATOP中插入一行代码(防止回车又取了一次数据)
data gv_posnr like vbap-posnr.
交货单项目增强(屏幕字段名可以随便取,和表附加结构没有联系)
使用badi LE_SHP_TAB_CUST_OVER
lips附加结构zzlips.,新建函数组zlips,在top中定义 tables zzlips.,在函数组下新建屏幕 2001,
创建函数 zdata_to_screen
function zdata_to_screen.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" REFERENCE(IS_LIPS) TYPE LIPS
*"----------------------------------------------------------------------
if sy-tcode = 'VL01N'.
select single *
into corresponding fields of zzvbap
from vbap
where vbeln = is_lips-vgbel and posnr = is_lips-vgpos.
endif.
move-corresponding is_lips to zzvbap.
endfunction.
创建
FUNCTION ZDATA_FROM_SCREEN.
*"----------------------------------------------------------------------
*"*"本地接口:
*" EXPORTING
*" REFERENCE(CS_LIPS) TYPE LIPS
*"----------------------------------------------------------------------
move-corresponding zzvbap to CS_LIPS.
ENDFUNCTION.
实现badi badi LE_SHP_TAB_CUST_ITEM
method if_ex_le_shp_tab_cust_item~activate_tab_page.
ef_caption = '附加屏幕'.
ef_program = 'SAPLZLIPS'.
ef_position = 10. " Tab position
ef_dynpro = '2001'. " screen number
cs_v50agl_cust = 'X'.
endmethod.
method IF_EX_LE_SHP_TAB_CUST_ITEM~TRANSFER_DATA_TO_SUBSCREEN.
call function 'ZDATA_TO_SCREEN'
exporting
is_lips = is_lips.
.
endmethod.
method if_ex_le_shp_tab_cust_item~transfer_data_from_subscreen.
call function 'ZDATA_FROM_SCREEN'
importing
cs_lips = cs_lips.
endmethod.