点击此处---> 群内免费提供SAP练习系统(在群公告中)
加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)
调用bapi后
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
EXPORTING
POSTING = ZCL_BXYZ=>CNS_A
TABLES
BILLINGDATAIN = LT_BILLINGDATAIN
CONDITIONDATAIN = LT_CONDITIONDATAIN
RETURN = LT_RETURN
SUCCESS = LT_SUCCESS.
LT_SUCCESS 获取 EV_DOCNR = LS_SUCCESS-BILL_DOC.
CALL FUNCTION 'ZBXYZ_VF_POST' IN UPDATE TASK
EXPORTING
IV_DOCNR = EV_DOCNR.
FUNCTION ZBXYZ_VF_POST.
DATA LS_VBRK TYPE VBRK.
DATA LT_XKOMFK LIKE TABLE OF KOMFK.
DATA LT_XKOMV LIKE TABLE OF KOMV.
DATA LT_XTHEAD LIKE TABLE OF THEADVB.
DATA LT_XVBFS LIKE TABLE OF VBFS.
DATA LT_XVBPA LIKE TABLE OF VBPAVB.
DATA LT_XVBRK LIKE TABLE OF VBRKVB.
DATA LT_XVBRP LIKE TABLE OF VBRPVB.
DATA LT_XVBSS LIKE TABLE OF VBSS.
DATA LS_VBSK TYPE VBSK.
FIELD-SYMBOLS TYPE VBRKVB..
EXPORT P1 = ZCL_BXYZ=>CNS_X TO MEMORY ID 'ZVF01_ENHANCEMENT'.
SELECT SINGLE *
INTO LS_VBRK
FROM VBRK
WHERE VBELN = IV_DOCNR
AND RFBSK NE ZCL_BXYZ=>CNS_C.
CHECK SY-SUBRC = 0.
CALL FUNCTION 'RV_INVOICE_DOCUMENT_READ'
EXPORTING
VBRK_I = LS_VBRK
I_NO_AUTHORITY_CHECK = ZCL_BXYZ=>CNS_X
TABLES
XKOMV = LT_XKOMV
XVBPA = LT_XVBPA
XVBRK = LT_XVBRK
XVBRP = LT_XVBRP
XKOMFK = LT_XKOMFK
XVBFS = LT_XVBFS
XTHEAD = LT_XTHEAD
XVBSS = LT_XVBSS.
IF SY-SUBRC <> 0.
MESSAGE 'A' TYPE 'A'.
ENDIF.
LOOP AT LT_XVBRK ASSIGNING .
CLEAR -RFBSK.
ENDLOOP.
CALL FUNCTION 'RV_INVOICE_DOCUMENT_ADD'
EXPORTING
VBSK_I = LS_VBSK
WITH_POSTING = ZCL_BXYZ=>CNS_A
PREISFINDUNGSART = ZCL_BXYZ=>CNS_I
WITHOUT_REFRESH = ZCL_BXYZ=>CNS_X
IMPORTING
VBSK_E = LS_VBSK
TABLES
XKOMFK = LT_XKOMFK
XTHEAD = LT_XTHEAD
XVBFS = LT_XVBFS
XVBSS = LT_XVBSS
XVBRK = LT_XVBRK
XVBRP = LT_XVBRP
XVBPA = LT_XVBPA
XKOMV = LT_XKOMV.
ENDFUNCTION.
SMOD:SDVFX001
创建CMOD 激活增强
FM:EXIT_SAPLV60B_001
DATA LV_BXYZ TYPE CHAR1.
IMPORT P1 = LV_BXYZ FROM MEMORY ID 'ZVF01_ENHANCEMENT'.
IF LV_BXYZ IS NOT INITIAL.
XACCHD-TCODE = 'VF02'.
SY-TCODE = 'VF02'.
ENDIF.
2017-08-10 补充,SAP 通过配置可以自动审核至会计.