08-25-2008 5:45 AM
Hi,
I dveloped the smart form but when iam executing in dev server working fine and giving me the ouput with in 10 sec but when iam trying to do it in the q/a server it's taking long time (2hr ) to get printed one pallet label, More ever in q/a have 2crore of records where as in dev have 2lacs record. i hope this is because of the select query. I am sending the query which i wrote and now replaced it, still it's taking long time can any one suggest me on this....comented one is the previous select query
DATA : BEGIN OF lt_main OCCURS 0,
matnr LIKE vepo-matnr,
venum LIKE vekp-venum,
ean11 LIKE mean-ean11,
arktx LIKE lips-arktx,
vemng LIKE vepo-vemng,
END OF lt_main.
SELECT DISTINCT
vepo~matnr
vekp~venum
mean~ean11
lips~arktx
vepo~vemng
INTO TABLE lt_main FROM vekp AS vekp
INNER JOIN vepo AS vepo
ON vekpvenum EQ vepovenum
INNER JOIN mean AS mean
ON meanmatnr EQ vepomatnr
INNER JOIN lips AS lips
ON lipsmatnr EQ vepomatnr
WHERE vekp~vpobjkey EQ l_vpobjkey
AND vekp~vpobj EQ '01'
AND vekp~uevel EQ venum
AND mean~eantp EQ 'IS'
AND vepo~vbeln EQ l_vpobjkey
AND vekp~vhilm EQ 'CARTON'.
*
SELECT DISTINCT
vepo~matnr
vekp~venum
vepo~vemng
INTO TABLE lt_main FROM vekp AS vekp
INNER JOIN vepo AS vepo
ON vekpvenum EQ vepovenum
WHERE vekp~vpobjkey EQ l_vpobjkey
AND vekp~vpobj EQ '01'
AND vekp~uevel EQ venum
AND vepo~vbeln EQ l_vpobjkey
AND vekp~vhilm EQ 'CARTON'.
*ENDIF.
Tnaks and Regards,
Shashi
08-25-2008 5:56 AM
08-25-2008 5:58 AM
Hi Sashikala,
Certainly it takes time because VEKP has only one primary key and you are saying that there are 2crore records in QAL.
Please try to avoid SELECT DISTINCT... and select all the data and delete duplicate entries.
to reduce time try to use secondary index of the table, this may somewhat help you.
Best regards,
raam
08-25-2008 5:59 AM
Hi,
If u have that many records it is better to select data seperatly using for all entries statement. These many join conditions will take so much time to fetch.
and at the same time try use select * also.
Regards,
Kusuma.
Edited by: kusuma kurapati on Aug 25, 2008 6:59 AM
08-25-2008 6:07 AM
Hi ,
First things first remove the Inner Joins .
Look for indexes in the tables , but before creating indexes consult your basis consultant as creating indexes may hamper overall server performance .
Secondly go for select query with for all entries.
You can check the performance in se30 .
I think the performance is the only issue you are facing .
Thnks
Sahil Kakkar
08-25-2008 6:13 AM
Hi Shashi,
Let me clear your problem.
First of all the the table VEKP contains only single field as a key which is VENUM. and you are using an inner join with the vepo table.
and passing non key values in the Where clause.
Instead of this what you need to do is
Fire a select query in vekp and fetch all data based on vekp~vpobjkey EQ l_vpobjkey
AND vekp~vpobj EQ '01'
AND vekpuevel EQ venum AND vekpvhilm EQ 'CARTON'.
and fetch the data in the final table.
Now put the select query"FOR ALL ENTRIES IN VEKO' on VEPO AND and get the value in the other table.
Now loop at the first internal table and read the other table and populate the data into the final internal table.
This will resolve your problem