
data: lv_cus type char1.
IMPORT lv_cus to lv_cus from MEMORY ID 'ABC'.
if sy-tcode = 'ZFI_CUSTOMER_AGEING' .
* or sy-tcode = 'ZFI_CPA' OR
* ( sy-tcode = 'ZFI_ACCR_AGE' AND LV_CUS IS NOT INITIAL ).
* Variante 1: Offene Posten zu einem bestimmten Stichtag
if DD_OPOPT = 'X' and DD_APOPT ne 'X'.
refresh xbsid.
select (BSID_FIELDS) from BSID
into corresponding fields of table XBSID
for all entries in K_KUNNR
where KUNNR eq K_KUNNR-LOW
and BUKRS in DD_BUKRS
* AND GJAHR IN DD_GJAHR
* AND GJAHR BETWEEN '0001' AND '9999'
and BlDAT in DD_BUDAT
and BLDAT le DD_STIDA
and ZUONR in DD_ZUONR
and SHKZG in DD_SHKZG
and UMSKZ in DD_UMSKZ
and BSCHL in DD_BSCHL
and (BSID_WHERE).
endif. "Variante 1
* Variante 2: Ausgegl. Posten in einem Datumsintervall
"- Es erfolgt kein Zugriff auf BSID
* Variante 3: Variante 1 + 2 gleichzeitig
if DD_OPOPT eq 'X' and DD_APOPT eq 'X'.
* SELECT * FROM BSID WHERE KUNNR > KUNNR-BSID
select (BSID_FIELDS) from BSID
into corresponding fields of table XBSID
for all entries in K_KUNNR
where KUNNR eq K_KUNNR-LOW
and BUKRS in DD_BUKRS
* AND GJAHR IN DD_GJAHR
* AND GJAHR BETWEEN '0001' AND '9999'
and BUDAT in DD_BUDAT
and BUDAT le DD_STIDA
and ZUONR in DD_ZUONR
and SHKZG in DD_SHKZG
and UMSKZ in DD_UMSKZ
and BSCHL in DD_BSCHL
and (BSID_WHERE).
endif. "Variante 3
* Variante 4 (aus RFITEMAR): AP mit Stichtag und Ausgleichszeitraum
"- Kein Zugriff auf BSID!
* check projk and imkey range
if PROJK_ELIMINATED eq 'X' or IMKEY_ELIMINATED eq 'X'.
loop at XBSID.
if PROJK_ELIMINATED eq 'X'.
perform CHECK_INT_EXT(FI_LDB_UTIL) tables PROJK_TAB
using XBSID-PROJK
'KONPR'
changing CHECK_OK.
if CHECK_OK = 'N'.
delete XBSID.
continue.
endif.
endif.
if IMKEY_ELIMINATED eq 'X'.
perform CHECK_INT_EXT(FI_LDB_UTIL) tables IMKEY_TAB
using XBSID-IMKEY
'IMKEY'
changing CHECK_OK.
if CHECK_OK = 'N'.
delete XBSID.
endif.
endif.
endloop.
endif.
sort XBSID by MANDT KUNNR BUKRS.
CURSOR-BSID = 1.
ENDIF.
DATA: LV_CUS1 TYPE CHAR1.
IMPORT LV_CUS TO LV_CUS1 FROM MEMORY ID 'ABC'.
IF SY-TCODE = 'ZFI_CUSTOMER_AGEING' .
* Variante 1: Offene Posten zu einem bestimmten Stichtag
if DD_OPOPT = 'X' and DD_APOPT ne 'X'.
refresh xbsad.
if B0SG-XNOPL is initial.
select (BSID_FIELDS) from BSAD
into corresponding fields of table XBSAD
for all entries in K_KUNNR
where KUNNR eq K_KUNNR-LOW
and BUKRS in DD_BUKRS
* AND GJAHR IN DD_GJAHR
* AND AUGDT BETWEEN '00010101'
* AND '99991231'
and BLDAT in DD_BUDAT
and BLDAT le DD_STIDA
and AUGDT gt DD_STIDA
and ZUONR in DD_ZUONR
and SHKZG in DD_SHKZG
and UMSKZ in DD_UMSKZ
and BSCHL in DD_BSCHL
and (BSID_WHERE).
endif.
endif. "Variante 1
* Variante 2: Ausgegl. Posten in einem Datumsintervall
if DD_OPOPT ne 'X' and DD_APOPT = 'X'.
select (BSID_FIELDS) from BSAD
into corresponding fields of table XBSAD
for all entries in K_KUNNR
where KUNNR eq K_KUNNR-LOW
and BUKRS in DD_BUKRS
* AND GJAHR IN DD_GJAHR
* AND AUGDT BETWEEN '00010101'
* AND '99991231'
and BUDAT in DD_BUDAT
and AUGDT in DD_AUGDT
and ZUONR in DD_ZUONR
and SHKZG in DD_SHKZG
and UMSKZ in DD_UMSKZ
and BSCHL in DD_BSCHL
and (BSID_WHERE).
endif. "Variante 2
* Variante 3: Variante 1 + 2 gleichzeitig
if DD_OPOPT eq 'X' and DD_APOPT eq 'X'.
select (BSID_FIELDS) from BSAD
into corresponding fields of XBSAD
for all entries in K_KUNNR
where KUNNR eq K_KUNNR-LOW
and BUKRS in DD_BUKRS
* AND GJAHR IN DD_GJAHR
* AND AUGDT BETWEEN '00010101'
* AND '99991231'
and BUDAT in DD_BUDAT
and BUDAT le DD_STIDA
* AND AUGDT GT DD_STIDA
* OR AUGDT IN DD_AUGDT
and ZUONR in DD_ZUONR
and UMSKZ in DD_UMSKZ
and SHKZG in DD_SHKZG
and BSCHL in DD_BSCHL
and (BSID_WHERE).
check XBSAD-AUGDT gt DD_STIDA or XBSAD-AUGDT in DD_AUGDT.
append XBSAD.
endselect.
endif. "Variante 3
* Variante 4 (aus RFITEMAR): AP mit Stichtag und Ausgleichszeitraum
if DD_OPOPT ne 'X' and DD_APOPT ne 'X'.
select (BSID_FIELDS) from BSAD
into corresponding fields of table XBSAD
for all entries in K_KUNNR
where KUNNR eq K_KUNNR-LOW
and BUKRS in DD_BUKRS
* AND GJAHR IN DD_GJAHR
* AND AUGDT BETWEEN '00010101'
* AND '99991231'
and BUDAT in DD_BUDAT
and AUGDT gt DD_STIDA
and AUGDT in DD_AUGDT
and ZUONR in DD_ZUONR
and UMSKZ in DD_UMSKZ
and SHKZG in DD_SHKZG
and BSCHL in DD_BSCHL
and (BSID_WHERE).
endif. " Variante 4
* check projk and imkey range
if PROJK_ELIMINATED eq 'X' or IMKEY_ELIMINATED eq 'X'.
loop at XBSAD.
if PROJK_ELIMINATED eq 'X'.
perform CHECK_INT_EXT(FI_LDB_UTIL) tables PROJK_TAB
using XBSAD-PROJK
'KONPR'
changing CHECK_OK.
if CHECK_OK = 'N'.
delete XBSAD.
continue.
endif.
endif.
if IMKEY_ELIMINATED eq 'X'.
perform CHECK_INT_EXT(FI_LDB_UTIL) tables IMKEY_TAB
using XBSAD-IMKEY
'IMKEY'
changing CHECK_OK.
if CHECK_OK = 'N'.
delete XBSAD.
endif.
endif.
endloop.
endif.
sort XBSAD by MANDT KUNNR BUKRS.
CURSOR-BSAD = 1.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |