久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

SAP憑證沖銷BAPI用法

 沈雙鷹展翅 2014-03-04

SAP憑證沖銷BAPI用法  

2012-01-17 10:03:00|  分類: SAP-ABAP |舉報 |字號 訂閱

①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.

    本站是提供個人知識管理的網絡存儲空間,,所有內容均由用戶發(fā)布,不代表本站觀點,。請注意甄別內容中的聯(lián)系方式,、誘導購買等信息,謹防詐騙,。如發(fā)現有害或侵權內容,,請點擊一鍵舉報,。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多