‎2008 Apr 18 12:07 PM
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®ards,
Venkat.
‎2008 Apr 18 12:12 PM
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
‎2008 Apr 18 12:12 PM
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
‎2008 Apr 18 12:13 PM
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
‎2008 Apr 18 12:30 PM
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
‎2008 Apr 18 12:50 PM
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
‎2008 Apr 22 10:12 AM
you can use the following FM
1) RE_READ_BSEG
2) READ_BSEG
based on your requirement.
reward if helps