2008 Jan 22 11:06 PM
Experts..
iam developing a report.
i need to get the data from REGUP basedon BKPF.
ihave writeen logic like this
SORT I_BKPF BY BUKRS BELNR GJAHR.
*
IF NOT I_BKPF IS INITIAL.
SELECT LAUFD
XVORL
ZBUKR
LIFNR
KUNNR
VBLNR
BUKRS
BELNR
GJAHR
BUZEI
ZLSCH
WAERS
XBLNR
BLART
BUDAT
BLDAT
HKONT
SAKNR
SHKZG
DMBTR
WRBTR
MWSTS
WMWST
SGTXT
ZTERM
WSKTO
AUFNR
EBELN
FROM REGUP into table i_REGUP
FOR ALL ENTRIES IN I_BKPF
WHERE BUKRS = I_BKPF-BUKRS AND
BELNR = I_BKPF-BELNR AND
GJAHR = I_BKPF-GJAHR AND
XVORL NE 'X' AND
LIFNR IN S_LIFNR.
endif.
here BKPF contatain morethan 1 lkhs entries.
this query is taking lot time because REGUP is cluster table.
tell me is there any alternative to FOR ALL ENTRIES.
thanks in advance
regrards
niru
Experts..
iam developing a report.
i need to get the data from REGUP basedon BKPF.
ihave writeen logic like this
SORT I_BKPF BY BUKRS BELNR GJAHR.
*
IF NOT I_BKPF IS INITIAL.
SELECT LAUFD
XVORL
ZBUKR
LIFNR
KUNNR
VBLNR
BUKRS
BELNR
GJAHR
BUZEI
ZLSCH
WAERS
XBLNR
BLART
BUDAT
BLDAT
HKONT
SAKNR
SHKZG
DMBTR
WRBTR
MWSTS
WMWST
SGTXT
ZTERM
WSKTO
AUFNR
EBELN
FROM REGUP into table i_REGUP
FOR ALL ENTRIES IN I_BKPF
WHERE BUKRS = I_BKPF-BUKRS AND
BELNR = I_BKPF-BELNR AND
GJAHR = I_BKPF-GJAHR AND
XVORL NE 'X' AND
LIFNR IN S_LIFNR.
endif.
here BKPF contatain morethan 1 lkhs entries.
this query is taking lot time because REGUP is cluster table.
tell me is there any alternative to FOR ALL ENTRIES.
thanks in advance
regrards
niru
2008 Jan 23 4:30 AM
Hi Neeru
Please try to fetch the data in packages using the OPEN CUROSOR, FETCH and CLOSE CURSOR statements. By that you can limit your search list. This will have more DB hits but less data transfer. Or other option would be search for alternative search path by which you can use the primary index of your DB table i.e. LAUFD and LAUFI.
Hope this helps !
Regards
Ranganath
2008 Jan 23 4:44 AM
Hi Neeru
Also generated unique records in your internal table I_BKPF of BUKRS, BELNR and GJAHR.
Regards
Ranganath
2008 Jan 23 4:40 AM
Hi Neeru
SORT I_BKPF BY BUKRS BELNR GJAHR.
*
IF NOT I_BKPF[ ] IS INITIAL. <<<<[ ] is missing.. check it
SELECT LAUFD
XVORL
ZBUKR
LIFNR
KUNNR
VBLNR
BUKRS
BELNR
GJAHR
BUZEI
ZLSCH
.
.
.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |