Application Development and Automation 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: 
Read only

Problem in Executing with Select-Options..

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
831

Hi all,

I'm facing some strange problem while exceuting my transaction.

The point is that when i enter the values i.e in select-options

(a) Document Number: XXXXXXXXX to XXXXXXXXX

It's working fine.

Execution time is very less.

(b) But when i enter the single values in the select-options i.e clicking the extend button and then entering the single entries in it.

Document Number: XXXXXXXX

YYYYYYYY

ZZZZZZZZ

It's taking very very very much time.

But the requirement is like that to give the single values..

How to go about this...

Please help....

Cheers,

Simha.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
795

Well first of all, like everyone else said, try to use other tables sepcially if you are not using any keys on an existing index.

Second, if you trace your SELECT (via ST05) using single values and range, you would notice the difference on how the SQL statement is built. Your single value SELECT will have an OR statement on all the values, which is EXTREMELY slow. In ABAP you won't notice this because all we do is have the WHERE clause like BUKRS in S_BUKRS. But in your database SQL statement, it will be different.

Hope that helps.

8 REPLIES 8
Read only

Former Member
0 Likes
795

Can you show us your coding?

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
795

Hi Ravi,

i have done nothing different to achieve this..

just followed the normal procedure...

do i have to give something extra in the select query..

SELECT * INTO TABLE i_bseg FROM bseg

WHERE bukrs IN bukrs AND

belnr IN belnr AND

GJAHR IN GJAHR AND

BSCHL = 50.

Regards,

Simha.

Read only

0 Likes
795

Select * on Bseg and that too without key fields on Mseg??

Try using other tables in the cluster like BSID and BSAD

Cheers

VJ

Read only

0 Likes
795

Try to get the data from Bsi* tables instead(they are secondary indexes on the main table, much faster).

BSID Accounting: Secondary Index for Customers

BSIK Accounting: Secondary Index for Vendors

BSIM Secondary Index, Documents for Material

BSIP Index for Vendor Validation of Double Docu

BSIS Accounting: Secondary Index for G/L Accoun

Regards,

Ravi

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
795

Hi,

But what's the actual problem??

When i give the range it's working fine and taking less execution time...

what's wrong in giving the single values in the extended key...

can u brief me...

Cheers,

Simha.

Read only

0 Likes
795

Try removing the BSCHL = 50 part of it from the statement. But as others said, try using other tables. BSEG is large table and it typically has performance problems.


SELECT * INTO TABLE i_bseg 
         FROM bseg
         WHERE bukrs IN bukrs 
           AND belnr IN belnr
           AND gjahr IN gjahr.

 DELETE i_bseg WHERE bschl <> 50.

Read only

Former Member
0 Likes
795

Hi,

Can u paste ur code? Both ways the system should work same similar.

if you are using the <b>IN</b> in the WHERE clause of the select both should work the same way.

Cheers

VJ

Read only

Former Member
0 Likes
796

Well first of all, like everyone else said, try to use other tables sepcially if you are not using any keys on an existing index.

Second, if you trace your SELECT (via ST05) using single values and range, you would notice the difference on how the SQL statement is built. Your single value SELECT will have an OR statement on all the values, which is EXTREMELY slow. In ABAP you won't notice this because all we do is have the WHERE clause like BUKRS in S_BUKRS. But in your database SQL statement, it will be different.

Hope that helps.