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

Read data from BSEG

Former Member
0 Likes
1,502

Dear All,

I want to fatch data from bseg table for perticular periods like 01/04/2009-31/03/2010.

Now Bseg table is a cluster table. Data access from this table downs the perfomance of the report.

at least i have 10000 document no which data i need to fatch from bseg.

IS it any possible way to fatch data from BSEG table easily and fast?

How abt use a field symbols ? what is field symbols ? How can i create it?

How abt define internal table as define as std. table.

please guide me to possible advance or std. ways to fatch data from bseg table. Currently it is giving time out error or took more then 30 min. Time.

Please note that i had already used " select into table " syntax.

For E.G.

SELECT bukrs belnr augdt gjahr bschl dmbtr wrbtr sgtxt shkzg

INTO TABLE itab_bseg

FROM bseg FOR ALL ENTRIES IN itab_bkpf

WHERE belnr EQ itab_bkpf-belnr AND gjahr EQ itab_bkpf-gjahr AND koart EQ 'S' AND

bschl IN ('40','50') AND hkont IN ('0007100310','0007105800'). "

I donot want to use SELECT-ENDSELECT and SELECT INTO statements.

Please help me to solve this problem. to make report very fast.

regards,

Nayan Lad

1 ACCEPTED SOLUTION
Read only

anup_deshmukh4
Active Contributor
0 Likes
1,309

hello Nayan Lad ,

You can very vell get the data that is in BSEG in other tables quering on BSEG as its a cluster table and has huge fields is avoided always You can very well relate it from BKPF-

The tables are as follows

BSAD : Accounting: Secondary index for customers (cleared items))

BSID : (Accounting: Secondary index for customers)

BSAS :(Accounting: Secondary index for G/L accounts (cleared items))

BSIS : OPEN items

BSIK :(Accounting: Secondary index for vendors oPEN ITEMS)

BSAK : (Accounting: Secondary index for vendors (cleared items))

Edited by: Anup Deshmukh on Mar 11, 2010 4:58 AM

5 REPLIES 5
Read only

anup_deshmukh4
Active Contributor
0 Likes
1,310

hello Nayan Lad ,

You can very vell get the data that is in BSEG in other tables quering on BSEG as its a cluster table and has huge fields is avoided always You can very well relate it from BKPF-

The tables are as follows

BSAD : Accounting: Secondary index for customers (cleared items))

BSID : (Accounting: Secondary index for customers)

BSAS :(Accounting: Secondary index for G/L accounts (cleared items))

BSIS : OPEN items

BSIK :(Accounting: Secondary index for vendors oPEN ITEMS)

BSAK : (Accounting: Secondary index for vendors (cleared items))

Edited by: Anup Deshmukh on Mar 11, 2010 4:58 AM

Read only

awin_prabhu
Active Contributor
0 Likes
1,309

Hi Nayan,

Problem is tat ur internal table itab_bkpf might be empty. Check the internal table before using it in FOR ALL ENTRIES. Otherwise all database table entries are considered in the query.


If itab_bkpf[] is not initial.

SELECT bukrs belnr augdt gjahr bschl dmbtr wrbtr sgtxt shkzg
INTO TABLE itab_bseg
FROM bseg FOR ALL ENTRIES IN itab_bkpf   " This internal table might be empty, so all records are considered in BSEG
WHERE belnr EQ itab_bkpf-belnr AND gjahr EQ itab_bkpf-gjahr AND koart EQ 'S' AND
bschl IN ('40','50') AND hkont IN ('0007100310','0007105800').

Endif.

Thanks..

Read only

Former Member
0 Likes
1,309

I had already used

bkpf, bsad,bsid, bsak, bsik table.

also put condition of itab_bkpf[] is not initial .

See i want better way. I have to use this BSEG table for actual antry with perticular posting keys and document type.

This is for anual audit report so BSEG table i need must.

IS it any possible way to fatch data from BSEG table easily and fast?

How abt use a field symbols ? what is field symbols ? How can i create it?

How abt define internal table as define as std. table.

please guide me to possible advance or std. ways to fatch data from bseg table. Currently it is giving time out error or took more then 30 min. Time.

regards,

Nayan Lad

Read only

Former Member
0 Likes
1,309

hi

You can use package size in select statement.press f1 on select statement

For fileld symbol within loop you can use it.

[Field Symbol|http://help.sap.com/SAPhelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm]

Read only

Former Member
0 Likes
1,309

Read the blog : Quickly Retrieving FI document Data from BSEG

/people/rob.burbank/blog/2007/11/12/quickly-retrieving-fi-document-data-from-bseg

Thanks

Chinni

Edited by: Tirumula Rao Chinni on Mar 11, 2010 10:04 AM