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

tunning during selection

Former Member
0 Likes
1,046

Hi Experts,

I have wrote a select statement as below and basically it is taking a lot of time to execute this particular statement.

Can anyone guide me to make the below statement to execute faster.

i_vbfa = standard table

i_likp_lips = standard table

SELECT vbelv posnv vbeln posnn

FROM vbfa INTO TABLE i_vbfa

FOR ALL ENTRIES IN i_likp_lips

WHERE vbeln EQ i_likp_lips-vbeln AND

posnn EQ i_likp_lips-posnr AND

vbtyp_n IN s_vbtypn AND

vbtyp_v IN s_vbtypv.

9 REPLIES 9
Read only

Former Member
0 Likes
1,018

Hi

If not i_likp_lips[] is initial.

SELECT vbelv posnv vbeln posnn

FROM vbfa INTO TABLE i_vbfa

FOR ALL ENTRIES IN i_likp_lips

WHERE vbeln EQ i_likp_lips-vbeln AND

posnn EQ i_likp_lips-posnr AND

vbtyp_n IN s_vbtypn AND

vbtyp_v IN s_vbtypv.

Endif.

Second just check the the Secondary index .

I think if you create secondary index on the fileds you mentioned it will be much faster.

Regards

Neha

Read only

0 Likes
1,018

HI Neha,

Sorry what is the meaning with secondary index.

Read only

Former Member
0 Likes
1,018

Hi saravannan sithambaram,

Wht do you mean by standard tables, Try to post how did You declare the two internal tables and wht fields do they contain.

And what values are You giving input to s_vbtypn and s_vbtypv.

And how are you selecting data fo i_likp_lips.

Thanks,

SG

Edited by: Suneel Kumar Gopisetty on Dec 3, 2008 11:27 AM

Read only

JoffyJohn
Active Contributor
0 Likes
1,018

Rather than doing manipulation directly in table

Get the content of VBFA table based on

vbtyp_n IN s_vbtypn AND

vbtyp_v IN s_vbtypv.

into an internal table and then manipulate that internal table data.

As it takes less take.

Read only

Former Member
0 Likes
1,018

Hi saravannan sithambaram ,

In your where condition change as follows :

VBFA-VBELV should be EQ likp_lips-VBELN

VBFA-POSSV should be EQ likp_lips-POSSN.

WHERE vbelv EQ i_likp_lips-vbeln AND

posnv EQ i_likp_lips-posnr AND

vbtyp_n IN s_vbtypn AND

vbtyp_v IN s_vbtypv.

Regards,

SG

Read only

Former Member
0 Likes
1,018

Hi ...

Have able to Tune Your Statement.

Regards,

SG

Read only

0 Likes
1,018

Hi Suneel,

I have tried but it seems not wroking fine.

Read only

Former Member
0 Likes
1,018

Hi,

Create a secondary index for your table using the fields

on which you are placing the selection criterion.

Regards,

Rajat

Read only

Former Member
0 Likes
1,018

thanks everyone