‎2008 Dec 03 3:04 AM
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.
‎2008 Dec 03 3:15 AM
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
‎2008 Dec 03 3:17 AM
‎2008 Dec 03 3:27 AM
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
‎2008 Dec 03 3:30 AM
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.
‎2008 Dec 03 3:37 AM
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
‎2008 Dec 03 4:19 AM
‎2008 Dec 03 6:23 AM
‎2008 Dec 03 6:26 AM
Hi,
Create a secondary index for your table using the fields
on which you are placing the selection criterion.
Regards,
Rajat
‎2009 Jan 20 9:32 AM