2008 Nov 03 11:13 AM
Hi all
In one of my program i have to use selection from BSEG by using non key fields like anln1, hkont etc.
My program run time taking too much time i.e 1.5 to 2hrs
Is there any criteria to reduce my run time.
plz help
thks
sateesh
2008 Nov 03 11:24 AM
hi
u have to use one of the key fields anyhow..
or u can do one more thing that is create the indexof the fields that u want to use as the key..
it will help in improving performance
regards
palak
2008 Nov 03 11:28 AM
Hi,
[Quickly Retrieving FI document Data from BSEG|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/7692] [original link is broken] [original link is broken] [original link is broken];
regards,
Advait
2008 Nov 04 9:10 AM
Hi,
Try retrieving all key fields from the bseg table and recommend for a secondary index with the field that use in your where clause. This should solve your problem.
Regards,
Shobana.K
2008 Nov 04 9:15 AM
if you don't have the key fields, you have to use other tables than BSEG for the selection. BSEG is cluster table, that (also) means there are no secondary keys.
If you want to select G/L account (hkont as mentioned) wise you can use BSIS/BSAS, if asset wise you can check tables ANEP/ANEK.
2008 Nov 05 9:58 AM
Dear Eric
Thanks for your response
ANEP/ANEK tables doent have field hkont ie GL account which is must for me
Is there any other way
regards
sateesh
2008 Nov 05 10:03 AM
Hi
If you need a select by field hkont (so G/L account) use the table BSIS (open item) and BSAS (cleared item) instead of BSEG, just Eric said.
SELECT * FROM BSAS WHERE BUKRS = BUKRS
AND HKONT = HKONT.
SELECT SINGLE * FROM BSEG WHERE BUKRS = BSAS-BUKRS
AND BELNR = BSAS-BELNR
AND GJAHR = BSAS-GJAHR
AND BUZEI = BSAS-BUZEI.
SELECT SINGLE * FROM BKPF WHERE BUKRS = BSAS-BUKRS
AND BELNR = BSAS-BELNR
AND GJAHR = BSAS-GJAH.
Max
Edited by: max bianchi on Nov 5, 2008 11:03 AM
2008 Nov 05 10:06 AM
as I told ANEK/ANEP is useful when you have asset number (anln1 - as mentioned in your original question), if you have only G/L account number (hkont), than use BSIS/BSAS, otherwise just let me know what you have and what you need...
2008 Nov 05 10:22 AM
hi
I requiremnt is as below
I have to bring back my fully and partially retired assets as materials.
For this i am using cdpos and cdhdr for find the corresponding changes in asset while retiring
for above retired asset i need to find the net book value to valuate the material.
here is my selection code
SELECT SINGLE wrbtr
FROM bseg
INTO w_wrbtr
WHERE
anln1 = so_anln1-low AND
hkont = c_hkont AND
shkzg = 'S'. "only for Debit amount
regards
sateesh
2008 Nov 05 11:31 AM
Hi,
Better check if you can have more fields in the selection screen, like bukrs, so that the searchign by the index will be partially achieved
Edited by: Shobana k on Nov 5, 2008 12:31 PM
2008 Nov 05 5:32 AM
Hello sateesh kumar ,
If you want to increase your performance then avoid using the non key fields in the select statement. And you can use the secondary index but it is not advisible from the basis point of view. they dont accept it. so try to use the key index in select statement and consult your basis team to use if it necessary then use secondary index.
2008 Nov 06 1:04 PM
BSEG is not a transparent table its a Cluster Table, its not a good idea to have a select query for BSEG, insted there are lots of FI function modules which can server your requirements which will be much more faster than this select query.
Regards
Sam