‎2006 Jun 16 9:47 AM
Hi,
Ive been told to remove all warnings from a large piece of code and after removing quite a few ive run into a couple i don't understand.
This warning message comes after running the code inspector (SCI)
Order subobject has error performance check: (1). Function Group /GAMMA/GV_ORDER_COM_CLASS
Include /GAMMA/LGV_ORDER_COM_CLASSU01 Row 000067 Column 002 - Table AUFK:No First Field from Table Index in WHERE Condition.
in the following code
SELECT aufnr INTO TABLE t_aufnr
FROM aufk
WHERE bukrs EQ gs_key_com819_class-bukrs
AND jv_jibcl EQ gs_key_com819_class-jibcl
AND werks IN r_werks.
Does anyone have any ideas what this error means???
‎2006 Jun 16 9:56 AM
Just one wild guess. Can you re-write the code as below as see.
SELECT aufnr INTO TABLE t_aufnr
FROM aufk
WHERE MANDT EQ SY-MANDT
AND bukrs EQ gs_key_com819_class-bukrs
AND werks IN r_werks
AND jv_jibcl EQ gs_key_com819_class-jibcl.Cheers,
TM.
‎2006 Jun 16 9:56 AM
Hi James,
The warning in the Code Inspector is to include your key fields in the selection criteria.
i.e. If possible include the key field AUFNR of AUFK table in the WHERE condition. But from your code I can see that you retrieve AUFNR from the table hence you can ignore this warning.
SELECT aufnr INTO TABLE t_aufnr
FROM aufk
WHERE <b>aufnr EQ '011000000'</b>
bukrs EQ gs_key_com819_class-bukrs
AND jv_jibcl EQ gs_key_com819_class-jibcl
AND werks IN r_werks.
Regards,
Wenceslaus.
‎2006 Jun 16 10:04 AM
Hi james,
use the key field aufnr and rewite the code.I guess u can use select single instead of table and in the where condition use aufnr field..
Regards,
nagaraj
‎2006 Jun 16 10:07 AM
Hi,
You need to include AUFNR in your where clause.
that is misisng , Because of that it gave the error in Code inspector.
SELECT aufnr INTO TABLE t_aufnr
FROM aufk
WHERE <b>AUFNR EQ aufnr</b>
and bukrs EQ bukrs
AND jv_jibcl EQ jv_jibcl
AND werks IN r_werks.now check it. it will not give it.
Regards
vijay
‎2006 Jun 16 10:07 AM
Hi,
You are trying to select data from aufk without
using any key fields thats why you are getting
warning in SCI.
Use this
<b> range aufnr for aufk-aufnr.</b>
SELECT aufnr INTO TABLE t_aufnr
FROM aufk
WHERE <b>aufnr in r_aufnr</b>
bukrs EQ gs_key_com819_class-bukrs
AND jv_jibcl EQ gs_key_com819_class-jibcl
AND werks IN r_werks.
Regards
Amole
‎2006 Jun 16 10:09 AM
Hi,
SELECT aufnr INTO FROM aufk
WHERE bukrs EQ gs_key_com819_class-bukrs
AND jv_jibcl EQ gs_key_com819_class-jibcl
AND werks IN r_werks
append it_aufk.
endselect.
Regards
Amole
‎2006 Jun 16 2:32 PM
I think you can both get rid of the warning and speed up the select without changing the program functionality by doing:
SELECT aufnr INTO TABLE t_aufnr
FROM aufk
WHERE autyp IN ('01', '02', '03', '04', '05', '06', '10', '20',
'30', '40', '50', '60', '70')
AND werks IN r_werks
AND jv_jibcl EQ gs_key_com819_class-jibcl
and bukrs EQ gs_key_com819_class-bukrs.
Adding all of the AUTYPs should force the select to use a secondary index. Instead of the way I coded this, you could use a range table.
Rob