*** Considering document date instead of posting date in ZFI_AP_AGEING
** IF ( SY-TCODE = 'ZFI_VENDOR_AGEING' ) .
**REFRESH XBSAK.
*** Variante 1: Offene Posten zu einem bestimmten Stichtag
** if KD_OPOPT = 'X' and KD_APOPT ne 'X'.
** if B0SG-XNOPL is initial.
** select (BSIK_FIELDS) from BSAK
** into corresponding fields of table XBSAK
** for all entries in K_LIFNR
** where LIFNR eq K_LIFNR-LOW
** and BUKRS in KD_BUKRS
*** AND GJAHR IN KD_GJAHR
*** AND AUGDT BETWEEN '00010101'
*** AND '99991231'
** and BlDAT in KD_BUDAT
** and BlDAT le KD_STIDA
** and AUGDT gt KD_STIDA
** and ZUONR in KD_ZUONR
** and UMSKZ in KD_UMSKZ
** and SHKZG in KD_SHKZG
** and BSCHL in KD_BSCHL
** and (BSIK_WHERE).
** endif.
** endif. "Variante 1
*** Variante 2: Ausgegl. Posten in einem Datumsintervall
** if KD_OPOPT ne 'X' and KD_APOPT = 'X'.
** select (BSIK_FIELDS) from BSAK
** into corresponding fields of table XBSAK
** for all entries in K_LIFNR
** where LIFNR eq K_LIFNR-LOW
** and BUKRS in KD_BUKRS
*** AND GJAHR IN KD_GJAHR
*** AND AUGDT BETWEEN '00010101'
*** AND '99991231'
** and BUDAT in KD_BUDAT
** and AUGDT in KD_AUGDT
** and ZUONR in KD_ZUONR
** and UMSKZ in KD_UMSKZ
** and SHKZG in KD_SHKZG
** and BSCHL in KD_BSCHL
** and (BSIK_WHERE).
** endif. "Variante 2
*** Variante 3: Variante 1 + 2 gleichzeitig
** if KD_OPOPT eq 'X' and KD_APOPT eq 'X'.
** select (BSIK_FIELDS) from BSAK
** into corresponding fields of XBSAK
** for all entries in K_LIFNR
** where LIFNR eq K_LIFNR-LOW
** and BUKRS in KD_BUKRS
*** AND GJAHR IN KD_GJAHR
*** AND AUGDT BETWEEN '00010101'
*** AND '99991231'
** and BUDAT in KD_BUDAT
** and BUDAT le KD_STIDA
*** AND AUGDT GT KD_STIDA
*** OR AUGDT IN KD_AUGDT
** and ZUONR in KD_ZUONR
** and UMSKZ in KD_UMSKZ
** and SHKZG in KD_SHKZG
** and BSCHL in KD_BSCHL
** and (BSIK_WHERE).
** check XBSAK-AUGDT gt KD_STIDA or XBSAK-AUGDT in KD_AUGDT.
** append XBSAK.
** endselect.
** endif. "Variante 3
*** Variante 4 (aus RFITEMAR): AP mit Stichtag und Ausgleichszeitraum
** if KD_OPOPT ne 'X' and KD_APOPT ne 'X'.
** select (BSIK_FIELDS) from BSAK
** into corresponding fields of table XBSAK
** for all entries in K_LIFNR
** where LIFNR eq K_LIFNR-LOW
** and BUKRS in KD_BUKRS
*** AND GJAHR IN KD_GJAHR
*** AND AUGDT BETWEEN '00010101'
*** AND '99991231'
** and BUDAT in KD_BUDAT
** and AUGDT gt KD_STIDA
** and AUGDT in KD_AUGDT
** and ZUONR in KD_ZUONR
** and UMSKZ in KD_UMSKZ
** and SHKZG in KD_SHKZG
** and BSCHL in KD_BSCHL
** and (BSIK_WHERE).
** endif. " Variante 4
**
*** check projk and imkey range
** if PROJK_ELIMINATED eq 'X' or IMKEY_ELIMINATED eq 'X'.
** loop at XBSAK.
** if PROJK_ELIMINATED eq 'X'.
** perform CHECK_INT_EXT(FI_LDB_UTIL) tables PROJK_TAB
** using XBSAK-PROJK
** 'KONPR'
** changing CHECK_OK.
** if CHECK_OK = 'N'.
** delete XBSAK.
** continue.
** endif.
** endif.
**
** if IMKEY_ELIMINATED eq 'X'.
** perform CHECK_INT_EXT(FI_LDB_UTIL) tables IMKEY_TAB
** using XBSAK-IMKEY
** 'IMKEY'
** changing CHECK_OK.
** if CHECK_OK = 'N'.
** delete XBSAK.
** endif.
** endif.
**
** endloop.
** endif.
**
** sort XBSAK by MANDT LIFNR BUKRS.
** CURSOR-BSAK = 1.
**ENDIF.
ENDENHANCEMENT.
ENHANCEMENT 1 ZVENDOR_AGEING. "active version
** Variante 1: Offene Posten zu einem bestimmten Stichtag
** if ( sy-tcode = 'ZFI_VENDOR_AGEING' ).
** REFRESH xbsik.
** if KD_OPOPT = 'X' and KD_APOPT ne 'X'.
** select (BSIK_FIELDS) from BSIK
** into corresponding fields of table XBSIK
** for all entries in K_LIFNR
** where LIFNR eq K_LIFNR-LOW
** and BUKRS in KD_BUKRS
*** AND GJAHR IN KD_GJAHR
*** AND GJAHR BETWEEN '0001' AND '9999'
** and BlDAT in KD_BUDAT
** and BlDAT le KD_STIDA
** and ZUONR in KD_ZUONR
** and UMSKZ in KD_UMSKZ
** and SHKZG in KD_SHKZG
** and BSCHL in KD_BSCHL
** and (BSIK_WHERE).
** endif. "Variante 1
*** Variante 2: Ausgegl. Posten in einem Datumsintervall
** "- Es erfolgt kein Zugriff auf BSIK
*** Variante 3: Variante 1 + 2 gleichzeitig
** if KD_OPOPT eq 'X' and KD_APOPT eq 'X'.
** select (BSIK_FIELDS) from BSIK
** into corresponding fields of table XBSIK
** for all entries in K_LIFNR
** where LIFNR eq K_LIFNR-LOW
** and BUKRS in KD_BUKRS
*** AND GJAHR IN KD_GJAHR
*** AND GJAHR BETWEEN '0001' AND '9999'
** and BUDAT in KD_BUDAT
** and BUDAT le KD_STIDA
** and ZUONR in KD_ZUONR
** and UMSKZ in KD_UMSKZ
** and SHKZG in KD_SHKZG
** and BSCHL in KD_BSCHL
** and (BSIK_WHERE).
** endif. "Variante 3
**
*** Variante 4 (aus RFITEMAP): AP mit Stichtag und Ausgleichszeitraum
** "- Kein Zugriff auf BSIK!
**
*** check projk and imkey range
if PROJK_ELIMINATED eq 'X' or IMKEY_ELIMINATED eq 'X'.
loop at XBSIK.
if PROJK_ELIMINATED eq 'X'.
perform CHECK_INT_EXT(FI_LDB_UTIL) tables PROJK_TAB
using XBSIK-PROJK
'KONPR'
changing CHECK_OK.
if CHECK_OK = 'N'.
delete XBSIK.
continue.
endif.
endif.
if IMKEY_ELIMINATED eq 'X'.
perform CHECK_INT_EXT(FI_LDB_UTIL) tables IMKEY_TAB
using XBSIK-IMKEY
'IMKEY'
changing CHECK_OK.
if CHECK_OK = 'N'.
delete XBSIK.
endif.
endif.
endloop.
endif.
sort XBSIK by MANDT LIFNR BUKRS.
ENDIF.
ENDENHANCEMENT.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |