Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to tune expencesive sql statement

Hi,

I have an expencesive sql statement.

how to tune this one.

  • Get Q linked to position

lt_objid[] = I_OBJID_TAB[].

IF NOT LT_OBJID[] IS INITIAL.

SELECT OBJID SOBID INTO TABLE LT_STOQ

FROM HRP1001

FOR ALL ENTRIES IN LT_OBJID

WHERE OTYPE = 'S'

AND OBJID = LT_OBJID-OBJID

AND PLVAR = '01'

AND RSIGN = 'A'

AND RELAT = 'ZPC'

AND ISTAT = '1'

AND BEGDA <= KDATE

AND ENDDA >= KDATE

AND SCLAS = 'Q'.

IF SY-SUBRC = 0.

LOOP AT LT_STOQ.

LT_OBJID2-OBJID = LT_STOQ-SOBID.

APPEND LT_OBJID2.

ENDLOOP.

SORT LT_OBJID2.

DELETE ADJACENT DUPLICATES FROM lt_objid2.

ENDIF.

Thanks in Advance

Former Member
Not what you were looking for? View more on this topic or Ask a question