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: 

Please optimise des Codes

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

8 REPLIES 8

Former Member
0 Kudos

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

0 Kudos

No still its taking lotz time....Problem is its account table ..n it has huuuuge data..so ny other Table???

0 Kudos

u are fertching complete one year data , in that case it will take time .

or

break into monthwise.

Regards

Prabhu

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

Thnx ...its working ...

Former Member
0 Kudos

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