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: 

Secondary Index for BSEG

saikumar_vvs
Explorer
0 Kudos

Hello ALL,

Could you please let me know whether we can create the secondary index for BSEG??I belive its cluster table.Can we create the secondary index for it?

Regards,

SaikumarVVS

Edited by: Vijay Babu Dudla on Jan 28, 2009 3:46 AM

14 REPLIES 14

Former Member
0 Kudos

Hi,

No, for cluster tables you can not create secondary indexes.

Regards

Raju Chitale

Former Member
0 Kudos

Hi Sai,

There are certain secondary index table. Have a look at these

BSID Accounting: Secondary Index for Customers(Open Items)

BSIK Accounting: Secondary Index for Vendors

BSIM Secondary Index, Documents for Material

BSIS Accounting: Secondary Index for G/L Accounts

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 Items)

Regards

Former Member
0 Kudos

no we cant do secondary index for cluster table.like bseg table.

0 Kudos

While fetching the data from BSEG,its goig dump in production,,this might be large no of records in prodcuction..

So is there any other way??

0 Kudos

Hi,

What is the dump message you are getting ?

Regards

0 Kudos

i am getting message like "Timeout error"

0 Kudos

Hi Sai,

Usually we try to avoid direct select on BSEG table.

Either you have to recode using the secondary index table that i have mentioned. This may be a tedious task as you have to make sure logic is not changed.

Is this a foreground or background job ?

You can take help from BASIS consultant to increase the maximum runtime of the jobs to avoid time out

Check the profile parameter rdisp/max_wprun_time in TCODE RZ11

These are maintained by BASIS . Try increasing the runtime.

Regards

0 Kudos

See ,We are not getting dump in dev and qty sytems,but getting dump only in production.In the dump its showing timed out error at particular select statement..

SELECT SINGLE * FROM Bseg WHERE BELNR = T_BSID-REBZG.

ru sure..we can solve this prb with basis person

Regards,

Sai

0 Kudos

BSEG is a cluster table, so give the whole key of the record, else severe performance problem may arise. The actual cluster file behind BSEG is RFBLG with key MANDT, BUKRS, BELNR and GJAHR.

Also try to keep the SELECT SINGLE to a minimum.

So change your select into

SELECT * INTO TABLE t_bseg FROM bseg
  FOR ALL ENTRIES IN t_bsid
  WHERE BUKRS = T_BSID-BUKRS 
    AND BELNR = T_BSID-REBZG
    AND GJAHR = T_BSID-REBZJ

of course add the necessary fields to your internal table. I suppose your DEV/QTY systems have much less records than PRD system.

Also use tools like [SE30|https://www.sdn.sap.com/irj/scn/advancedsearch?query=se30&cat=sdn_all] or [ST05|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=st05&adv=false&sortby=cm_rnd_rankvalue] to find the gap in performances.

Regards

0 Kudos

Hi Sai,

When i meant BASIS, it is only for increasing the runtime of the job so that there is a chance you may avoid time out. This may only be a temporary fix.

If you have to improve the performance you have to make changes to your code.

Regards

0 Kudos

Hello,

I donot know the exact requirement as to why you are using SELECT SINGLE on BSEG. And as mentioned by other posts you cannot create an Index on BSEG (as it is a cluster table).

You can try a workaround though:


SELECT SINGLE BUKRS BELNR GJAHR
INTO ( V_BUKRS, V_BELNR, V_GJAHR )
FROM BKPF 
WHERE BELNR = T_BSID-REBZG.

IF SY-SUBRC = 0.
SELECT * UP TO 1 ROWS
FROM BSEG
WHERE 
BUKRS = V_BUKRS AND
BELNR = V_BELNR AND
GJAHR = V_GJAHR.
ENDIF.

I think it should help.

BR,

Suhas

kamesh_g
Contributor
0 Kudos

HI Dump might be Disk space error . because of performance issue its going to dump .try reduce Database base hit . first do the performance analysis in SE30 .

And while selecting data from BSEG if you are using key fileds in the where condition no need create secondaty index for BSEG .

sudhir_uppalapati
Participant
0 Kudos

Hi,

Try to reduce the database hits.

run the program in background if u cant find any other alternative.

Former Member
0 Kudos

For cluster tables we cann't create secondary Index.

Regards,

Joan