Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to write logic

Former Member
0 Likes
664

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

3 REPLIES 3
Read only

Former Member
0 Likes
624

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

Read only

0 Likes
624

Hi Neeru

Also generated unique records in your internal table I_BKPF of BUKRS, BELNR and GJAHR.

Regards

Ranganath

Read only

former_member156446
Active Contributor
0 Likes
624

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

.

.

.