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: 

Regarding Function Module

Former Member
0 Kudos
110

Hi Experts,

It's Very Urgent. Can any one tell me ,Is there any function module to retrive data(records) from Bseg Table.

Actullay I hav a report, In that report ,it is mandatory to take records from bseg table 2 times.But IN production It is taking lot of time ,it has more than 7 lakh records in bseg table(in Production Server ).

So plz tell me is there any function module to retrive data from Bseg.

thanks&regards,

Venkat.

1 ACCEPTED SOLUTION

SantoshKallem
Active Contributor
0 Kudos
78

Since performance will be an issue, maybe you would consider using the tables:

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)

BSID Accounting: Secondary Index for Customers

BSIK Accounting: Secondary Index for Vendors

BSIS Accounting: Secondary Index for G/L Accounts

instead of BSEG.

It depends on what your program has to select (if you're only looking vor customers you can use BSID and BSAD etc.)

These are normal database tables, not clusters. Normally every record from BSEG can be found back in one of these 6 tables. And a program which selects data from these tables runs faster than from BSEG...

regards.

santhosh reddy

5 REPLIES 5

SantoshKallem
Active Contributor
0 Kudos
79

Since performance will be an issue, maybe you would consider using the tables:

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)

BSID Accounting: Secondary Index for Customers

BSIK Accounting: Secondary Index for Vendors

BSIS Accounting: Secondary Index for G/L Accounts

instead of BSEG.

It depends on what your program has to select (if you're only looking vor customers you can use BSID and BSAD etc.)

These are normal database tables, not clusters. Normally every record from BSEG can be found back in one of these 6 tables. And a program which selects data from these tables runs faster than from BSEG...

regards.

santhosh reddy

ThomasZloch
Active Contributor
0 Kudos
78

700K? We have almost 100 million!

There is no function module for this. It might be a good idea if you post your BSEG select statements here so global support can have a look.

Cheers

Thomas

Former Member
0 Kudos
78

IF IBKPF1[] IS NOT INITIAL.

SELECT BUKRS

BELNR

GJAHR

AUGCP

AUGBL

SHKZG

MWSKZ

DMBTR

KTOSL

HKONT

KUNNR

LIFNR

REBZG

PRCTR

BUPLA

INTO TABLE IBSEG

FROM BSEG

FOR ALL ENTRIES IN IBKPF1

WHERE BUKRS EQ IBKPF1-BUKRS

AND BELNR EQ IBKPF1-BELNR

AND GJAHR EQ IBKPF1-GJAHR

AND HKONT IN S_HKONT.

ENDIF.

IF IBSEG1[] IS NOT INITIAL.

IBSEG2[] = IBSEG1[].

ENDIF. " IF IBSEG1[] IS NOT INITIAL.

IF IBSEG2[] IS NOT INITIAL.

SELECT BUKRS

BELNR

GJAHR

AUGCP

AUGBL

SHKZG

MWSKZ

DMBTR

KTOSL

HKONT

KUNNR

LIFNR

REBZG

PRCTR

BUPLA

INTO TABLE IBSEG5

FROM BSEG

FOR ALL ENTRIES IN IBSEG2

WHERE BUKRS EQ IBSEG2-BUKRS

AND BELNR EQ IBSEG2-BELNR

AND GJAHR EQ IBSEG2-GJAHR.

ENDIF.

this is my code

0 Kudos
78

is IBKPF sorted by BUKRS, BELNR, GJAHR?

If I understand the code correctly, you are first reading document items based on a selection of HKONT and whatever selection there was on BKPF, then you are reading ALL document items of the documents found without selection of HKONT. You could as well read ALL items first, then copy the result into a second table and delete everything that is not in S_HKONT. Only one trip to BSEG instead of two.

Maybe you can make use of tables BSIS and BSAS, as the first poster suggested, if S_HKONT has only few account numbers.

Cheers

Thomas

Former Member
0 Kudos
78

you can use the following FM

1) RE_READ_BSEG

2) READ_BSEG

based on your requirement.

reward if helps