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: 

Best way to get BSEG data when non-key selection has to be used

Former Member
0 Kudos

Hi all.

I have to get some data from BSEG using a non-primary key field condition. I do not have any indexes on BSEG. What would be the best method to do that.

or on a different approach;

I need to get DMBTR from BSEG when i know REBZG.

Is there any other table where i can find this data as accessing BSEG using a Non-Key field is taking ages.

Thanks in advance.

3 REPLIES 3

Former Member
0 Kudos

I don't have a system in front of me at the moment. Not sure how much of the data you have available.

Have you looked at the other index tables...

BSIS, BSIK, BSAK, BSAS, and a couple more that I can't recall (BSAM and BSIM?)?

These are standard transparent tables with secondary indices.

Former Member
0 Kudos

The other tables he could not recall would be BSAD, BSID.

There would be no indices on BSEG since it is a pool table. Depending on which refrence you are starting from you could identify associated BSEG entry.

For example using the customer number in BSAD/BSID table, to reference the matching REBZG. You should be cautious this field could be represented for different business process and may not be used in all of them.

Regards,

Former Member
0 Kudos

Hi

If you have to find the items knowing REBZG, it means you have to pick up the partial payments, so you should read the index table of cleared items:

- BSAD: Customer

- BSAK: Vendor

- BSAS: G/L account

Now I think you should know which kind of accouting you have to analyze, so if you have to find customer invoice:

SELECT * FROM BSAD INTO TABLE T_BSAD

WHERE BUKRS = <BUKRS>

AND REBZG = <REBZG>.

- for Vendor:

SELECT * FROM BSAK INTO TABLE T_BSAK

WHERE BUKRS = <BUKRS>

AND REBZG = <REBZG>.

- G/L

SELECT * FROM BSAS INTO TABLE T_BSAS

WHERE BUKRS = <BUKRS>

AND REBZG = <REBZG>.

I hope you know at least the company code: it's very important here.

You should know the fiscal year too, the REBZG is the number of a FI document (in this case I suppose it's an invoice) and you can have the same number in different years.

Max