Application Development 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: 

selection from BSEG table

Former Member
0 Kudos
203

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

11 REPLIES 11

Former Member
0 Kudos
102

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

Former Member
0 Kudos
102

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

Former Member
0 Kudos
102

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

JozsefSzikszai
Active Contributor
0 Kudos
102

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.

0 Kudos
102

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

0 Kudos
102

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

0 Kudos
102

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...

0 Kudos
102

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

0 Kudos
102

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

Former Member
0 Kudos
102

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.

Former Member
0 Kudos
102

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