Application Development 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: 

I'm facing performance issue while accessing the PLAF Table

Former Member
0 Kudos
280

Dar all,

I'm facing performance issue while accessing the PLAF Table.

The START-OF-SELECTION of the report starts with the following select query.

SELECT plnum pwwrk matnr gsmng psttr FROM plaf

INTO CORRESPONDING FIELDS OF TABLE it_tab

WHERE matnr IN s_matnr

AND pwwrk = p_pwwrk

AND psttr IN s_psttr

AND auffx = 'X'

AND paart = 'LA' .

While executing the report in the Quality system it does not face any performance issue...

When it comes to Production System the above said select query itself it is taking 15 - 20 minutes time to move further.

Kindly help me to over come this problem...

Regards,

Jessi

3 REPLIES 3

former_member1245113
Active Contributor
0 Kudos
117

Hi Jessica,

"Just implement its primary Key

make your it_tab fields in the Same order as mentioned in the select query or change the order in the select query
to in line with it_tab declaration

SELECT plnum pwwrk matnr gsmng psttr FROM plaf
INTO CORRESPONDING FIELDS OF TABLE it_tab " Remove 
                                "Into Corresponding Fields of table
WHERE PLNUM BETWEEN '0000000001' AND '9999999999' " By this you
                             " are implementing the Primary Key
 AND matnr IN s_matnr
AND pwwrk = p_pwwrk
AND psttr IN s_psttr
AND auffx = 'X'  " You can omit these two
AND paart = 'LA' .
If you omit the above two then
delete it_tab where auffx NE 'X' and
dekete it_tab where paart NE 'LA'.

Cheerz

Ram

Edited by: Rob Burbank on Mar 16, 2010 9:10 AM

0 Kudos
117

Hi,

"Just implement its primary Key

WHERE PLNUM BETWEEN '0000000001' AND '9999999999' " By this you are implementing the Primary Key

This statement has nothing to do with performance, because system is not able to use primary key or uses every row.

Jessica, your query uses secondary index created by SAP:

1 (Material, plant) which uses fields MANDT MATNR and PLWRK.

but it is not suitable in your case.

You can consider adding new one, which would containt all fields: MANDT, MATNR, PWWRK, PSTTR AUFFX PAART

or - but it depends on number of rows meeting and not meeting (auffx = 'X' AND paart = 'LA' ) condition.

It could speed the performance, if you would create secondary index based on fields MANDT, MATNR, PWWRK, PSTTR

and do like Ramchander suggested: remove AUFFX and PAART from index and where section, and remove these unwanted rows

after the query using DELETE statement.

Regards,

--

Przemysław

Please check how many rows in production system

Former Member
0 Kudos
117

Moderator message - Please see before posting. Nobody can give you a good answer until you do some research to find out where the problem lays - post locked Rob