2015 Feb 24 9:33 AM
Hi ,
In my requirement,
Select * from bkpf
into table t_bkpf
where bukrs in s_bukrs.
if not t_bkpf[] is initial.
select * from bseg
into table t_bseg
for all entries in t_bkpf
where bukrs = t_bkpf-bukrs.
endif.
My 2nd internal table is taking much duration for next step.....I know BSEG is a cluster table....huge amount of values have been fetched.
Kindly help me to overcome this issue
Hi ,
In my requirement,
Select * from bkpf
into table t_bkpf
where bukrs in s_bukrs.
if not t_bkpf[] is initial.
select * from bseg
into table t_bseg
for all entries in t_bkpf
where bukrs = t_bkpf-bukrs.
endif.
My 2nd internal table is taking much duration for next step.....I know BSEG is a cluster table....huge amount of values have been fetched.
Kindly help me to overcome this issue
2015 Feb 24 9:49 AM
I'm sure you can solve this yourself.
Investigate which fields are common in the primary keys of both tables, then compare the result with your current where-condition for BSEG.
Do you really need all columns? Better use a field list and declare the internal tables accordingly.
Thomas
2015 Feb 24 9:55 AM
hi Thomas,
thanks for ur prompt response....as u told i have used BELNR BUKRS & GJAHR in where condition....but also time exceeds
2015 Feb 24 9:59 AM
Hi,
Based on you requirement thier are many alternate table for bseg.
Vendor - BSIK & BSAK
Customer - BSID & BSAD
GL - BSIS & BSAS.
You can use appending table in select query to join
Hope it helpful,
Regards,
Ramesh.V
2015 Feb 24 10:02 AM
2015 Feb 24 2:10 PM
Hi,
Its not clear , you are going to develop a report for vendor or customer or gl details?.
BSEG = tables entries will also be available in the following tables.
Vendor - BSIK & BSAK
Customer - BSID & BSAD
GL - BSIS & BSAS.
Hope it helpful,
Regards,
Venkat.
2015 Feb 24 10:08 AM
Hi Barani,
Use below Code.
Select * from bkpf
into table t_bkpf
where bukrs in s_bukrs.
if not t_bkpf[] is initial.
select * from bseg
into table t_bseg
for all entries in t_bkpf
where bukrs = t_bkpf-bukrs.
and belnr = t_bkpf-belnr
and gjahr = t_bkpf-gjahr
endif.
2015 Feb 24 10:13 AM
2015 Feb 24 11:47 AM
Why are you doing a 'Select *'. Do you need all the fields from the BKPF and BSEG tables in your program?
Select only those fields which are required to reduce considerable amount of time. Also, try to use primary key fields in both select queries.
2015 Feb 24 2:18 PM
Barani G wrote:
i have tried this method.....but not wrking
That doesn't help much. Can you tell us what about it is not working? This is a pretty standard way of getting accounting documents.
Rob
2015 Feb 24 12:10 PM
Which kind of category you need and use alternate table for your query.
BSID Accounting: Secondary Index for Customers(Open Items)
BSAD Accounting: Secondary Index for Customers(Cleared Items)
BSIM Secondary Index, Documents for Material
BSIS Accounting: Secondary Index for G/L Accounts
BSAS Accounting: Secondary Index for G/L Accounts(Cleared Items)
BSAK Accounting: Secondary Index for Vendors(Cleared Items)
BSIK Accounting: Secondary Index for Vendors
all data from above tables are stored inside BSEG table. with additional fields to make separation.
2015 Feb 24 4:59 PM
Hello,
Look always silly, but to my mind :
Select * from bkpf where bukrs in s_bukrs.
select * from bseg appending table t_bseg
where bukrs =bkpf-bukrs.
and belnr = bkpf-belnr
and gjahr = bkpf-gjahr
endselect.
Should Work better ( For all entries sometime give a bad result).
Nevertheless, theses select should fill all memory of your application server. and you should expect a nice memory dump.
And think to the huge amount of data your query should get.
Sincerely yours
Christophe Blineau
2015 Feb 24 5:05 PM
I really doubt if the problem has to do with the tables being used or the way the SELECT(s) is/are being constructed. The OP is retrieving all documents for a company code. If there are a large number of documents, it will take time.
There is no getting around that.
Rob
2015 Mar 03 4:27 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |