Skip to Content
0
Former Member
Feb 20, 2008 at 03:25 PM

Performance tuning

16 Views

Hi,

I've got four selection screen fileds like SO document , SO creation date, Delivery document and delivery date.The end user uses any one among this which is why i've got performance issue here in my queries...........

SELECT vbeln

erdat

kunnr

FROM vbak INTO TABLE g_tab_so_head

WHERE vbeln IN s_vbeln AND

erdat IN s_erdat AND

kunnr IN s_kunnr.

IF sy-subrc = 0.

SORT g_tab_so_head BY vbeln.

SELECT vbeln

posnr FROM vbap INTO TABLE g_tab_so_item

FOR ALL ENTRIES IN g_tab_so_head

WHERE vbeln = g_tab_so_head-vbeln.

IF sy-subrc = 0.

SORT g_tab_so_item BY vbeln posnr.

SELECT vbeln

posnr

vgbel

vgpos

vgtyp FROM lips

INTO TABLE g_tab_deliv_item

FOR ALL ENTRIES IN g_tab_so_item

WHERE vgbel = g_tab_so_item-vbeln AND

vgpos = g_tab_so_item-posnr AND

vgtyp = 'C'.

IF sy-subrc = 0.

SORT g_tab_deliv_item BY vbeln posnr.

SELECT vbeln

erdat

FROM likp INTO TABLE g_tab_deliv_head

FOR ALL ENTRIES IN g_tab_deliv_item

WHERE vbeln = g_tab_deliv_item-vbeln AND

erdat IN s_date.

IF sy-subrc = 0.

SORT g_tab_deliv_head BY vbeln.

SELECT vbeln

posnr

bktxt FROM zvlxxtr

INTO TABLE g_tab_track

FOR ALL ENTRIES IN g_tab_deliv_item

WHERE vbeln = g_tab_deliv_item-vbeln AND

posnr = g_tab_deliv_item-posnr AND

bktxt IN s_track.

SORT g_tab_track BY vbeln posnr.

The entries in LIPS table are taking lot of time to fetch data......i dont know why........can any one please come up with solution to get this done.........