Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Suggestions Please

Former Member
0 Likes
778

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???

7 REPLIES 7
Read only

Former Member
0 Likes
747

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.

Read only

Former Member
0 Likes
747

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.

Read only

former_member404244
Active Contributor
0 Likes
747

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

Read only

Former Member
0 Likes
747

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

Read only

Former Member
0 Likes
747

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

Read only

Former Member
0 Likes
747

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

Read only

Former Member
0 Likes
747

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