Skip to Content
0
Former Member
Aug 10, 2010 at 11:24 AM

Having Problem in select statement.

27 Views

Dear gurus

im having an issue in select statement.

i have written a select statement which is fetching the result as i required but it takes to much time to execute.

how to make it work fast.

SELECT vbak~vkbur vbap~vbeln vbap~posnr vbak~audat
         vbap~kwmeng vbap~meins vbak~kunnr vbak~vkorg
         vbak~vtweg  vbak~spart matnr matkl auart
         vbap~abgru
  INTO CORRESPONDING FIELDS OF TABLE so_tab
  FROM vbak
  JOIN vbap ON vbak~vbeln = vbap~vbeln
  WHERE audat IN in_date
  AND matnr IN matnr
  AND ( auart = 'ZISO' OR auart = 'ZEXP' )
  AND vbap~werks IN werks  .

  SELECT lips~vbeln lips~posnr likp~lfdat lips~lfimg
         lips~meins likp~kunag matnr vgbel vgpos
         lfart
  INTO CORRESPONDING FIELDS OF TABLE del_tab
  FROM likp
  JOIN lips ON likp~vbeln = lips~vbeln
  FOR ALL entries IN so_tab
  WHERE vgbel = so_tab-vbeln
  AND vgpos = so_tab-posnr
  AND lfdat IN in_date
  AND likp~werks IN werks.

Regards

Saad Nisar.