2006 Oct 30 8:53 AM
Hello
I am trying to fetch value of fields HKONT BSCHL from bseg into an internal table , but not able to do so, can any body tell how to do that, u help will be highly appreciated,
rgds
anupam
2006 Oct 30 9:04 AM
i am sure u have written a select query paste that here to see whats the wrong thing abt it
santhosh
i am sure u have written a select query paste that here to see whats the wrong thing abt it
santhosh
2006 Oct 30 9:00 AM
Hi,
Sample code for you.
DATA : begin of it_bseg occurs 0,
bukrs like bseg-bukrs,
hkont like bseg-hkont,
end of it_bseg.
data : v_line type i.
start-of-selection.
select bukrs
hkont
from bseg
into table it_bseg
where bukrs = '0001'.
describe table it_bseg LINES v_line.
write / v_line.
Reward if this helps
2006 Oct 30 9:31 AM
Hi
I have written the same query which u mentioned but it takes a hell lot of time to execute, can u suggest any thing else.
rgds
anup
2006 Oct 30 9:03 AM
SELECT gjahr belnr buzei hkont bschl
into table itab
from bseg
where belnr eq ...
and gjahr eq ...
and buzei eq ...
2006 Oct 30 9:04 AM
i am sure u have written a select query paste that here to see whats the wrong thing abt it
santhosh
2006 Oct 30 9:20 AM
Hi,
That might be because of some error in ur code. Paste ur code here, lest its very hard 2 predict.
2006 Oct 30 9:39 AM
Hi Anupam,
Since BSEG is a cluster table, it will have lots of entries. Try to put maximum key parameters in WHERE clause.
FYI. Key parameters are
BUKRS
BELNR
GJAHR
BUZEI
2006 Oct 30 10:45 AM
Hi Palak
Actually I have to generate a report using table BKPF and BSEG, i tried using join but that doesnt works as BSEG is a cluster table,
i need to display
bseg-hkont, bkpf-blart , bseg-bschl , count
where bseg-bukrs = bkpf-bukrs and bseg-gjahr = bkpf-gjahr
where count will count total records ,example
hkont blart bschl count
766000 AB 15
766000 AB 40 5
766000 AB 50 10
in count 5 + 10 comes out to be 15
2006 Oct 30 1:00 PM
It is good practice and performance enhancement never (means never ever!) to fetch data from BSEG directly.
Better first get the relevant headers from one of the secondary index tables as there are:
BSAD : Accounting: Secondary Index for Customers (Cleared Items)
BSAK : Accounting: Secondary Index for Vendors (Cleared Items)
BSAS : Accounting: Secondary Index for G/L Accounts (Cleared Item
BSEC : One-Time Account Data Document Segment
BSID : Accounting: Secondary Index for Customers
BSIK : Accounting: Secondary Index for Vendors
BSIS : Accounting: Secondary Index for G/L Accounts
Choose the appropriate table(s) for your requirement.
Define a 'header' table with only key fields for BKPF/BSEG.
Select from secondary index table(s) appending the header itab.
Then fetch only the fields you really need from BSEG and BKPF into corresponding fields of your results table for all entries in...
Hope you can do it!
Regards,
Clemens
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |