04-25-2007 11:59 AM
I am working with some Account Tables BSIS,BSAS ,BSEC . I have to select data from these table on the basis of Region ( Not a primary key in BSEC) ,Fiscal year and Company code.here is my code:
SELECT BELNR GJAHR BUZEI NAME1 INTO ITAB1 FROM BSEC WHERE
BUKRS = CC " Company Code
AND GJAHR = FY " Fiscal yr
AND REGIO = RR " Region
AND XCPDK = 'X'." One time Customer
APPEND ITAB1.
CLEAR ITAB1.
ENDSELECT.
But its taking Lotz time im going mad now....
Plz help me ...My objective is to collect BELNR and compare it to BSAS and BSIS table BELNR to check whther Document is Clear or Not.
or if any one knws any table where REGIO wud be a Primary Key.
04-25-2007 12:02 PM
Use the below code it wil be helpful
SELECT BELNR GJAHR BUZEI NAME1 INTO <b>table</b> ITAB1 FROM BSEC WHERE
BUKRS = CC " Company Code
AND GJAHR = FY " Fiscal yr
AND REGIO = RR " Region
AND XCPDK = 'X'." One time Customer
04-25-2007 12:02 PM
Use the below code it wil be helpful
SELECT BELNR GJAHR BUZEI NAME1 INTO <b>table</b> ITAB1 FROM BSEC WHERE
BUKRS = CC " Company Code
AND GJAHR = FY " Fiscal yr
AND REGIO = RR " Region
AND XCPDK = 'X'." One time Customer
04-25-2007 12:11 PM
No still its taking lotz time....Problem is its account table ..n it has huuuuge data..so ny other Table???
04-25-2007 12:14 PM
u are fertching complete one year data , in that case it will take time .
or
break into monthwise.
Regards
Prabhu
04-25-2007 12:15 PM
Check the type of the table.
Is it TRANSPARENT table or POOLED table.
If it is transaparent table it won't take lot of time. And if that is pooled table it will take some time to retrieve records.
Thanks & Regards
Santhosh
04-25-2007 12:15 PM
Hi,
Regio has a check table T005S
check that out
and try to use even belnr in where condition...
Hi if i see BSEC its s item Table why done u first get the details from BKPF and then write a for all entries
santhosh
Message was edited by:
Kaluvala Santhosh
04-25-2007 12:23 PM
Try using the correct index.. I think use BELNR and DATE field if possible...
Else try ST05, find the indexes u can use and then try coding again
04-25-2007 12:26 PM
04-25-2007 12:03 PM
hi
avoid select-end select.
SELECT BELNR GJAHR BUZEI NAME1
<b>INTO TABLE ITAB1</b>
FROM BSEC
WHERE BUKRS = CC " Company Code
AND GJAHR = FY " Fiscal yr
AND REGIO = RR " Region
AND XCPDK = 'X'." One time Customer
regards,
madhu