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

Data selection from BSEG

Former Member
0 Likes
650

Hi All.

My requirement is to fetch data from BSEG for whole fiscal year, now problem is that for a single fiscal year there are about 170000 records. Now when i try to select this , i got time exceed error. We also cant inner join or index for BSEG. Is there any way to solve this problem? can we set internally like it will select data inslot like 100000 records at a time? Please suggest me proper solurion..

Thanks.

5 REPLIES 5
Read only

Former Member
0 Likes
621

Hi PKB,

Try adding the Package size for the internal table , so that only that many records will be fetched.

Reward if USeful..

Regards,

Chitra

Read only

former_member386202
Active Contributor
0 Likes
621

Hi,

Use FOR ALL ENTRIES its performance wise better and pass all the keys.s

&----


*& Form sub_read_bseg

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM sub_read_bseg.

IF NOT it_bsak[] IS INITIAL.

*--Select data from BSEG table

SELECT belnr

gjahr

shkzg

kostl

hkont

ebeln

ebelp

FROM bseg

INTO TABLE it_bseg

FOR ALL ENTRIES IN it_bsak

WHERE belnr EQ it_bsak-belnr

AND gjahr EQ it_bsak-gjahr

AND shkzg EQ 'S'.

IF sy-subrc EQ 0.

*--Sort table by accounting document

SORT it_bseg BY belnr.

ENDIF.

ENDIF.

ENDFORM. " sub_read_bseg

Regards,

Prashant

Read only

Former Member
0 Likes
621

make use of sy-index

Read only

0 Likes
621

Can u please tell me how to use sy-index.

Read only

Former Member
0 Likes
621

Instead of BSEG, try to fetch data from BSAD/BSID