常用bapi示例讲解
①BAPI_ASSET_RETIREMENT_POST资产报废过账
REPORT RODERICK.
DATA:GENERALPOSTINGDATA TYPE BAPIFAPO_GEN_INFO.
DATA:RETIREMENTDATA TYPE BAPIFAPO_RET.
DATA:RETURN TYPE BAPIRET2.
DATA:DOCUMENTREFERENCE TYPE BAPIFAPO_DOC_REF.
DATA:FURTHERPOSTINGDATA TYPE BAPIFAPO_ADD_INFO.
*GENERALPOSTINGDATA-USERNAME = SY-UNAME.”用户名
GENERALPOSTINGDATA-DOC_TYPE = ‘AA’.”凭证类型
GENERALPOSTINGDATA-DOC_DATE = ‘20110125′.”凭证中的凭证日期
GENERALPOSTINGDATA-PSTNG_DATE = ‘20110125′.”凭证中的过帐日期
*GENERALPOSTINGDATA-FIS_PERIOD = ‘1′.”会计期间
*GENERALPOSTINGDATA-TRANS_DATE = ‘20110121′.”换算日期
GENERALPOSTINGDATA-COMP_CODE = ‘9900′.”公司代码
GENERALPOSTINGDATA-ASSETMAINO = ‘110001000840′.”主资产号
GENERALPOSTINGDATA-ASSETSUBNO = ‘0000′.”资产次级编号”
GENERALPOSTINGDATA-ASSETTRTYP = ‘Y90′.”资产事务类型
“完整报废只设置 COMPL_RET = ‘X’。
“局部报废
RETIREMENTDATA-COMPL_RET = ”.”标志: 记帐全部报废
RETIREMENTDATA-AMOUNT = 100.”过帐金额
*RETIREMENTDATA-REV_ON_RET = ”.”资产销售中的收益
*RETIREMENTDATA-RET_COSTS = ”.”资产报废成本
RETIREMENTDATA-CURRENCY = ‘RMB’.”货币码
*RETIREMENTDATA-CURRENCY_ISO = ”.”ISO代码货币
*RETIREMENTDATA-QUANTITY = ”.”数量
*RETIREMENTDATA-BASE_UOM = ”.”基本计量单位
*RETIREMENTDATA-BASE_UOM_ISO = ”.”ISO 代码的计量基本单位
*RETIREMENTDATA-PERC_RATE = ”.”资产报废:百分比率
*RETIREMENTDATA-REV_NBV_IN = ”.”标识:根据帐面净值确定收入
*RETIREMENTDATA-AREA_NBV = ”.”确定帐面净值的基本折旧范围
RETIREMENTDATA-VALUEDATE = ‘20110125′.”参考日期
*RETIREMENTDATA-TRADE_ID = ”.”贸易伙伴的公司标识
*RETIREMENTDATA-TR_PART_BA = ”.”贸易伙伴的业务范围
FURTHERPOSTINGDATA-HEADER_TXT = ‘AAAA’.
FURTHERPOSTINGDATA-ITEM_TEXT = ‘BBBB’.
CALL FUNCTION ‘BAPI_ASSET_RETIREMENT_POST’
EXPORTING
* ORIGINDOCREFERENCE =
GENERALPOSTINGDATA = GENERALPOSTINGDATA
RETIREMENTDATA = RETIREMENTDATA
* ACCOUNTASSIGNMENTS =
FURTHERPOSTINGDATA = FURTHERPOSTINGDATA
IMPORTING
DOCUMENTREFERENCE = DOCUMENTREFERENCE
RETURN = RETURN
.
MESSAGE ID RETURN-ID TYPE RETURN-TYPE NUMBER RETURN-NUMBER
WITH ” ” ” ”.
*MESSAGE
COMMIT WORK AND WAIT.
BREAK-POINT.
②AB08资产凭证冲销AM_REVERSE_DOCUMENT
REPORT RODERICK.
*DATA AM_REVERSE_DOCUMENT
DATA LT_ANEK TYPE TABLE OF ANEK WITH HEADER LINE.
DATA T_ANEK TYPE TABLE OF ANEK WITH HEADER LINE.
DATA LS_ANEK TYPE ANEK.
SELECT * INTO TABLE T_ANEK FROM ANEK WHERE ANLN1 = ‘140203000010′ AND BUKRS = ‘9900′ AND GJAHR = ‘2011′.
READ TABLE T_ANEK INTO LS_ANEK WITH KEY LNRAN = ‘00013′.
CALL FUNCTION ‘AM_REVERSE_DOCUMENT’”AB08资产冲销凭证。
EXPORTING
I_ANEK = ls_ANEK
EXCEPTIONS
REVERSAL_NOT_POSSIBLE = 1
OTHERS = 2
.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*DATA LD_STGRD LIKE T041C-STGRD VALUE ‘01′.
*
*CLEAR LS_ANEK-BUKRS.
*CLEAR LS_ANEK-ANLN1.
*CLEAR LS_ANEK-ANLN2.
*CLEAR LS_ANEK-LNRAN.
*CLEAR LS_ANEK-BUDAT.
*CLEAR LS_ANEK-MONAT.
*
*CALL FUNCTION ‘AMSS_DOCUMENT_REVERSE’
* EXPORTING
* I_AWTYP = LS_ANEK-AWTYP
* I_AWREF = LS_ANEK-BELNR
* I_AWORG = LS_ANEK-AWORG
* I_AWSYS = LS_ANEK-AWSYS
* I_BUKRS = LS_ANEK-BUKRS
* I_ANLN1 = LS_ANEK-ANLN1
* I_ANLN2 = LS_ANEK-ANLN2
* I_GJAHR = LS_ANEK-GJAHR
* I_LNRAN = LS_ANEK-LNRAN
* I_BELNR = LS_ANEK-BELNR
* I_BUDAT = LS_ANEK-BUDAT
* I_MONAT = LS_ANEK-MONAT
* I_STGRD = LD_STGRD
* TABLES
* T_ANEK = LT_ANEK
* EXCEPTIONS
* REVERSAL_NOT_POSSIBLE = 8
* DUBLICATE_OBJECT_KEY = 4.
*
*CHECK SY-SUBRC = 0.
*
*
*DATA: LT_ACCHD LIKE ACCHD OCCURS 0 WITH HEADER LINE.
*DATA: LT_ACCIT LIKE ACCIT OCCURS 0 WITH HEADER LINE.
*DATA: LT_ACCCR LIKE ACCCR OCCURS 0 WITH HEADER LINE.
*DATA: LT_ACCDA LIKE ACCDA OCCURS 0 WITH HEADER LINE.
*DATA: LD_FCODE LIKE SY-UCOMM VALUE ‘BLGP’.
*CALL FUNCTION ‘AMBU_AC_TABLES_GET_FROM_BUFFER’
* TABLES
* T_ACCHD = LT_ACCHD
* T_ACCIT = LT_ACCIT
* T_ACCDA = LT_ACCDA
* T_ACCCR = LT_ACCCR.
*
** Storno-Beleg anzeigen und auf Wunsch RW-Beleg auf die Reise schicken
*CALL FUNCTION ‘AMDP_AC_DOCUMENT_SHOW_AND_POST’
* EXPORTING
* I_AWTYP = LS_ANEK-AWTYP
* I_FCODE = LD_FCODE
* IMPORTING
* E_FCODE = LD_FCODE
* TABLES
* T_ACCIT = LT_ACCIT
* T_ACCHD = LT_ACCHD
* T_ACCDA = LT_ACCDA
* T_ACCCR = LT_ACCCR
* EXCEPTIONS
* OTHERS = 4.
③BAPI_FIXEDASSET_CHANGE更改资产信息
REPORT RODERICK.”更改资产的折旧码
DATA BAPI1022_DEP_AREASX TYPE TABLE OF BAPI1022_DEP_AREASX WITH HEADER LINE.
DATA BAPI1022_DEP_AREAS TYPE TABLE OF BAPI1022_DEP_AREAS WITH HEADER LINE.
DATA BAPI1022_INV_SUPPORT TYPE TABLE OF BAPI1022_INV_SUPPORT WITH HEADER LINE .
DATA BAPIRET2 TYPE TABLE OF BAPIRET2 WITH HEADER LINE.
CLEAR:BAPI1022_DEP_AREAS,BAPI1022_DEP_AREASX.
BAPI1022_DEP_AREAS-DEP_KEY = ‘Z100′.
BAPI1022_DEP_AREAS-AREA = ‘01′.
BAPI1022_DEP_AREAS-ULIFE_YRS = ‘20′.
BAPI1022_DEP_AREAS-ULIFE_PRDS = SPACE.
BAPI1022_DEP_AREAS-ODEP_START_DATE = ‘20101202′.
BAPI1022_DEP_AREAS-INDEX = SPACE.
BAPI1022_DEP_AREAS-DEACTIVATE = ”.
BAPI1022_DEP_AREASX-DEP_KEY = ‘X’.
BAPI1022_DEP_AREASX-AREA = ‘01′.
BAPI1022_DEP_AREASX-ULIFE_YRS = ‘X’.
BAPI1022_DEP_AREASX-ULIFE_PRDS = ‘X’.
BAPI1022_DEP_AREASX-ODEP_START_DATE = ‘X’.
BAPI1022_DEP_AREASX-INDEX = ‘X’.
BAPI1022_DEP_AREAS-DEACTIVATE = ‘X’.
APPEND BAPI1022_DEP_AREAS.
APPEND BAPI1022_DEP_AREASX.
DATA L_ANLN1 TYPE ANLA.
SELECT SINGLE * INTO L_ANLN1 FROM ANLA WHERE BUKRS = ‘9900′ AND ANLN1 = ‘110001000839′.
CALL FUNCTION ‘BAPI_FIXEDASSET_CHANGE’
EXPORTING
COMPANYCODE = L_ANLN1-BUKRS
ASSET = L_ANLN1-ANLN1
SUBNUMBER = L_ANLN1-ANLN2
* GROUPASSET =
* GENERALDATA =
* GENERALDATAX =
* INVENTORY =
* INVENTORYX =
* POSTINGINFORMATION =
* POSTINGINFORMATIONX =
* TIMEDEPENDENTDATA =
* TIMEDEPENDENTDATAX =
* ALLOCATIONS =
* ALLOCATIONSX =
* ORIGIN =
* ORIGINX =
* INVESTACCTASSIGNMNT =
* INVESTACCTASSIGNMNTX =
* NETWORTHVALUATION =
* NETWORTHVALUATIONX =
* REALESTATE =
* REALESTATEX =
* INSURANCE =
* INSURANCEX =
* LEASING =
* LEASINGX =
IMPORTING
RETURN = BAPIRET2
TABLES
DEPRECIATIONAREAS = BAPI1022_DEP_AREAS
DEPRECIATIONAREASX = BAPI1022_DEP_AREASX
* INVESTMENT_SUPPORT =
* EXTENSIONIN =
.
IF BAPIRET2-TYPE CA ‘EA’.
ROLLBACK WORK.
ELSE.
COMMIT WORK AND WAIT.
ENDIF.
BAPI(6)-财务凭证相关 FI Document
星期四, 08月 25th, 2011
①BAPI_ACC_DOCUMENT_CHECK财务凭证过账前检查
CALL FUNCTION ‘BAPI_ACC_DOCUMENT_CHECK’
EXPORTING
DOCUMENTHEADER = HEADER_KJ
* CUSTOMERCPD =
* CONTRACTHEADER =
TABLES
ACCOUNTGL = ITEM_KJ
ACCOUNTRECEIVABLE = CUS_KJ
ACCOUNTPAYABLE = REC_KJ
* ACCOUNTTAX =
CURRENCYAMOUNT = CUR_KJ
* CRITERIA = RKEG_KJ
* VALUEFIELD =
* EXTENSION1 =
RETURN = RESULT_KJ
* PAYMENTCARD =
* CONTRACTITEM =
EXTENSION2 = EXTENSION2
* REALESTATE =
* ACCOUNTWT =
.
②BAPI_ACC_DOCUMENT_POST财务过账
CALL FUNCTION ‘BAPI_ACC_DOCUMENT_POST’
EXPORTING
DOCUMENTHEADER = HEADER_KJ
IMPORTING
OBJ_KEY = LC_KEY
TABLES
ACCOUNTGL = ITEM_KJ
ACCOUNTRECEIVABLE = CUS_KJ
ACCOUNTPAYABLE = REC_KJ
CURRENCYAMOUNT = CUR_KJ
* CRITERIA = RKEG_KJ
EXTENSION2 = EXTENSION2
RETURN = RESULT_KJ.
③BAPI_ACC_DOCUMENT_REV_CHECK会计凭证冲销前检查
REPORT RODERICK.
TABLES: BKPF.
DATA P_BUKRS TYPE BUKRS VALUE ‘9900′.
DATA P_BELNR TYPE BSEG-BELNR VALUE ‘0100000335′.
DATA P_GJAHR TYPE BSEG-GJAHR VALUE ‘2011′.
DATA P_BUDAT TYPE BKPF-BUDAT VALUE ‘20110126′.
DATA:P_AWKEY TYPE AWKEY.
DATA P_SUBRC TYPE SY-SUBRC.
DATA: W_BELNR TYPE BELNR_D,
W_REVERSAL TYPE BAPIACREV,
WT_RETURN TYPE STANDARD TABLE OF BAPIRET2,
WA_RETURN TYPE BAPIRET2.
CLEAR P_SUBRC.
SELECT SINGLE * FROM BKPF
WHERE BUKRS EQ P_BUKRS AND BELNR EQ P_BELNR
AND GJAHR EQ P_GJAHR.
*
CHECK BKPF-BLART = ‘SA’.
SY-UNAME = BKPF-USNAM.
* CONCATENATE W_BELNR P_BUKRS P_GJAHR INTO W_REVERSAL-OBJ_KEY.
W_REVERSAL-OBJ_TYPE = BKPF-AWTYP.
CONCATENATE P_BELNR P_BUKRS P_GJAHR INTO W_REVERSAL-OBJ_KEY_R.
W_REVERSAL-OBJ_KEY = W_REVERSAL-OBJ_KEY_R.
W_REVERSAL-OBJ_KEY = ‘$’.
CALL FUNCTION ‘OWN_LOGICAL_SYSTEM_GET’
IMPORTING
OWN_LOGICAL_SYSTEM = W_REVERSAL-OBJ_SYS
EXCEPTIONS
OWN_LOGICAL_SYSTEM_NOT_DEFINED = 1
OTHERS = 2.
W_REVERSAL-REASON_REV = ‘01′.
W_REVERSAL-PSTNG_DATE = P_BUDAT.
CALL FUNCTION ‘BAPI_ACC_DOCUMENT_REV_CHECK’
EXPORTING
REVERSAL = W_REVERSAL
BUS_ACT = ‘RFBU’
TABLES
RETURN = WT_RETURN.
.
BREAK-POINT.
LOOP AT WT_RETURN INTO WA_RETURN WHERE TYPE CA ‘EA’.
P_SUBRC = 4.
EXIT.
ENDLOOP.
④BAPI_ACC_DOCUMENT_REV_POST会计凭证冲销
REPORT RODERICK.
TABLES: BKPF.
DATA P_BUKRS TYPE BUKRS VALUE ‘9900′.
DATA P_BELNR TYPE BSEG-BELNR VALUE ‘0100000335′.
DATA P_GJAHR TYPE BSEG-GJAHR VALUE ‘2011′.
DATA P_BUDAT TYPE BKPF-BUDAT VALUE ‘20110126′.
DATA:P_AWKEY TYPE AWKEY.
DATA P_SUBRC TYPE SY-SUBRC.
DATA: W_BELNR TYPE BELNR_D,
W_REVERSAL TYPE BAPIACREV,
WT_RETURN TYPE STANDARD TABLE OF BAPIRET2,
WA_RETURN TYPE BAPIRET2.
CLEAR P_SUBRC.
SELECT SINGLE * FROM BKPF
WHERE BUKRS EQ P_BUKRS AND BELNR EQ P_BELNR
AND GJAHR EQ P_GJAHR.
*
CHECK BKPF-BLART = ‘SA’.
SY-UNAME = BKPF-USNAM.
* CONCATENATE W_BELNR P_BUKRS P_GJAHR INTO W_REVERSAL-OBJ_KEY.
W_REVERSAL-OBJ_TYPE = BKPF-AWTYP.
CONCATENATE P_BELNR P_BUKRS P_GJAHR INTO W_REVERSAL-OBJ_KEY_R.
W_REVERSAL-OBJ_KEY = W_REVERSAL-OBJ_KEY_R.
W_REVERSAL-OBJ_KEY = ‘$’.
CALL FUNCTION ‘OWN_LOGICAL_SYSTEM_GET’
IMPORTING
OWN_LOGICAL_SYSTEM = W_REVERSAL-OBJ_SYS
EXCEPTIONS
OWN_LOGICAL_SYSTEM_NOT_DEFINED = 1
OTHERS = 2.
W_REVERSAL-REASON_REV = ‘01′.
W_REVERSAL-PSTNG_DATE = P_BUDAT.
CALL FUNCTION ‘BAPI_ACC_DOCUMENT_REV_POST’
EXPORTING
REVERSAL = W_REVERSAL
BUS_ACT = ‘RFBU’
IMPORTING
* OBJ_TYPE =
OBJ_KEY = P_AWKEY
* OBJ_SYS =
TABLES
RETURN = WT_RETURN.
LOOP AT WT_RETURN INTO WA_RETURN WHERE TYPE CA ‘EA’.
P_SUBRC = 4.
EXIT.
ENDLOOP.
⑤BAPI_ACC_GL_POSTING_POST财务过账
REPORT RODERICK.
DATA: DOCUMENTHEADER LIKE BAPIACHE08,
ACCOUNTGL LIKE BAPIACGL08 OCCURS 0 WITH HEADER LINE,
CURRENCYAMOUNT LIKE BAPIACCR08 OCCURS 0 WITH HEADER LINE,
RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,
RETURN_ALL TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: W_DMBTR TYPE BAPIWRBTR.
DATA: OBJ_TYPE LIKE BAPIACHE02-OBJ_TYPE,
OBJ_KEY LIKE BAPIACHE02-OBJ_KEY,
OBJ_SYS LIKE BAPIACHE02-OBJ_SYS.
DATA P_SUBRC TYPE SY-SUBRC.
DOCUMENTHEADER-USERNAME = SY-UNAME.
DOCUMENTHEADER-HEADER_TXT = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’.
DOCUMENTHEADER-COMP_CODE = ‘9900′.
DOCUMENTHEADER-DOC_DATE = ‘20110126′.
DOCUMENTHEADER-PSTNG_DATE = ‘20110126′.
DOCUMENTHEADER-DOC_TYPE = ‘SA’.
ACCOUNTGL-ITEMNO_ACC = 1.
ACCOUNTGL-GL_ACCOUNT = ‘1516139900′.
ACCOUNTGL-NETWORK = SPACE.”科目分配的网络号
ACCOUNTGL-ITEM_TEXT = ‘01行’.
ACCOUNTGL-ALLOC_NMBR = SPACE.”WBS 要素
ACCOUNTGL-PROFIT_CTR = ‘L990003001′.
*ACCOUNTGL-RSTGR = ‘B05′.
APPEND ACCOUNTGL.
CURRENCYAMOUNT-ITEMNO_ACC = 1.
CURRENCYAMOUNT-CURRENCY = ‘RMB’.
CURRENCYAMOUNT-AMT_DOCCUR = 10.
APPEND CURRENCYAMOUNT.
ACCOUNTGL-ITEMNO_ACC = 2.
*ACCOUNTGL-GL_ACCOUNT = ‘1511010100′.
ACCOUNTGL-NETWORK = SPACE.”科目分配的网络号
ACCOUNTGL-VENDOR_NO = ‘1200000010′.
ACCOUNTGL-ITEM_TEXT = ‘01行’.
ACCOUNTGL-ALLOC_NMBR = SPACE.”WBS 要素
ACCOUNTGL-PROFIT_CTR = ‘L990003001′.
*ACCOUNTGL-RSTGR = ‘B05′.
APPEND ACCOUNTGL.
CURRENCYAMOUNT-ITEMNO_ACC = 2.
CURRENCYAMOUNT-CURRENCY = ‘RMB’.
CURRENCYAMOUNT-AMT_DOCCUR = 0 - 10.
APPEND CURRENCYAMOUNT.
CHECK ACCOUNTGL[] IS NOT INITIAL.
CHECK CURRENCYAMOUNT[] IS NOT INITIAL.
CALL FUNCTION ‘BAPI_ACC_GL_POSTING_POST’
EXPORTING
DOCUMENTHEADER = DOCUMENTHEADER
IMPORTING
OBJ_TYPE = OBJ_TYPE
OBJ_KEY = OBJ_KEY
OBJ_SYS = OBJ_SYS
TABLES
ACCOUNTGL = ACCOUNTGL
CURRENCYAMOUNT = CURRENCYAMOUNT
RETURN = RETURN.
LOOP AT RETURN WHERE TYPE CA ‘EA’.
EXIT.
ENDLOOP.
BAPI(5)-外向交货单相关 DN
星期四, 08月 25th, 2011
①”BAPI_OUTB_DELIVERY_CHANGE
“修改外向交货单的 行数量
report roderick.
data ls_lips type lips.
data ls_marm type marm.
select single * from lips into ls_lips where vbeln = ‘0080000014′ and posnr = ‘900002′.
select single * from marm into ls_marm where matnr = ls_lips-matnr.
data l_bapiobdlvhdrchg type bapiobdlvhdrchg.
data l_bapiobdlvhdrctrlchg type bapiobdlvhdrctrlchg.
data lt_bapiret2 type table of bapiret2 with header line.
data:lt_bapiobdlvitemchg type table of bapiobdlvitemchg with header line.
data lt_bapiobdlvitemctrlchg type table of bapiobdlvitemctrlchg with header line .
l_bapiobdlvhdrctrlchg-deliv_numb = ls_lips-vbeln.
l_bapiobdlvhdrchg-deliv_numb = ls_lips-vbeln.
lt_bapiobdlvitemchg-deliv_numb = ls_lips-vbeln.
lt_bapiobdlvitemchg-deliv_item = ls_lips-posnr.
lt_bapiobdlvitemchg-material = ls_lips-matnr.
lt_bapiobdlvitemchg-dlv_qty = 2.
lt_bapiobdlvitemchg-hieraritem = ls_lips-uecha.”父项行号。可修改“批次”的行数量。
*lt_bapiobdlvitemchg-dlv_qty_imunit = 6.
lt_bapiobdlvitemchg-fact_unit_nom = ls_marm-umrez.
lt_bapiobdlvitemchg-fact_unit_denom = ls_marm-umren.
append lt_bapiobdlvitemchg.
lt_bapiobdlvitemctrlchg-deliv_numb = ls_lips-vbeln.
lt_bapiobdlvitemctrlchg-deliv_item = ls_lips-posnr.
lt_bapiobdlvitemctrlchg-chg_delqty = ‘X’.
append lt_bapiobdlvitemctrlchg.
break-point.
call function ‘BAPI_OUTB_DELIVERY_CHANGE’
exporting
header_data = l_bapiobdlvhdrchg
header_control = l_bapiobdlvhdrctrlchg
delivery = ls_lips-vbeln
tables
item_data = lt_bapiobdlvitemchg
item_control = lt_bapiobdlvitemctrlchg
return = lt_bapiret2[].
if lt_bapiret2[] is initial.
commit work and wait.
endif.
②”vl09
report roderick.
data w_head type likp.
select single * into w_head from likp where vbeln = ‘0080000022′.
data: t_mesg like table of mesg.
break-point.
call function ‘WS_REVERSE_GOODS_ISSUE’
exporting
i_vbeln = w_head-vbeln
i_budat = w_head-wadat_ist
i_tcode = ‘VL09′
i_vbtyp = w_head-vbtyp
tables
t_mesg = t_mesg
exceptions
error_reverse_goods_issue = 1
others = 2.
if sy-subrc = 0.
commit work and wait.
endif
③”VL02N-good issue
report roderick.
data: i_vbkok like vbkok,
i_vbpok_tab like vbpok occurs 0 with header line,
i_prott like prott occurs 0 with header line.
data: begin of wa_error,
anyerr type xfeld,
itmdel type xfeld,
podupd type xfeld,
interf type xfeld,
goodsi type xfeld,
finalc type xfeld,
end of wa_error.
i_vbkok-vbeln_vl = ‘0080000022′. “Delivery number
i_vbkok-wabuc = ‘X’. “Automatic PGI
i_vbkok-wadat_ist = sy-datum.
* i_vbkok-komue = ‘X’.
break-point.
call function ‘WS_DELIVERY_UPDATE’
exporting
vbkok_wa = i_vbkok
commit = ‘X’
delivery = ‘0080000022′
update_picking = ‘X’
if_database_update = ‘1′
if_error_messages_send_0 = ‘X’
importing
ef_error_any_0 = wa_error-anyerr
ef_error_in_item_deletion_0 = wa_error-itmdel
ef_error_in_pod_update_0 = wa_error-podupd
ef_error_in_interface_0 = wa_error-interf
ef_error_in_goods_issue_0 = wa_error-goodsi
ef_error_in_final_check_0 = wa_error-finalc
tables
vbpok_tab = i_vbpok_tab
prot = i_prott
exceptions
error_message = 1
others = 2.
if wa_error is initial.
call function ‘BAPI_TRANSACTION_COMMIT’.
endif
BAPI(4)-创建销售订单 sales order
星期四, 08月 25th, 2011
①SD_SALESDOCUMENT_CREATE
举例:创建销售订单
business_object = ‘BUS2032′
report roderick.
data l_vbeln type vbak-vbeln.
data t_bapiret2 type table of bapiret2 with header line.
data w_head type bapisdhd1.
data w_headx type bapisdhd1x.
data w_sender type bdi_logsys .
data t_item type table of bapisditm with header line .
data t_itemx type table of bapisditmx with header line .
data t_parnr type table of bapiparnr with header line .
data t_schdl type table of bapischdl with header line.
data t_schdlx type table of bapischdlx with header line.
data ls_posnr type vbap-posnr value ‘10′.
*w_sender-logsys = ‘DEVCLNT300′.
w_head-doc_type = ‘ZOR1′.
w_head-sales_org = ‘C100′.
w_head-distr_chan = ‘20′.
w_head-division = ‘10′.
w_headx-doc_type = ‘X’.
w_headx-sales_org = ‘X’.
w_headx-distr_chan = ‘X’.
w_headx-division = ‘X’.
w_headx-updateflag = ‘I’.
t_item-itm_number = ls_posnr.
t_item-material = ‘000000000000000002′.
t_item-target_qty = 4.
append t_item.
t_itemx-itm_number = ls_posnr.
t_itemx-material = ‘X’.
t_itemx-target_qty = ‘X’.
append t_itemx.
t_parnr-partn_role = ‘AG’.
t_parnr-partn_numb = ‘0000100001′.
append t_parnr.
t_parnr-partn_role = ‘RE’.
t_parnr-partn_numb = ‘0000100001′.
append t_parnr.
t_parnr-partn_role = ‘RG’.
t_parnr-partn_numb = ‘0000100001′.
append t_parnr.
t_parnr-partn_role = ‘WE’.
t_parnr-partn_numb = ‘0000100001′.
append t_parnr.
t_schdl-itm_number = ls_posnr.
t_schdl-sched_line = ‘1′.
t_schdl-req_date = ‘20110902′.
t_schdl-req_qty = 1.
append t_schdl.
t_schdl-itm_number = ls_posnr.
t_schdl-sched_line = ‘2′.
t_schdl-req_date = ‘20110907′.
t_schdl-req_qty = 3.
append t_schdl.
t_schdlx-itm_number = ls_posnr.
t_schdlx-sched_line = ‘1′.
t_schdlx-req_date = ‘X’.
t_schdlx-req_qty = ‘X’.
t_schdlx-updateflag = ‘I’.
append t_schdlx.
t_schdlx-itm_number = ls_posnr.
t_schdlx-sched_line = ‘2′.
t_schdlx-req_date = ‘X’.
t_schdlx-req_qty = ‘X’.
t_schdlx-updateflag = ‘I’.
append t_schdlx.
break-point.
call function ‘SD_SALESDOCUMENT_CREATE’
exporting
sales_header_in = w_head
sales_header_inx = w_headx
sender = w_sender
business_object = ‘BUS2032′
tables
return = t_bapiret2
sales_items_in = t_item
sales_items_inx = t_itemx
sales_partners = t_parnr
sales_schedules_in = t_schdl
sales_schedules_inx = t_schdlx.
break-point.
*
commit work and wait
②’BAPI_SALESORDER_CREATEFROMDAT2′
report roderick.
data l_vbeln type vbak-vbeln.
data t_bapiret2 type table of bapiret2 with header line.
data w_head type bapisdhd1.
data w_headx type bapisdhd1x.
data w_sender type bdi_logsys .
data t_item type table of bapisditm with header line .
data t_itemx type table of bapisditmx with header line .
data t_parnr type table of bapiparnr with header line .
data t_schdl type table of bapischdl with header line.
data t_schdlx type table of bapischdlx with header line.
data ls_posnr type vbap-posnr value ‘10′.
*w_sender-logsys = ‘DEVCLNT300′.
w_head-doc_type = ‘ZOR1′.
w_head-sales_org = ‘C100′.
w_head-distr_chan = ‘20′.
w_head-division = ‘10′.
w_headx-doc_type = ‘X’.
w_headx-sales_org = ‘X’.
w_headx-distr_chan = ‘X’.
w_headx-division = ‘X’.
w_headx-updateflag = ‘I’.
t_item-itm_number = ls_posnr.
t_item-material = ‘000000000000000002′.
t_item-target_qty = 4.
append t_item.
t_itemx-itm_number = ls_posnr.
t_itemx-material = ‘X’.
t_itemx-target_qty = ‘X’.
append t_itemx.
t_parnr-partn_role = ‘AG’.
t_parnr-partn_numb = ‘0000100001′.
append t_parnr.
t_parnr-partn_role = ‘RE’.
t_parnr-partn_numb = ‘0000100001′.
append t_parnr.
t_parnr-partn_role = ‘RG’.
t_parnr-partn_numb = ‘0000100001′.
append t_parnr.
t_parnr-partn_role = ‘WE’.
t_parnr-partn_numb = ‘0000100001′.
append t_parnr.
t_schdl-itm_number = ls_posnr.
t_schdl-sched_line = ‘1′.
t_schdl-req_date = ‘20110902′.
t_schdl-req_qty = 1.
append t_schdl.
t_schdl-itm_number = ls_posnr.
t_schdl-sched_line = ‘2′.
t_schdl-req_date = ‘20110907′.
t_schdl-req_qty = 3.
append t_schdl.
t_schdlx-itm_number = ls_posnr.
t_schdlx-sched_line = ‘1′.
t_schdlx-req_date = ‘X’.
t_schdlx-req_qty = ‘X’.
t_schdlx-updateflag = ‘I’.
append t_schdlx.
t_schdlx-itm_number = ls_posnr.
t_schdlx-sched_line = ‘2′.
t_schdlx-req_date = ‘X’.
t_schdlx-req_qty = ‘X’.
t_schdlx-updateflag = ‘I’.
append t_schdlx.
break-point.
call function ‘BAPI_SALESORDER_CREATEFROMDAT2′
exporting
* salesdocumentin = wa_vbeln-vbeln
order_header_in = w_head
order_header_inx = w_headx
importing
salesdocument = l_vbeln
tables
return = t_bapiret2
order_partners = t_parnr
order_schedules_in = t_schdl
order_schedules_inx = t_schdlx
order_items_in = t_item
order_items_inx = t_itemx .
break-point.
commit work and wait.
BAPI(3)-物料主数据 Material
星期四, 08月 25th, 2011
①调用MM02
CALL FUNCTION ‘BAPI_MATERIAL_EDIT’
EXPORTING
MATERIAL = W_MATNR-MATERIAL”物料
SKIP_1ST_SCREEN = ‘X’ “SKIP FIRST SCREEN?
IMPORTING
RETURN = W_MESS.” 消息
②REPORT YTEST002 MESSAGE-ID Z01.
TABLES: MARA,
MARC,
MBEW.
DATA: BEGIN OF RETURNX.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF RETURNX.
DATA RETURN LIKE RETURNX OCCURS 0 WITH HEADER LINE.
DATA W_HEAD TYPE BAPIMATHEAD .
DATA T_MAKT TYPE TABLE OF BAPI_MAKT.
DATA W_MAKT TYPE BAPI_MAKT.
DATA W_MARC TYPE BAPI_MARC.
DATA W_MARCX TYPE BAPI_MARCX.
DATA W_MARA TYPE BAPI_MARA.
DATA W_MARAX TYPE BAPI_MARAX.
CLEAR W_HEAD.
W_HEAD-MATERIAL = ‘000000000010345190′.”物料号
W_HEAD-IND_SECTOR = ‘M’.”行业领域
W_HEAD-MATL_TYPE = ‘Z01′.”物料类型
W_HEAD-BASIC_VIEW = ‘X’.”基本数据视图
W_HEAD-SALES_VIEW = ‘X’.”销售试图
W_HEAD-MRP_VIEW = ‘X’.”mrp视图
CLEAR W_MAKT.
W_MAKT-LANGU = ‘1′.”语言代码
W_MAKT-MATL_DESC = ‘BAPI测试’.”物料描述(短文本)
APPEND W_MAKT TO T_MAKT.
CLEAR W_MARA.
W_MARA-OLD_MAT_NO = ‘000000000010131517′.”旧物料号
W_MARA-BASE_UOM = ‘EA’.”基本计量单位
W_MARA-PROD_MEMO = ‘1234′.”生产/检验备忘录
W_MARA-DSN_OFFICE = ‘Y’.”实验室/办公室
*W_MARA-STD_DESCR = ‘BAPI_TEST’.”行业标准描述
W_MARA-DIVISION = ‘20′.”产品组
CLEAR W_MARAX.
W_MARAX-OLD_MAT_NO = ‘X’.
W_MARAX-BASE_UOM = ‘X’.
*W_MARAX-PROD_MEMO = ‘X’.
W_MARAX-DSN_OFFICE = ‘X’.
W_MARAX-DIVISION = ‘X’.
CLEAR W_MARC.
W_MARC-PLANT = ‘1101′. “工厂
W_MARC-AVAILCHECK = ‘02′.”可用性检查的检查组
W_MARC-MRP_TYPE = ‘PD’.”MRP类型
W_MARC-MRP_CTRLER = ‘104′.”MRP控制者
W_MARC-SM_KEY = ‘000′.”计划边际码
W_MARC-LOTSIZEKEY = ‘Z2′.”MRP批量大小
W_MARC-DEP_REQ_ID = ‘2′.
CLEAR W_MARCX.
W_MARCX-PLANT = ‘1101′.
W_MARCX-AVAILCHECK = ‘X’.
W_MARCX-MRP_TYPE = ‘X’.
W_MARCX-MRP_CTRLER = ‘X’.
W_MARCX-SM_KEY = ‘X’.
W_MARCX-LOTSIZEKEY = ‘X’.
W_MARCX-DEP_REQ_ID = ‘X’.
CALL FUNCTION ‘BAPI_MATERIAL_SAVEDATA’
EXPORTING
HEADDATA = W_HEAD
CLIENTDATA = W_MARA
CLIENTDATAX = W_MARAX
PLANTDATA = W_MARC
PLANTDATAX = W_MARCX
IMPORTING
RETURN = RETURN
TABLES
MATERIALDESCRIPTION = T_MAKT
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT’.
WRITE:/
RETURN-MESSAGE.
WRITE:/ ‘ok….’.
BAPI(2)-物料移动 BAPI_GOODSMVT_CREATE星期四, 08月 25th, 2011
goodsmvt_header-pstng_date = sy-datum.”凭证中的过帐日期
goodsmvt_header-doc_date = sy-datum.”凭证中的凭证日期
goodsmvt_header-pr_uname = sy-uname.”用户名
code-gm_code = ‘04′.”04:MB1B;
item-material = w_resb-matnr.
item-plant = w_resb-werks.
item-stge_loc = kw_ekpo-lgort.
item-move_type = ‘541′.
item-stck_type = ‘ ‘.
item-entry_qnt = w_resb-menge.
item-entry_uom = kw_ekpo-meins.
item-po_number = kw_ekpo-ebeln.
item-po_item = kw_ekpo-ebelp.
item-move_plant = kw_ekpo-werks.
item-vendor = ekko_info-lifnr.
concatenate kw_ekpo-ebeln kw_ekpo-ebelp
into item-item_text.”MSEG-SGTXT
append item.
call function ‘BAPI_GOODSMVT_CREATE’
exporting
goodsmvt_header = goodsmvt_header
goodsmvt_code = code
* TESTRUN = ‘ ‘
* GOODSMVT_REF_EWM =
importing
goodsmvt_headret = return_mseg
tables
goodsmvt_item = item[]
* goodsmvt_serialnumber = bapi2017_gm_serialnumber[]
return = return[]
* goodsmvt_serv_part_data = aa[]
* extensionin = bb[]
* goodsmvt_item_cwm = cc[]
.
BAPI(1)-TO/TR相关
星期四, 08月 25th, 2011
具体路径如下:
->SAP library
->SAP ERP Central Component
->Logistics Execution (LE)
->00000939.chm :Warehouse Management System (WMS)
->Basic Functions
->Warehouse Controlling
->Function Modules and Customer Exits in WMS
MM模块
1、 BAPI_MATERIAL_SAVEDATA 创建物料主数据
注意参数EXTENSIONIN的使用,可以创建自定义字段
例如WA_BAPI_TE_MARA-MATERIAL = ITAB_UP-MATNR.
T_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MARA'.
T_EXTENSIONIN-VALUEPART1 = WA_BAPI_TE_MARA.
APPEND T_EXTENSIONIN.
WA_BAPI_TE_MARAX-MATERIAL = ITAB_UP-MATNR.
T_EXTENSIONINX-STRUCTURE = 'BAPI_TE_MARAX'.
T_EXTENSIONINX-VALUEPART1 = WA_BAPI_TE_MARAX.
APPEND T_EXTENSIONINX.
2、 BAPI_OBJCL_CREATE 分类视图的创建
3、 BAPI_OBJCL_GETCLASSES 分类视图得到详细信息
4、 BAPI_MATERIAL_SAVEREPLICA 物料视图的扩充
5、 BAPI_GOODSMVT_CREATE 创建物料凭证 注意表T158G可以决定goodsmvt_code
6、 BAPI_GOODSMVT_CANCEL 冲销物料凭证
7、 BAPI_PR_CREATE 创建PR
8、 BAPI_PO_CREATE1 创建PO
9、 BAPI_PO_CHANGE 修改PO和删除PO
10、WS_REVERSE_GOODS_ISSUE 冲销交货单的过账发货
11、BAPI_RESERVATION_CREATE1 创建预留
12、BAPI_RESERVATION_CHANGE 修改和删除预留
SD模块
1、 BAPI_SALESORDER_CREATEFROMDAT2 创建销售订单
2、 SD_SALESDOCUMENT_CREATE 创建销售订单
3、 BAPI_OUTB_DELIVERY_CREATE_SLS 根据销售订单创建交货单
4、 BAPI_BILLINGDOC_CREATEMULTIPLE 创建发票,注意参数ref_doc_ca
5、 BAPI_SALESORDER_CHANGE 修改或者删除销售订单
6、 MB_CANCEL_GOODS_MOVEMENT 冲销交货单的过账发货
7、 BAPI_BILLINGDOC_CANCEL 发票的冲销
PM模块
1、BAPI_OBJCL_CREATE 、BAPI_OBJCL_CHANGE、BAPI_OBJCL_GETDETAIL
计量点通用属性导入
2、MEASUREM_DOCUM_RFC_SINGLE_001 计量凭证创建
FI模块
1、K_HIERARCHY_TABLES_READ 成本要素组明细
2、BAPI_ACC_DOCUMENT_POST 创建会计凭证
3、BAPI_ACC_DOCUMENT_REV_POST 反冲会计凭证
PS模块
1、BAPI_PS_INITIALIZATION、BAPI_BUS2001_CREATE、BAPI_PS_PRECOMMIT 创建项目定义
2、BAPI_PS_INITIALIZATION、BAPI_BUS2054_CREATE_MULTI、BAPI_PS_PRECOMMIT 创建WBS
创建WBS的时候,注意参数 wbs_left和 wbs_up,这个是创建有层级的WBS必须要填写的
3、KBPP_EXTERN_UPDATE_CO 修改项目和WBS的预算
1 BAPI的优点
bapi是面向对象的设计;
bapi是固定的,一般不能修改;
bapi可以被sap内部部件和非sap程序使用;
bapi的成功和错误信息始终通过RETURN返回;
bapi可以被许多开发平台使用;
2 何时该考虑使用BAPI设计程序
用VB/JAVA?C++等语言编写非SAPGUI程序访问和处理sap数据;
SAP不同部件之间通讯;
与非sap程序或者老系统交换数据:
使用异步通信分发数据如:ALE
可以通过SAP Business Connector or Internet Application Components 与因特网程序集成;
3 关于RETURN
RETURN用于BAPI返回错误和成功的消息,它可以是BAPIRETURN,BAPIRETURN,BAPIRET1,BAPIRET2和BAPIRET2_FIX中的一种类型.这些结构一般都包括以下字段:
通过TCODE来查找相应BAPI
如果我们找BAPI可以通过SAP标准事物代码:BAPI查询到已经释放的BAPI.
如果只知道事物代码,可以通过下面的方式查询相应的BAPI.
例如我们找创建销售订单的BAPI 我们知道事物代码是VA01.
1、 我们进入VA01 界面,找到system –> status
2、 在事物代码位置上双击,找到PACKAGE VA
3、 用SE80打开包 VA
4、 打开业务工程—》业务对象类型。根据我们的业务需求。我们要找销售订单的创建,所有BUS2032 销售订单 的可能性最大。
5、 双击 BUS2032 打开方法 ,寻找和创建销售订单名字相同的方法 这里我们要找的就是SalesOrder.CreateFromDat2。将光标定位在 这个一行 点击 上面的程序 按钮。 即可看见程序源代码找到 ‘BAPI_SALESORDER_CREATEFROMDAT2。同样的我们可以看到修改订单的BAPI.删除的BAPI,我们也可以使用同样的方法找找。
6、 同样我们可以双击SalesOrder.CreateFromDat2 行 ,在弹出的窗口中找到 ABAP 子屏幕。如果单选按钮是 API功能 ,名称一栏即为我们要找BAPI.,如果是函数模块即为一个FM
如下图:
7、 通过包我们也可以找到该包下所有的程序和函数组。
各个模块对应BAPI1、 BAPI_MATERIAL_SAVEDATA 创建物料主数据
注意参数EXTENSIONIN的使用,可以创建自定义字段
例如WA_BAPI_TE_MARA-MATERIAL = ITAB_UP-MATNR.
T_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MARA'.
T_EXTENSIONIN-VALUEPART1 = WA_BAPI_TE_MARA.
APPEND T_EXTENSIONIN.WA_BAPI_TE_MARAX-MATERIAL = ITAB_UP-MATNR.
T_EXTENSIONINX-STRUCTURE = 'BAPI_TE_MARAX'.
T_EXTENSIONINX-VALUEPART1 = WA_BAPI_TE_MARAX.
APPEND T_EXTENSIONINX.2、 BAPI_OBJCL_CREATE 分类视图的创建
3、 BAPI_OBJCL_GETCLASSES 分类视图得到详细信息
4、 BAPI_MATERIAL_SAVEREPLICA 物料视图的扩充
5、 BAPI_GOODSMVT_CREATE 创建物料凭证注意表T158G可以决定goodsmvt_code
6、 BAPI_GOODSMVT_CANCEL 冲销物料凭证
7、 BAPI_PR_CREATE 创建PR
8、 BAPI_PO_CREATE1 创建PO
9、 BAPI_PO_CHANGE 修改PO和删除PO
10、WS_REVERSE_GOODS_ISSUE 冲销交货单的过账发货
11、BAPI_RESERVATION_CREATE1 创建预留
12、BAPI_RESERVATION_CHANGE 修改和删除预留
BAPI_MATERIAL_SAVEDATA 建立/更改物料主檔 BAPI_OBJCL_CREATE 建立/更改物料主檔分類 BAPI_OBJCL_CHANGE 建立/更改物料主檔分類 CLMM_MAINTAIN_CLASSIFICATIONS 批量建立/更改物料主檔分類 CLAF_CLASSIFICATION_OF_OBJECTS 顯示物料主檔分類特性值 BAPI_MATERIAL_EXISTENCECHECK 檢查物料主檔是否存在 BAPI_MATERIAL_GETLIST 顯示物料主檔明細 BAPI_PO_CREATE1 建立采購單 BAPI_PO_CHANGE 更改采購單 BAPI_PO_GETDETAIL 顯示采購單明細 BAPI_PO_RELEASE 核發采購單 BAPI_REQUISITION_CREATE 建立請購單 BAPI_REQUISITION_CHANGE 更改請購單 BAPI_REQUISITION_GETDETAIL 顯示請購單明細 BAPI_REQUISITION_RELEASE_GEN 核發請購單 BAPI_CHARACT_CREATE 建立特性 BAPI_CHARACT_CHANGE 更改特性 BAPI_CHARACT_DELETE 刪除特性 BAPI_CHARACT_RENAME 重新命名特性 BAPI_CHARACT_GETDETAIL 讀取特性屬性 BAPI_CHARACT_ADDLONGTEXT 設定特性或數值的長文 BAPI_CHARACT_REMOVELONGTEXT 刪除特性或數值的長文 BAPI_CHARACT_GETLONGTEXT 讀取數值的特性長文 CARD_CHARACTERISTIC_READ 顯示特性值的值列表 BAPI_CLASS_CREATE 建立類別 BAPI_CLASS_CHANGE 變更類別 BAPI_CLASS_DELETE 刪除類別 BAPI_CLASS_GETDETAIL 讀取類別資訊(取分類下特性及特性值) BAPI_CLASS_EXISTENCECHECK 檢查物件存在性 BAPI_VENDOR_GETDETAIL 顯示供應商明細 BAPI_VENDOR_EXISTENCECHECK 檢查存在性 BAPI_MATERIALGROUP_GET_LIST 讀取物料群組/物料群組說明 BAPI_GOODSMVT_CREATE 過帳物料異動 BAPI_GOODSMVT_CANCEL 沖帳(取消)物料異動 BAPI_GOODSMVT_GETDETAIL 顯示物料異動明細 BAPI_GOODSMVT_GETITEMS 顯示物料文件的明細清單
WM部分:
L_TO_CREATE_SINGLE 创建转储单
L_TO_CONFIRM 确认转储单
L_COUNT_DATA_PROCESS 录入数据盘点信息(I_KZNUL= 'X'.)
L_ZAEHLUNG_BUCHEN TO CREATE THE CURR INVENTORY ANTRY
LXDCC_INACT_INV_INSERT UPGRADE CURR INVENTORY ANTRY
1、 BAPI_SALESORDER_CREATEFROMDAT2 创建销售订单
2、 SD_SALESDOCUMENT_CREATE 创建销售订单
3、 BAPI_OUTB_DELIVERY_CREATE_SLS 根据销售订单创建交货单
4、 BAPI_BILLINGDOC_CREATEMULTIPLE 创建发票,注意参数ref_doc_ca
5、 BAPI_SALESORDER_CHANGE 修改或者删除销售订单
6、 MB_CANCEL_GOODS_MOVEMENT 冲销交货单的过账发货
7、 BAPI_BILLINGDOC_CANCEL 发票的冲销
PM模块
1、BAPI_OBJCL_CREATE 、BAPI_OBJCL_CHANGE、BAPI_OBJCL_GETDETAIL
计量点通用属性导入
2、MEASUREM_DOCUM_RFC_SINGLE_001 计量凭证创建
1、K_HIERARCHY_TABLES_READ 成本要素组明细
2、BAPI_ACC_DOCUMENT_POST 创建会计凭证
3、BAPI_ACC_DOCUMENT_REV_POST 反冲会计凭证
1、BAPI_PS_INITIALIZATION、BAPI_BUS2001_CREATE、BAPI_PS_PRECOMMIT 创建项目定义
2、BAPI_PS_INITIALIZATION、BAPI_BUS2054_CREATE_MULTI、BAPI_PS_PRECOMMIT 创建WBS
创建WBS的时候,注意参数 wbs_left和 wbs_up,这个是创建有层级的WBS必须要填写的
3、KBPP_EXTERN_UPDATE_CO 修改项目和WBS的预算
FI常用BAPI
总帐会计: (比较简单全部测试通过,关帐时使用)
Line item of document for ledger with summary table GL
F: BAPI_GLX_GETDOCITEMS
Closing balance of G/L account for chosen year
F: BAPI_GL_GETGLACCBALANCE
Closing balance of G/L account for current year
F: BAPI_GL_GETGLACCCURRENTBALANCE
Posting period balances for each G/L account
F: BAPI_GL_GETGLACCPERIODBALANCES
应付帐款: (比较简单全部测试通过,按照公司代码,供应商代码和起至时间来查询)
读取已清算科目行项目
F: BAPI_AP_ACC_GETBALANCEDITEMS
读取当前余额
F: BAPI_AP_ACC_GETCURRENTBALANCE
读取关键日期余额
F: BAPI_AP_ACC_GETKEYDATEBALANCE
读取未清科目项
F: BAPI_AP_ACC_GETOPENITEMS
读取科目余额
F: BAPI_AP_ACC_GETPERIODBALANCES
读取科目过帐
F: BAPI_AP_ACC_GETSTATEMENT
应收款: (比较简单,传入值,没有要求输入内表类型的;;按照公司代码,供应商代码和起至时间来查询)
确定主数据
F: BAPI_CR_ACC_GETDETAIL
确定最高催款级别
F: BAPI_CR_ACC_GETHIGHESTDUNNINGL
确定最旧的未清项目
F: BAPI_CR_ACC_GETOLDESTOPENITEM
确定 OI 结构
F: BAPI_CR_ACC_GETOPENITEMSSTRUCT
确定贷方帐户的信用状态
F: BAPI_CREDIT_ACCOUNT_GET_STATUS
BAPI: 取余额项目: 客户
F: BAPI_AR_ACC_GETBALANCEDITEMS
BAPI: 取实际余额: 客户
F: BAPI_AR_ACC_GETCURRENTBALANCE
BAPI: 取关键日期余额: 客户
F: BAPI_AR_ACC_GETKEYDATEBALANCE
BAPI: 取未清项: 客户
F: BAPI_AR_ACC_GETOPENITEMS
BAPI: 取余额: 客户
F: BAPI_AR_ACC_GETPERIODBALANCES
BAPI: 取科目报表: 客户
F: BAPI_AR_ACC_GETSTATEMENT
读取客户销售范围
F: BAPI_CUSTOMER_GETSALESAREAS
银行会计:
取消支付请求
F: BAPI_PAYMENTREQUEST_CANCEL
支付请求的创建
F: BAPI_PAYMENTREQUEST_CREATE
列出支付请求
F: BAPI_PAYMENTREQUEST_GETLIST
支付请求状态的确定
F: BAPI_PAYMENTREQUEST_GETSTATUS
过帐预制凭证请求
F: BAPI_PAYMENTREQUEST_POST
批准支付的支付请求
F: BAPI_PAYMENTREQUEST_RELEASE
开始支付的支付请求
F: BAPI_PAYMENTREQ_STARTPAYMENT
资产全计核算
更改资产
F: BAPI_FIXEDASSET_CHANGE
创建资产
F: BAPI_FIXEDASSET_CREATE
使用值创建资产 (初始历史遗留数据传输)
F: BAPI_FIXEDASSET_OVRTAKE_CREATE
资产的明细信息
F: BAPI_FIXEDASSET_GETDETAIL
选定资产的信息
F: BAPI_FIXEDASSET_GETLIST
检查资本记帐
F: BAPI_ASSET_POSTCAP_CHECK
记帐资本总额
F: BAPI_ASSET_POSTCAP_POST
检查资产报废
F: BAPI_ASSET_RETIREMENT_CHECK
记帐资产报废
F: BAPI_ASSET_RETIREMENT_POST
检查资产购置
F: BAPI_ASSET_ACQUISITION_CHECK
记帐资产购置
F: BAPI_ASSET_ACQUISITION_POST
特殊用途分类帐:
特殊目的分类帐: 选择科目的总计记录
F: BAPI_SL_GETTOTALRECORDS
总帐科目
检查总帐科目是否存在
F: BAPI_GL_ACC_EXISTENCECHECK
总帐科目明细
F: BAPI_GL_ACC_GETDETAIL
每个公司代码总帐科目的清单
F: BAPI_GL_ACC_GETLIST
会计核算--会计接口
会计核算:冲销凭证
F: BAPI_ACC_ACT_POSTINGS_REVERSE
会计:核算冲销
F: BAPI_ACC_DOCUMENT_REV_CHECK
会计: 过帐凭证
F: BAPI_ACC_DOCUMENT_POST
会计:过帐冲销
F: BAPI_ACC_DOCUMENT_REV_POST
会计:总帐科目记帐
F: BAPI_ACC_GL_POSTING_CHECK
会计: 检查一般总分类帐科目过帐的冲销
F: BAPI_ACC_GL_POSTING_REV_CHECK
会计:总帐科目记帐
F: BAPI_ACC_GL_POSTING_POST
会计核算: 过帐一般总帐过帐冲销
F: BAPI_ACC_GL_POSTING_REV_POST
会计销售订单
会计:检查销售订单
F: BAPI_ACC_SALES_ORDER_CHECK
会计:记帐销售订单
F: BAPI_ACC_SALES_ORDER_POST
会计核算:冲销凭证
F: BAPI_ACC_ACT_POSTINGS_REVERSE
会计: 过帐票据凭证冲销 (OAG: LOAD RECEIVABLE)
F: BAPI_ACC_BILLING_REV_POST
会计: 检查货物移动 (OAG: POST JOURNAL)
F: BAPI_ACC_GOODS_MOVEMENT_CHECK