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: 

The Famous BSEG Fetching...

ramesh_putta
Participant
0 Kudos

Hello,

Iam working on an ALV Report which has the fields Material Number(BSEG_MATNR), Company Code(BSIS-BUKRS) and G/L account (BSIS-HKONT) on the selection screen.

Here Company code and G/L account are the mandatory fields.

When the user enters Copany code and G/L account, the program goes and fetches data from BSIS by passing BUKRS and HKONTS.(In My case , it returns around 100,000 records). And when the program goes to BSEG (with providing all the key fields it got from BSIS) for MATNR, its taking almost 5 minuts to fetch the data.

The program fetches data from BSEG using select single in a loop.(I even tried doing for all entries but it takes almost same time).

So what are my alternatinve options here to get the MATNR quickly from BSEG. Now its taking too long time even after passing the key fields. And moreover, even if user passes the MATNR on the selection screen, there is no use. It still need to fetch 100,000 records from BSIS and look for MATNR in BSEG for all those records.

whats the best way to fetch MATNR if you have records from BSIS?

1 ACCEPTED SOLUTION

brad_bohn
Active Contributor
0 Kudos

You've got too many records selected. If you didn't have the document keys, you might try BSIM. But since you've got the keys, you've already got quick access. A BSIM select might be slightly faster, but I doubt it would give you an order of magnitude improvement.

5 REPLIES 5

brad_bohn
Active Contributor
0 Kudos

You've got too many records selected. If you didn't have the document keys, you might try BSIM. But since you've got the keys, you've already got quick access. A BSIM select might be slightly faster, but I doubt it would give you an order of magnitude improvement.

0 Kudos

We have other Combinitions of Company Code and G/L account which may have over 200K records...

Imagin , user enters a single material on the selection screen, the program still gets 200k records from BSIS and scan through BSEG for that single material for all those records.

I wonder why SAP didnt have both doc number and material in the same table.

Former Member
0 Kudos

Have a look at [Quickly Retrieving FI document Data from BSEG.|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/7692] [original link is broken] [original link is broken] [original link is broken]; There is a section there on retrieving from BSEG only knowing the material. I'm not sure if it will work in your case.

Rob

Former Member
0 Kudos

Hi Ramesh,

Is your requirement retreiving from day 1? Your selection is a bit unrestricted, try adding more parameters like fical year (GJAHR), Business Area (GSBER) to filter it more. Or try extracting header first (BKPF) using date parameters like document date or posting date, then use these entries to search BSEG.

Hope this helps.

Best regards,

JP

0 Kudos

Thank you all guys,

Iam joining tables BSIS and BSIM which far better than going to BSEG using for all entries.

Thanks again.