FUNCTION ZFUN_UDP_AC_DOC_ZUONR.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(BUKRS) TYPE BUKRS OPTIONAL
*" VALUE(GJAHR) TYPE GJAHR OPTIONAL
*" VALUE(BELNR) TYPE BELNR_D OPTIONAL
*" VALUE(XREF1_HD) TYPE XREF1_HD OPTIONAL
*"----------------------------------------------------------------------
* Global data declarations
SELECT SINGLE * FROM BSEG WHERE BUKRS = BUKRS
AND GJAHR = GJAHR
AND BELNR = BELNR.
IF SY-SUBRC = 0 .
SELECT *
FROM BKPF
INTO CORRESPONDING FIELDS OF TABLE T_BKPF
WHERE BUKRS = BUKRS
AND GJAHR = GJAHR
AND BELNR = BELNR.
IF SY-SUBRC NE 0 .
EXIT.
ENDIF.
SELECT *
FROM BSEG
INTO CORRESPONDING FIELDS OF TABLE T_BSEG
FOR ALL ENTRIES IN T_BKPF
WHERE BELNR = T_BKPF-BELNR
AND BUKRS = T_BKPF-BUKRS
AND GJAHR = T_BKPF-GJAHR.
LOOP AT T_BKPF.
T_BKPF-XREF1_HD = XREF1_HD.
MODIFY T_BKPF TRANSPORTING XREF1_HD .
ENDLOOP.
CALL FUNCTION 'CHANGE_DOCUMENT'
TABLES
T_BKDF = T_BKDF
T_BKPF = T_BKPF
T_BSEC = T_BSEC
T_BSED = T_BSED
T_BSEG = T_BSEG
T_BSET = T_BSET.
ENDIF.
ENDFUNCTION.
阅读(1168) | 评论(0) | 转发(0) |