赞
踩
导语:最近在做一个资产价值转移的程序,没有找到合适的函数,就用了BDC,但是有个问题是,ABUMN这个事务码,第一次进入会弹窗让输入公司代码,第二次就不会了,会有参数ID的默认,这样没办法控制。
找到公司代码的参数ID,在BDC录屏开始之前,先给参数ID传好参数,再用BDC调用事务码,就不会弹窗提示了。
SET PARAMETER ID 'BUK' FIELD P_BUKRS.
SET PARAMETER ID 'BUK' FIELD P_BUKRS.
PERFORM BDC_DYNPRO USING 'SAPLAMDP' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/ENEWC'.
PERFORM BDC_DYNPRO USING 'SAPLSPO4' '0300'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'SVALD-VALUE(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=FURT'.
PERFORM BDC_FIELD USING 'SVALD-VALUE(01)'
<FS_OUT>-BUKRS.
PERFORM BDC_DYNPRO USING 'SAPLAMDP' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB02'.
PERFORM BDC_FIELD USING 'RAIFP2-ANLN1'
<FS_OUT>-INVZU1.
PERFORM BDC_FIELD USING 'RAIFP2-ANLN2'
<FS_OUT>-INVZU2.
PERFORM BDC_FIELD USING 'RAIFP1-BLDAT'
LV_DATE2 . " 上线日期
PERFORM BDC_FIELD USING 'RAIFP1-BUDAT'
LV_DATE2 .. " 上线日期
PERFORM BDC_FIELD USING 'RAIFP1-BZDAT'
LV_BZDAT. " 资产价值日
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RAIFP3-ANLN2'.
PERFORM BDC_FIELD USING 'RAIFP3-XBANL'
'X'."已存资产
PERFORM BDC_FIELD USING 'RAIFP3-ANLN1'
<FS_OUT>-ANLN1.
PERFORM BDC_FIELD USING 'RAIFP3-ANLN2'
<FS_OUT>-ANLN2.
PERFORM BDC_DYNPRO USING 'SAPLAMDP' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TAB03'.
PERFORM BDC_FIELD USING 'RAIFP2-ANLN1'
<FS_OUT>-INVZU1.
PERFORM BDC_FIELD USING 'RAIFP2-ANLN2'
<FS_OUT>-INVZU2.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RAIFP1-BLART'.
PERFORM BDC_FIELD USING 'RAIFP1-BLART'
'Z1'.
PERFORM BDC_FIELD USING 'RAIFP1-TRAVA'
'4'.
PERFORM BDC_DYNPRO USING 'SAPLAMDP' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SAVE'.
PERFORM BDC_FIELD USING 'RAIFP2-ANLN1'
<FS_OUT>-INVZU1.
PERFORM BDC_FIELD USING 'RAIFP2-ANLN2'
<FS_OUT>-INVZU2.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RAIFP2-XANEU'.
PERFORM BDC_DYNPRO USING 'SAPLAMDP' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/ERTRN'.
PERFORM BDC_DYNPRO USING 'SAPLSPO1' '0200'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=YES'.
LV_MODE = 'N'.
CALL TRANSACTION 'ABUMN' USING BDCDATA[]
MODE LV_MODE "不显示事务屏幕
UPDATE 'S' "同步更新.
MESSAGES INTO ZBDCMSGCOLL."错误信息写入zbdcmsgcoll
作者:小飞猪猪猪猪猪猪猪–CSDN
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。