‎2007 Jul 18 6:57 AM
Hi.
am joining 2 tables to get the data its working good only thing is that its taking long time to execute , please tell me how reduce execution time .Please give me a code.
SELECT FSLNO FCUST FWERKS FMATNR FPURNO FPODATE FBILL FPRICE
FMEINS FQTY1 FQTY2 FQTY3 PNAME1 PORT01 INTO (it_zporder-SLNO,
it_zporder-CUST, it_zporder-WERKS, it_zporder-MATNR, it_zporder-PURNO,
it_zporder-PODATE, it_zporder-BILL, it_zporder-PRICE, it_zporder-MEINS,
it_zporder-QTY1, it_zporder-QTY2, it_zporder-QTY3, it_zporder-NAME1,
it_zporder-ORT01) from zporder as f inner join kna1 as p on f~cust =
pkunnr WHERE fmatnr IN s_matnr AND f~werks IN s_plant AND
f~cust IN s_cust AND
f~slno IN s_slno AND
f~price IN s_date.
append it_zporder.
ENDSELECT.
‎2007 Jul 18 7:01 AM
Hi Prajwal,
You shud use two select stmt on both the table. when you can the data in two internal table. you can join them on the basis of kunnr and cust.
it will definately be fast then your join condition.
ne query ping me.
Regards
Azad.
‎2007 Jul 18 7:01 AM
Hi Prajwal,
You shud use two select stmt on both the table. when you can the data in two internal table. you can join them on the basis of kunnr and cust.
it will definately be fast then your join condition.
ne query ping me.
Regards
Azad.
‎2007 Jul 18 7:02 AM
Its always not suggested to use select and endselect.
To avoid this use the select <> into table it_tab format
for getting the records into table it_zporder in your case
SELECT F~SLNO F~CUST F~WERKS F~MATNR F~PURNO
F~PODATE F~BILL F~PRICE F~MEINS F~QTY1
F~QTY2 F~QTY3 P~NAME1 P~ORT01
INTO corresponding fields of table it_zporder
from zporder as f inner join kna1 as p
on f~cust = p~kunnr
WHERE f~matnr IN s_matnr AND f~werks IN s_plant AND
f~cust IN s_cust AND
f~slno IN s_slno AND
f~price IN s_date.Regards
Gopi
‎2007 Jul 18 7:14 AM
‎2007 Jul 18 8:14 AM
Try to avoid INTO Corresponding fields. It will still improve the performance.
In this process make sure you follow the order of fields in the select query according to the order of fields in the table only.
Regards
Gopi
‎2007 Jul 18 7:08 AM
data:
begin of fs_zporder,
SLNO like zporder-SLNO,
CUST like zporder-CUST,
WERKS like zporder-WERKS,
MATNR like zporder-MATNR,
PURNO like zporder-PURNO,
PODATE like zporder-PODATE,
BILL like zporder-BILL,
PRICE like zporder-PRICE,
MEINS like zporder-MEINS,
QTY1 like zporder-QTY1,
QTY2 like zporder-QTY2,
QTY3 like zporder-QTY3,
NAME1 like zporder-NAME1,
ORT01 like zporder-ORT01,
end of fs_zporder.
data: t_zporder like standard table of fs_zporder.
SELECT FSLNO FCUST FWERKS FMATNR FPURNO FPODATE FBILL FPRICE
FMEINS FQTY1 FQTY2 FQTY3 PNAME1 PORT01 INTO table t_zporder from zporder as f inner join kna1 as p on f~cust =
pkunnr WHERE fmatnr IN s_matnr AND f~werks IN s_plant AND
f~cust IN s_cust AND
f~slno IN s_slno AND
f~price IN s_date.
Change the necessary modifications.
Avoid using ENDSELECT.
Regards,
Pavan P.